kadirahq / flow-router

Carefully Designed Client Side Router for Meteor
MIT License
1.09k stars 195 forks source link

i18n support and SSR #598

Open Sabst opened 8 years ago

Sabst commented 8 years ago

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.

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)