-
Notifications
You must be signed in to change notification settings - Fork 5.2k
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(i18n): save and load locale from redux store #1723
Conversation
This pull request is being automatically deployed with Vercel (learn more). 🔍 Inspect: https://vercel.com/uniswap/uniswap-interface/Gc9nfRZTXU8NBbRJkMb1BZ4d72sJ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can you merge main so the deleted files are removed from the diff?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
just one more important change (order of preference)
src/i18n.tsx
Outdated
const [language, region] = navigator.language.split('-') | ||
|
||
if (region) { | ||
return parseLocale(`${language}-${region}`) ?? parseLocale(language) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
region.toUpperCase()
Note that in Safari on iOS prior to 10.2, the country code returned is lowercase: "en-us", "fr-fr" etc.
https://developer.mozilla.org/en-US/docs/Web/API/NavigatorLanguage/language
* wrap sock around function component to get re-renders * removed sourcelocale since we are using custom ids * load locale data dynamically * undo dev change * ran yarn i18n:extract * store locale in redux * added support for redux * restored header * refactor * addressed pr feedback * specify type * added navigator locale fallback to generic dialect * make locale array const and typed * addressed pr feedback * fixed various * addressed pr feedback * make supported locales constant uppercase * add back toUpperCase removed during refactoring * removed lingui/detect-locale * run yarn
No description provided.