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 default local if unavailable locale requested #1610

Merged
merged 1 commit into from
Aug 13, 2019

Conversation

mamhoff
Copy link
Contributor

@mamhoff mamhoff commented Aug 13, 2019

What is this pull request for?

If an app that uses Alchemy has it's ::I18n.available_locales array restricted to only a few locales, but the user's browser or a stale :alchemy_locale session value request one that is not listed as available, set the session to the default locale.

In cases where the app has enforce_available_locale set to `true, the previous behaviour would raise an error - which would make Alchemy unusable because of an unavailable locale.

In cases where a user's browser or an out-of-date session request a
locale that the current app is not able to serve, set session and locale
to the default locale of the app.
@mamhoff
Copy link
Contributor Author

mamhoff commented Aug 13, 2019

The failing spec seems to be unrelated?

Copy link
Member

@tvdeyen tvdeyen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice. Thanks.

Restarted the job as the spec failure is unrelated.

@tvdeyen tvdeyen merged commit 86cced4 into AlchemyCMS:master Aug 13, 2019
tvdeyen added a commit that referenced this pull request Aug 13, 2019
- Fallback to default locale if unavailable locale requested (#1610)
tvdeyen added a commit that referenced this pull request Aug 13, 2019
- Fallback to default locale if unavailable locale requested #1610
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