Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fallback to fallback locale for missing strings in translation file #46

Closed
wants to merge 1 commit into from

Conversation

cornerman
Copy link

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 the fallbackLocale 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.

@diegoveloper
Copy link

any news about this PR?

@Teifun2
Copy link

Teifun2 commented Dec 6, 2020

This would be a really good Feature!
Is currently nobody Mainlining this repo?

@taniket15
Copy link

any update??

@Teifun2
Copy link

Teifun2 commented Dec 26, 2020

This is so usefull. I started to use cornerman's repository in my pub now! Thanks for this change!

@bratan bratan closed this Mar 18, 2021
@cornerman
Copy link
Author

@bratan Is there a reason for closing this PR? Do you not want to support fallbacks or is there something to improve?

@bratan
Copy link
Member

bratan commented Apr 9, 2021

@cornerman - I consider that keys should not be missing from translation files and if they do I would consider it a bug.

@cornerman
Copy link
Author

@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.

@bratan
Copy link
Member

bratan commented Apr 10, 2021

Introducing this feature as optional would be alright, however an example needs to be provided as well as updating the documentation.

@fdietze
Copy link

fdietze commented Aug 1, 2021

FYI: I just rebased this branch on the latest master.

@guillaumeboehm
Copy link

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.

@simplenotezy
Copy link

@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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants