-
Notifications
You must be signed in to change notification settings - Fork 27.6k
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
Fix language fallback in with-react-intl example #8894
Conversation
The call to `accept.languages()` made the fallback not work. When called e.g. with `Accept-Language: es-ES,es;q=0.9`, `locale` would contain `[ 'es-ES', 'es' ]` instead of `en`. (See also: https://www.npmjs.com/package/accepts#languagelanguages )
Stats from current PRDefault Server ModeGeneral
Client Bundles (main, webpack, commons)
Client Bundles (main, webpack, commons) Modern
Client Pages
Client Pages Modern
Client Build Manifests
Rendered Page Sizes
Serverless ModeGeneral
Client Bundles (main, webpack, commons)
Client Bundles (main, webpack, commons) Modern
Client Pages
Client Pages Modern
Client Build Manifests
Serverless bundles
Commit: 9fe9435 |
Never mind, now languages that are actually supported don't work. Looks like this requires a slightly more elaborate solution. |
Um... sorry, my original solution was correct. I thought I was wrong because of something else that was going on in the app where I use this example. Just double-checked it purely with this example again. |
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.
LGTM, thanks!
Stats from current PRDefault Server ModeGeneral
Client Bundles (main, webpack, commons)
Client Bundles (main, webpack, commons) Modern
Client Pages
Client Pages Modern
Client Build Manifests
Rendered Page Sizes
Serverless ModeGeneral
Client Bundles (main, webpack, commons)
Client Bundles (main, webpack, commons) Modern
Client Pages
Client Pages Modern
Client Build Manifests
Serverless bundles
Commit: 07d3d38 |
Stats from current PRDefault Server ModeGeneral
Client Bundles (main, webpack, commons)
Client Bundles (main, webpack, commons) Modern
Client Pages
Client Pages Modern
Client Build Manifests
Rendered Page Sizes
Serverless ModeGeneral
Client Bundles (main, webpack, commons)
Client Bundles (main, webpack, commons) Modern
Client Pages
Client Pages Modern
Client Build Manifests
Serverless bundles
Commit: 9c6edfe |
The call to
accept.languages()
made the fallback not work.When called e.g. with
Accept-Language: es-ES,es;q=0.9
,locale
would contain[ 'es-ES', 'es' ]
instead ofen
.(See also: https://www.npmjs.com/package/accepts#languagelanguages )