Open carlos-ferras opened 6 years ago
Is the error saying that you have missing translations? If it's throwing in the xliff parser, it looks more like your xliff file has errors
What's the error message, and what's the content of your xliff file?
Yes, I know what it say, but I want to ignore it, not an error when it happen, anyway thanks for your work, I've been waiting a long time for this.
If it's not an error, then the warning is an error :D Do you know what's causing this?
Yes, it 's because I have not a target translation tag for the source text, normally angular ignore this an use as target the value in source.
I believe that this behavior was changed in Angular, I'll check
I already managed to avoid the error, just doing this:
package.json:
"scripts": {
"start": "ng serve --open --locale es",
"build": "for lang in en es; do ng build --aot --prod --bh /$lang/ --output-path=dist/$lang --i18n-file=src/locale/messages.$lang.xlf --i18n-format=xlf --missing-translation=ignore --locale=$lang; done",
"i18n": "npm run i18n-templates && npm run i18n-ts && npm run i18n-merge",
"i18n-templates": "ng xi18n -f xlf --output-path src/locale --outFile=messages.xlf --locale es",
"i18n-ts": "ngx-extractor -i \"src/**/*.ts\" -f xlf -o src/locale/messages.xlf",
"i18n-merge": "for lang in en es; do xliffmerge --profile xliffmerge.json es $lang; done"
}
xliffmerge.json:
{
"xliffmergeOptions": {
"srcDir": "src/locale",
"genDir": "src/locale",
"defaultLanguage": "es",
"i18nFile": "messages.xlf",
"useSourceAsTarget": true
}
}
what I did was generate the translation files with the translations initialized in the source. Clarify that if the translations are not generated with the target, the error persists, that should be checked anyway.
The thing is that I have configure this:
in my app.module.ts
and this:
in my main.ts
The error is triggered here: