Utility for parsing translations for react-native and react-redux-i18n.
Utility parses snippets like:
<Translation value="HERE.YOUR.TRANSLATION.TOKEN"/>
OR
I18n.t('HERE.YOUR.TRANSLATION.TOKEN')
yarn add redux-i18n-parser
node ./node_modules/.bin/i18n-parser --config={PATH_TO_CONFIG}
Simple config for redux-i18n-parser, i18n.json
{
"languages": [
"ru",
"en"
],
"sourceDir": "../src",
"outputDir": "../src/i18n"
}
languages
- List of supported languages, utility will be parse & merge with existing translations
sourceDir
- Relative path to your source code
outputDir
- Relative path to your translations
In package.json
// ...
"scripts": {
// ...
"i18n": "i18n-parser --config=./config/i18n.json"
// ...
},
// ...