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

Use a supported locale for localization #156

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

sundling
Copy link

The changes in #137 causes the exception I18n::InvalidLocale: :en is not a valid locale to be raised if the application doesn't support the en locale.
It could be that the application uses en-US instead or maybe an English locale isn't available at all.

This change fixes the exception by looking for English based locales and will fallback to I18n.default_locale if none is found.
Sorting the locales ensure that en is used if it is available.

Look for English based locales and fallback to I18n.default_locale if none is found.
Uses :en if available.
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.

1 participant