oqdo-react-autotranslate
v1.0.0
Published
Translate react-intl internationalization (i18n) locale files to any given locale code
Downloads
22
Maintainers
Readme
oqdo-react-autotranslate
Automatically translate language file using google translator
How to install
npm install -g oqdo-react-autotranslate
Run
intl-translate /path/to/site/public/locales/en.json es keyfile.json targetfile.json
Usage
You could use this tool to automate the deployment process of your React app that has used react-intl
for i18n.
Command line arguments
intl-translate SOURCEFILE TARGET_LOC_CODE KEY_FILE TARGET_FILE DONTOVERRIDE
SOURCEFILE
Source file name e.g./path/to/source/locale/en.json
- TARGET_LOC_CODE Locale code that you want to convert the source file e.g.
de
KEY_FILE
Google cloud api key file for Translator cloud service, This is a JSON file containing the private key, token urls etc...TARGET_FILE
path to target file name e.g./path/to/source/locale/de.json
DONTOVERRIDE
optional flag to define if existing translations in target file shall be overriden (default:false
)