Skip to content

Latest commit

 

History

History
10 lines (6 loc) · 659 Bytes

i18n.md

File metadata and controls

10 lines (6 loc) · 659 Bytes

Internationalization (i18n)

React-Setup uses React-Intl for internationalization.

Each component has a messages.js file which contains i18n strings to use in the component.

Running $ npm run build-msg will invoke babel-plugin-react-intl to go through all messages.js files and generate messages.json files under /dist.

/server/libs/i18n.js has a helper function called getLocaleMessages which returns an object with all translated strings from messages.json files. This object then gets injected to the index page (see: index-page.js) as a global variable so components can use them at runtime.