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

Set app default language as language of the user browser settings #690

Merged

Conversation

pavel-ilin
Copy link

⚠️ IMPORTANT: Please do not create a Pull Request without creating an Issue first.

All changes need to be discussed before proceeding. Failure to do so may result in the pull request being rejected.

Before submitting a pull request, please be sure to review:


Please include the issue number the pull request fixes by replacing YOUR-ISSUE-HERE in the text below.

Fixes #657

Summary

Following @njordhov advice, default language of the app set by checking web browser settings.

Details

Add default language of the app in Translation component with using window.navigator.language.

If user browser language is not found in the backend, by default English language will be used.

Test Plan (required)

yarn start
set default language in your browser
open login page

tested in Chrome and Opera browsers.

Final Checklist

  • For CoronaTracker, did you bump the version in package.json?
    • Update the second decimal for a major change
    • Update the third decimal for a minor change
    • Numbers can go past 9, e.g. 1.0.9 => 1.0.10
    • For more info, read about Semantic Versioning
  • Did you add any new tests as necessary?
  • Is your PR rebased off the most current master?
  • Have you squashed all commits? (can be done at merge)
  • Did you use yarn not npm? (important!)
  • Did you use Material-UI wherever possible?
  • Did you run yarn lint on the code?
  • Did you run all of your most recent changes locally to make sure everything is working?

client/src/components/Translations.jsx Outdated Show resolved Hide resolved
client/src/components/Translations.jsx Outdated Show resolved Hide resolved
@AdhamAH AdhamAH merged commit 7d1e0e0 into COVID-19-electronic-health-system:master May 6, 2020
AdhamAH added a commit to AdhamAH/Corona-tracker that referenced this pull request May 6, 2020
Survey reminder (COVID-19-electronic-health-system#681)

* added daily reminder

* bump package/fixed more

* update survey reducer test

* change bg color of dialog

* modify clear survey

Onboard small screens fix (COVID-19-electronic-health-system#687)

* Onboard small screens fix

* Onboard small screens fix

* Update package.json

Update Corona-tracker docs for ROADMAP-TO-MVP (COVID-19-electronic-health-system#688)

* roadmap: clean up typos and reflow list

* roadmap: small tweaks

* roadmap: add link to open issues by label

* readme: add roadmap info section and links

* readme: fix COVID-19-electronic-health-system#648 add opencollective shields badge

* fix COVID-19-electronic-health-system#649 add twitter and discord badges

* readme: move application overview above faq

* move wireframe image to design readme

* readme: fix COVID-19-electronic-health-system#666 add PanFLUte link

* readme: fix COVID-19-electronic-health-system#627 add and cleanup translations refs

* update translation readme formatting and links

Create `main.yml` (COVID-19-electronic-health-system#689)

Merge remote-tracking branch 'upstream/master' into Pulse

Set app default language as language of the user browser settings (COVID-19-electronic-health-system#690)

* set app default language as language of the use OS

* package.js

* fix default language setiing

* fix rendering with useEffect hook

* fix rendering with useEffect hook

Update package.json
AdhamAH added a commit to AdhamAH/Corona-tracker that referenced this pull request May 6, 2020
* added daily reminder

* bump package/fixed more

* update survey reducer test

* change bg color of dialog

* modify clear survey

Onboard small screens fix (COVID-19-electronic-health-system#687)

* Onboard small screens fix

* Onboard small screens fix

* Update package.json

Update Corona-tracker docs for ROADMAP-TO-MVP (COVID-19-electronic-health-system#688)

* roadmap: clean up typos and reflow list

* roadmap: small tweaks

* roadmap: add link to open issues by label

* readme: add roadmap info section and links

* readme: fix COVID-19-electronic-health-system#648 add opencollective shields badge

* fix COVID-19-electronic-health-system#649 add twitter and discord badges

* readme: move application overview above faq

* move wireframe image to design readme

* readme: fix COVID-19-electronic-health-system#666 add PanFLUte link

* readme: fix COVID-19-electronic-health-system#627 add and cleanup translations refs

* update translation readme formatting and links

Create `main.yml` (COVID-19-electronic-health-system#689)

Merge remote-tracking branch 'upstream/master' into Pulse

Set app default language as language of the user browser settings (COVID-19-electronic-health-system#690)

* set app default language as language of the use OS

* package.js

* fix default language setiing

* fix rendering with useEffect hook

* fix rendering with useEffect hook

Update package.json
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.

[FEAT] User can go directly to their language with URL path, ie say /nederlands or /espanol, etc.
3 participants