Allow a generic language map for each language to reduce key duplication#3414
Open
SteveHawes wants to merge 6 commits intojonataslaw:masterfrom
Open
Allow a generic language map for each language to reduce key duplication#3414SteveHawes wants to merge 6 commits intojonataslaw:masterfrom
SteveHawes wants to merge 6 commits intojonataslaw:masterfrom
Conversation
…e specific country variant map (or the country variant map is not found) the first choice for the fallback is a generic language file. e.g. If the locale is currently "en_GB" and the requested key does not exist in the "en_GB" translations map (or "en_GB" does not exist at all) then it will first look for a map with the key "en". If that exists then this is the translation map that will be used otherwise it will use the current behaviour. In this way you can supply a single language map for each language that contains all the keys and then add only the keys that need to be overridden for a specific country variant. e.g. "en" - contains all keys for the English language "en_AU" - contains only the country specific keys that are different to the main map such as date format etc. "en_GB" - contains only the country specific keys that are different to the main map such as date format etc. "en_US" - contains only the country specific keys that are different to the main map such as date format etc.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Enhanced the Internationalisation so that if a key is not found in the specific country variant map (or the country variant map is not found) the first choice for the fallback is a generic language file.
e.g. If the locale is currently "en_GB" and the requested key does not exist in the "en_GB" translations map (or "en_GB" does not exist at all) then it will first look for a map with the key "en".
If that exists then this is the translation map that will be used otherwise it will use the current behaviour.
Every PR must update the corresponding documentation in the
code, and also the readme in english with the following changes.Pre-launch Checklist
///).