Closed cornerman closed 3 years ago
any news about this PR?
This would be a really good Feature! Is currently nobody Mainlining this repo?
any update??
This is so usefull. I started to use cornerman's repository in my pub now! Thanks for this change!
@bratan Is there a reason for closing this PR? Do you not want to support fallbacks or is there something to improve?
@cornerman - I consider that keys should not be missing from translation files and if they do I would consider it a bug.
@bratan That is a valid point of view. Though, I have already worked in different teams, where this was not the case and a fallback was required - until the translations where updated for all languages. Taking into account that there are different approaches to this problem and judging by the reactions to this PR, it might make sense to introduce it as an option. You can opt-in if you need it, or work without a fallback if that is better for you.
Introducing this feature as optional would be alright, however an example needs to be provided as well as updating the documentation.
FYI: I just rebased this branch on the latest master.
Hi, hopefully this is not necroposting too much, but I feel like this feature would be very useful too. Especially for projects with community driven translations where I think it is acceptable to go to production even without every translations completed.
@bratan would love to see this feature too; it's a common strategy for many translation providers.
In a startup like ours, we sometimes would like to release without having job done from all translation teams.
Currently, if a translation file is incomplete (i.e. a key is missing), then we will show the
key
instead of a translation. But for me it would be more intuitive to fallback to thefallbackLocale
in these cases.This allows to iteratively translate an App and if something is forgotten or not yet translated, we have a more meaningful placeholder.
Currently, I just load both translation maps (the chosen locale and the fallback locale) and then fallback during lookup. Another alternative is to merge the maps in the beginning and then just have one translation map.
Let me know, what you think. We could also make this a setting.