angular-gettext
angular-gettext copied to clipboard
Add support for multiple fallback languages (fallback waterfall)
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.
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?
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.
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.