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

Add user-configurable preferred language, locale detection #944

merged 9 commits into from Jun 26, 2019


Copy link

@jmromer jmromer commented Jun 25, 2019

Provides localization toggling via, in order of precedence:

  1. Query param (settable via the footer UI)
  2. User preference (settable via the user#edit?root form)
  3. The ACCEPT_LANGUAGE header (minimally. settable via browser options)

Adds stub localization files for Spanish (for testing) and Dutch with generated translations of models and attributes

Next steps

  • Externalize template strings to English localization files
  • Set up a translation service (PhraseApp, CrowdIn, Transifex, Locale)



Screen Shot 2019-06-26 at 11 24 11 AM

site footer

Screen Shot 2019-06-26 at 11 24 24 AM

via browser preferences

Screen Shot 2019-06-26 at 11 25 11 AM

@jmromer jmromer force-pushed the i18n-1 branch 10 times, most recently from acc1418 to 4af1ccc Compare Jun 26, 2019
@jmromer jmromer self-assigned this Jun 26, 2019
@jmromer jmromer marked this pull request as ready for review Jun 26, 2019
@jmromer jmromer requested a review from sethherr Jun 26, 2019
@jmromer jmromer changed the title Add user-configurable preferred language Add user-configurable preferred language, locale detection Jun 26, 2019
@jmromer jmromer force-pushed the i18n-1 branch 5 times, most recently from 0355273 to 4860d5e Compare Jun 26, 2019
Copy link

@sethherr sethherr left a comment

Yay! It begins

Jake Romer added 5 commits Jun 26, 2019
- Adds string `preferred_language` column to user
- Adds validator method to ensure language code corresponds to an available
Detect locale from:

1. request param (settable via dropdown in footer)
2. user preferences (settable via users#edit?root)
3. request header (minimally)
@jmromer jmromer merged commit 8b858a6 into master Jun 26, 2019
2 checks passed
@jmromer jmromer deleted the i18n-1 branch Jun 26, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet
None yet

Successfully merging this pull request may close these issues.

None yet

2 participants