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

Allow supporting other preferred languages #28

Open
wants to merge 10 commits into
base: swift3
Choose a base branch
from

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