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
merged 9 commits into from Jun 26, 2019

Conversation

@jmromer
Copy link
Member

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)

Screenshots

/my_account

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 Jun 25, 2019
@jmromer jmromer force-pushed the i18n-1 branch from a0616b7 to 5693125 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 force-pushed the i18n-1 branch from 5693125 to 1bcf39e Jun 26, 2019
@jmromer jmromer requested a review from sethherr Jun 26, 2019
@jmromer jmromer force-pushed the i18n-1 branch from 1bcf39e to 813b435 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 Jun 26, 2019
Copy link
Member

sethherr left a comment

Yay! It begins

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

1. request param (settable via dropdown in footer)
2. user preferences (settable via users#edit?root)
3. request header (minimally)
jmromer added 4 commits Jun 26, 2019
@jmromer jmromer force-pushed the i18n-1 branch from 58d6626 to e2b85cb Jun 26, 2019
@jmromer jmromer merged commit 8b858a6 into master Jun 26, 2019
2 checks passed
2 checks passed
ci/circleci: build Your tests passed on CircleCI!
Details
ci/circleci: upload-coverage Your tests passed on CircleCI!
Details
@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
Projects
None yet
2 participants
You can’t perform that action at this time.