webtides / element-js

Simple and lightweight base classes for web components with a beautiful API
MIT License
28 stars 3 forks source link

i18n fallback does not work as expected #21

Closed MagnusPanter closed 3 years ago

MagnusPanter commented 3 years ago

The i18n method from the element-js package is not working as expected. The fallback you can define when calling the method is only used when you have a connection-error.

e.g.: i18n('someForm.headline', 'Now or never')

I was expecting that it uses the fallback string when the key or no translation for the key is available. Right now it gives back the key 'someForm.headline' as the translation when I haven't got the key in my translationfiles.

quarkus commented 3 years ago

Totally true! Just came across this and wanted to raise the exact same issue!