To generate new translations:
- remove .messages folder
- Extract all messages into .messages dir with:
yarn i18n:extract
- Add new messages into {lang}.json files with:
yarn i18n:manageTranslations
- Translate any new entries in {lang}.json files and commit to repo
(see
Untranslated keys:
output of previous command for list of keys needing translation)
yarn add react-intl
yarn add react-intl.macro
yarn add --dev react-intl-translations-manager
This gist shows how to use react-intl with defaultMessage of English so a separate default en.json file is not needed, while not ejecting from Create React App.
ignore the extracted i18n messages by adding /.messages
to .gitignore
- See: https://github.com/yahoo/react-intl
- Lang Key extraction handled by: https://github.com/evenchange4/react-intl.macro
- Translations file managed by: https://github.com/GertjanReynaert/react-intl-translations-manager
(gist filenames cannot have /
in filename, so these files use -
in place of directories)
yarn install ...
should beyarn add ...