Skip to content

Instantly share code, notes, and snippets.

@fjahr
Last active March 22, 2016 16:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save fjahr/4d1e81364fcfdc7cec8e to your computer and use it in GitHub Desktop.
Save fjahr/4d1e81364fcfdc7cec8e to your computer and use it in GitHub Desktop.

How to use React-intl with PhraseApp

1. Keep your messages in a separate JSON file.

You can use nesting for React-intl v1 or omit it to comply with v2.

en-US.json

{
  'hello_world': 'Hello World'
}

2. Require the json file in your JavaScript locale file.

en-US.js

module.exports = {
    "locales": ["en-US"],
    "messages": require('./en-US.json'),
    "formats": {}
};

3. Upload and manage your json file in PhraseApp

If you use nesting you JSON file please use the format Nested JSON. If don't use nesting you can use Simple JSON.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment