This is a standalone project for using react-intl-po with CRA. Futher Reading: 中文
$ npm i create-react-app -g
$ create-react-app react-intl-po-example
$ cd react-intl-po-example
$ yarn start
$ yarn add react-intl react-intl-cra
+ "extract:messages": "react-intl-cra 'src/**/*.js' -o 'output/messages.json'",
- Input: Your React-intl Components
- Output: output/messages.json
$ yarn add react-intl-po
+ "extract:pot": "react-intl-po json2pot 'output/messages.json' -o 'output/messages.pot'"
- Input: Output step1 output/messages.json
- Output: output/messages.pot
How to translate the same message into two different meanings? (By @Sand1929 in #83)
- "extract:pot": "react-intl-po json2pot 'output/messages.json' -o 'output/messages.pot'"
+ "extract:pot": "react-intl-po json2pot 'output/messages.json' -c 'id' -o 'output/messages.pot'"
- Input: Output of step1 output/messages.json
- Output: output/messages-c.pot
+ "extract:po": "react-intl-po po2json 'input/*.po' -c 'id' -m 'output/messages.json' -o 'output/translation.json'"
- Input: From translator (Poedit editor) input/zh-TW.po
- Output: output/translation.json