Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ng-xi18n: Merge/Update Existing Translations File (XLIFF) #6552

Closed
NapalmCodes opened this issue Jun 2, 2017 · 16 comments
Closed

ng-xi18n: Merge/Update Existing Translations File (XLIFF) #6552

NapalmCodes opened this issue Jun 2, 2017 · 16 comments
Labels
feature Issue that requests a new feature P5 The team acknowledges the request but does not plan to address it, it remains open for discussion

Comments

@NapalmCodes
Copy link

Bug Report or Feature Request (mark with an x)

- [ ] bug report -> please search issues before submitting
- [X ] feature request

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

@glebmachine
Copy link

Same question here)
Trying to find any tool to merge updates into old translated xlf data file.

@glebmachine
Copy link

@napalm684 check this thread:
https://github.com/martinroob/ngx-i18nsupport/wiki/Tutorial-for-using-xliffmerge-with-angular-cli

@NapalmCodes
Copy link
Author

@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.

@glebmachine
Copy link

glebmachine commented Jun 2, 2017 via email

@filipesilva filipesilva added feature Issue that requests a new feature P5 The team acknowledges the request but does not plan to address it, it remains open for discussion type: discussion labels Jun 6, 2017
@ocombe
Copy link
Contributor

ocombe commented Jul 18, 2017

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 angular/angular#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 ocombe closed this as completed Jul 18, 2017
@NapalmCodes
Copy link
Author

NapalmCodes commented Jul 18, 2017

@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.

@ocombe
Copy link
Contributor

ocombe commented Jul 18, 2017

I believe that editors such as OneSky and Crowdin have those kind of features.
What do you use to translate your xliff files?

@NapalmCodes
Copy link
Author

Vscode lol

@0x-2a
Copy link

0x-2a commented Aug 18, 2017

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

@martinroob
Copy link

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)

@DavidOndrus
Copy link

I made my own tool especially because of this missing feature:
Repo: https://github.com/DavidOndrus/xliff-translator-tool

@glebmachine
Copy link

@Brocco, do you have plan to work on merging issue?

@cafesanu
Copy link

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 #6552 (comment) @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

@svassr
Copy link

svassr commented Apr 25, 2019

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.

@svassr
Copy link

svassr commented Apr 25, 2019

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").

@angular-automatic-lock-bot
Copy link

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.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Sep 9, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
feature Issue that requests a new feature P5 The team acknowledges the request but does not plan to address it, it remains open for discussion
Projects
None yet
Development

No branches or pull requests

10 participants