I have seen other issues related to i18 and SSR (cache support, user locale...) but would like to have a global status.
I am trying to use react-intl which is an interesting option in this area but I see a number of issues:
how to get the user's locale from the server side. Is a generalization of this hack the right approach?
how to solve polyfill issues (react-intl has apparently certain requirements in this area)? The error I get is included below.
Are there other points that should be considered (distinct urls for different locales?)?
Do you know of any other i18n approach working well with react and FR-SSR?
Thank you in advance for any pointer or help.
Error when doing SSR. path:/: [React Intl] The `Intl` APIs must be available in the runtime, and do not appear to be built-in. An `Intl` polyfill should be loaded.
W20160420-11:28:10.426(2)? (STDERR) See: http://formatjs.io/guides/runtime-environments/
W20160420-11:28:10.429(2)? (STDERR) Invariant Violation: [React Intl] The `Intl` APIs must be available in the runtime, and do not appear to be built-in. An `Intl` polyfill should be loaded.
W20160420-11:28:10.429(2)? (STDERR) See: http://formatjs.io/guides/runtime-environments/
W20160420-11:28:10.429(2)? (STDERR) at invariant (node_modules/invariant/invariant.js:42:15)
W20160420-11:28:10.429(2)? (STDERR) at new IntlProvider (node_modules/react-intl/lib/index.js:666:9)
W20160420-11:28:10.429(2)? (STDERR) at [object Object].ReactCompositeComponentMixin.mountComponent (node_modules/react/lib/ReactCompositeComponent.js:159:18)
W20160420-11:28:10.429(2)? (STDERR) at [object Object].wrapper [as mountComponent] (node_modules/react/lib/ReactPerf.js:66:21)
W20160420-11:28:10.429(2)? (STDERR) at Object.ReactReconciler.mountComponent (node_modules/react/lib/ReactReconciler.js:39:35)
W20160420-11:28:10.429(2)? (STDERR) at [object Object].ReactCompositeComponentMixin.performInitialMount (node_modules/react/lib/ReactCompositeComponent.js:290:34)
W20160420-11:28:10.429(2)? (STDERR) at [object Object].ReactCompositeComponentMixin.mountComponent (node_modules/react/lib/ReactCompositeComponent.js:237:21)
W20160420-11:28:10.429(2)? (STDERR) at [object Object].wrapper [as mountComponent] (node_modules/react/lib/ReactPerf.js:66:21)
W20160420-11:28:10.429(2)? (STDERR) at Object.ReactReconciler.mountComponent (node_modules/react/lib/ReactReconciler.js:39:35)
W20160420-11:28:10.430(2)? (STDERR) at [object Object].ReactCompositeComponentMixin.performInitialMount (node_modules/react/lib/ReactCompositeComponent.js:290:34)
I have seen other issues related to i18 and SSR (cache support, user locale...) but would like to have a global status. I am trying to use react-intl which is an interesting option in this area but I see a number of issues:
Are there other points that should be considered (distinct urls for different locales?)?
Do you know of any other i18n approach working well with react and FR-SSR?
Thank you in advance for any pointer or help.