Closed NapalmCodes closed 7 years ago
Same question here) Trying to find any tool to merge updates into old translated xlf data file.
@napalm684 check this thread: https://github.com/martinroob/ngx-i18nsupport/wiki/Tutorial-for-using-xliffmerge-with-angular-cli
@glebmachine Yep this is the exact item I found which don't get me wrong is an option but I kind of feel like this should be built into the Angular i18n tooling. I feel it doesn't make a ton of sense to offer tools to generate translation files under the guise they will never need maintained. Sure manual merging will work but I think we can do better overall. A plugin is certainly an option but shouldn't be necessary for such a basic requirement. Just my two cents.
Agree)
We only generate the source file, not the translations. You should not have translations in your source file, you should load it into your translation editor and it will merge the existing translations using the ids.
If you want to do it by hand, then @martinroob tools works well for that.
I agree that it might be confusing to see <target/>
in the extracted source file for xliff, but those will not be generated anymore once we've merged https://github.com/angular/angular/pull/18072 so this should be more clear that you should not use the source file as the file containing your translations.
If you still think that this should be a feature of ng-xi18n, then please open a feature request on the angular/angular repository, not angular-cli.
@ocombe What tool is it you speak of that merges an essentially empty xlf file into a "translated" xlf file you are maintaining for the build/bundling process. We had to use the xliff merge npm package to do this which seems very cumbersome at best. If there is a dedicated editor to look at that certainly could be an option although I will be honest I would much rather see the cli provide facilities to do this merge to the "translated" xlf file. In it's current state without the xliff merge tool it requires some less than friendly merge activities.
I believe that editors such as OneSky and Crowdin have those kind of features. What do you use to translate your xliff files?
Vscode lol
I found one attempt at automating updates to extracted i18n xlfs using gulp/cheerio: https://github.com/alber999/angular2-webpack-starter/blob/master/gulpfile.js#L59
xliffmerge was originally inspired by a set of cheerio and grunt tooling. But I do not think it is a good idea to integrate tooling like gulp or grunt in a modern cli based angular project. Give xliffmerge a Chance. It is easy to integrate and does what you need. The latest version has a google translate integration and can pretranslate everything for you. (ok, I am Not neutral because I am the author of xliffmerge)
I made my own tool especially because of this missing feature: Repo: https://github.com/DavidOndrus/xliff-translator-tool
@Brocco, do you have plan to work on merging issue?
While I love @martinroob 's solution. I agree that this should be native. Once I have translated an xls into, let's say Greek, by next week (as we continuously work on our product), the english xfl will have new words. It would be nice to have those new untransalted words into the Greek xfl file.
Regarding your comment here https://github.com/angular/angular-cli/issues/6552#issuecomment-316038368 @ocombe, I would like to create an issue, you mention to create a feature request on the angular/angular repository, not angular-cli. Just curious of why if xi18n
is part of the cli? Just want to make sure it gets to the right channel
poedit does support .xliff files for translation. It also offers to update an existing translation from a new source, but only for .po format though. It would suit the need perfectly if only ng xi18n
could extract strings as a .po file.
After trying @DavidOndrus tool, I ended using https://github.com/martinroob/ngx-i18nsupport to extract/update xliff files. It doesn't mess with note
and context
tags as with utf-8 encoding.
Translators still use poedit for translation as it supports states (i.e state="needs-adaptation"
).
This issue has been automatically locked due to inactivity. Please file a new issue if you are encountering a similar or related problem.
Read more about our automatic conversation locking policy.
This action has been performed automatically by a bot.
Bug Report or Feature Request (mark with an
x
)Versions.
@angular/cli: 1.0.3 node: 7.7.3 os: win32 x64 @angular/common: 4.1.3 @angular/compiler: 4.1.3 @angular/core: 4.1.3 @angular/http: 4.1.3 @angular/platform-browser: 4.1.3 @angular/platform-browser-dynamic: 4.1.3 @angular/platform-server: 4.1.3 @angular/router: 4.1.3 @angular/compiler-cli: 4.1.3 @ngtools/webpack: 1.3.3
Repro steps.
Update an html view with a new translate-able field and re-generate xlf file. None of the translations are included if they were already done and marked target state as "translated". No way to merge with an existing locale file either.
The log given by the failure.
No Failure
Desired functionality.
The ability to re-generate a translation file by adding the new items and preserving the items that are already translated.
Mention any other details that might be useful.
N/A