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

feat(locale): use cookie to determine current locale #55

Merged
merged 1 commit into from
Jul 29, 2019

Conversation

priley86
Copy link
Contributor

@priley86 priley86 commented Jul 24, 2019

What's included

* use rh_locale cookie to set i18n locale if it's available
* use env variables as a fallback if we can't find a supported locale

Valid i18n codes (and major codes):
https://github.com/ladjs/i18n-locales#tip

How to test

  1. update the NPM packages with $ yarn
  2. $ yarn test:dev

Example

.

Updates issue/story

closes #44

@priley86 priley86 changed the title Issues/44 feat(locale): use cookie to determine current locale Jul 24, 2019
@priley86 priley86 requested a review from cdcabrera July 24, 2019 21:39
@codecov-io
Copy link

codecov-io commented Jul 24, 2019

Codecov Report

Merging #55 into master will increase coverage by 0.42%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master      #55      +/-   ##
==========================================
+ Coverage   86.68%   87.11%   +0.42%     
==========================================
  Files          23       23              
  Lines         293      295       +2     
  Branches       60       62       +2     
==========================================
+ Hits          254      257       +3     
+ Misses         31       30       -1     
  Partials        8        8
Impacted Files Coverage Δ
src/services/userServices.js 94.73% <100%> (+6.5%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 9828e6a...b9ae50a. Read the comment docs.

Copy link
Member

@cdcabrera cdcabrera left a comment

Choose a reason for hiding this comment

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

Few updates based on discussion. Plus a rebase with the latest master config updates.

src/services/userServices.js Outdated Show resolved Hide resolved
src/services/userServices.js Outdated Show resolved Hide resolved
src/services/userServices.js Outdated Show resolved Hide resolved
src/services/userServices.js Show resolved Hide resolved
src/services/userServices.js Show resolved Hide resolved
src/services/__tests__/userServices.test.js Outdated Show resolved Hide resolved
src/services/__tests__/userServices.test.js Outdated Show resolved Hide resolved
.env Outdated Show resolved Hide resolved
.env Outdated Show resolved Hide resolved
package.json Show resolved Hide resolved
@priley86
Copy link
Contributor Author

how long does this travis build go? I'm still clicking "cookies" over here 😸

Copy link
Member

@cdcabrera cdcabrera left a comment

Choose a reason for hiding this comment

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

Looks good, just a rebase, squash, and commit message amend with PR number

* use rh_locale cookie to set i18n locale if it's available
* use env var as a fallback if we can't find a supported locale
* gitignore, added en-US locale
@cdcabrera cdcabrera merged commit c568794 into RedHatInsights:master Jul 29, 2019
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.

Get locale from JWT or locale cookie
3 participants