Skip to content

Comments

Allow supporting other preferred languages#28

Open
paulrolfe wants to merge 10 commits intotomkowz:swift3from
IntrepidPursuits:pr/preferred-ordering
Open

Allow supporting other preferred languages#28
paulrolfe wants to merge 10 commits intotomkowz:swift3from
IntrepidPursuits:pr/preferred-ordering

Conversation

@paulrolfe
Copy link

@paulrolfe paulrolfe commented Mar 13, 2017

Instead of just using the first supported language, look at all the preferred ones, trying to return one for which the language file exists. And if we have none, just return the first one.

This solves the problem where your project has localized something else in a region specific language, but still want to use the a general language (without region) for the base translations.
For Example:

  • You localize fr-FR on one file that should be specific to France.
  • But you still want to use fr.json for the base translations.
  • This will try to grab fr-FR.json, but if it doesn't exist will use fr.json, assuming that is another supported language in your project.

@paulrolfe paulrolfe changed the title So we can support the language if it exists. Allow supporting other preferred languages Mar 13, 2017
@paulrolfe paulrolfe force-pushed the pr/preferred-ordering branch from 5252b59 to 4a08d3d Compare October 3, 2018 15:45
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.

2 participants