It translates the Angular 2 i18n output with google translate
It uses a *.xlf
file as an input and translates the source
tags of the xml with google translate and appends them to the xml as target
.
It can extend existing translations. A good feature if new/additional text appear in the app.
- Run
npm run build
- Edit the
config.js
to match your requirements - Run
npm run start
and your files will be created
config example:
{
//source data and it language
"source": {
"lang": "en",
"file": ".../messages.xlf"
},
//desitnation folder and the laguages to translate
"destination": {
"folder": ".../src/locale",
"languages": ["hu","de"],
"filename": "messages"
},
//if extend, it does not override the already trasnlated parts
"method": "extend",
//replaces all line breaks, whitespaces with a single space
"formatOutput": true
}
Can't handle variable in the source