angular-gettext icon indicating copy to clipboard operation
angular-gettext copied to clipboard

Add support for multiple fallback languages (fallback waterfall)

Open xob opened this issue 6 years ago • 3 comments

For my project, we wanted to have a fallback waterfall. We have 6 languages (en, fr, de, nl, it, es), and we wanted to be able to define that en falls back to es, then fr, then de, then.. We wanted to do that for all our languages.

In this PR, I kept the original fallback support (en_GB falling back to en), and added the fallback waterfall functionality.

Any and all feedback is welcome.

Sort of fixes #210, which is already closed.

xob avatar Nov 20 '17 14:11 xob

I'm curious for the use case. why do you assume someone who speaks english understands spanish, frensh and german? wouldn't the frontend look completely weird if there is the potential that 6 different languages would be visible?

ngehlert avatar Feb 20 '19 19:02 ngehlert

The use case is that we prefer showing the wrong language to users (with the waterfall defined as the languages that the users have the biggest chance of understanding first), instead of showing a translation error, such as a translation key (my.project.title).

Sure, it's still wrong, but it's arguably "less wrong" than showing the translation keys.

xob avatar Feb 20 '19 20:02 xob

Sure, it's still wrong, but it's arguably "less wrong" than showing the translation keys.

That's just fixing wrong with more wrong :-)

Gettext is designed to have English as translation keys. If you want to use symbolic translation keys, there are probably better solutions available.

rubenv avatar Feb 21 '19 08:02 rubenv