Closed gergely-gyorgy-both closed 1 year ago
Hi @gergely-gyorgy-both
Do you use this via the command line or as an library?
I think the options are available for programmatic/library use (see https://github.com/daniel-sc/xliff-simple-merge/blob/main/src/merge.ts#L4 ) - sourceLanguage: 'en'
and newTranslationTargetsBlank: true
should be correct. If this combination gives the desired result it is only a matter of integrating these options to the command line interface (PR welcome!). If this does not work, I'll have a closer look.
Thanks for responding in such a short time!
Actually, I started to use ng-extract-i18n-merge, where I have the following config:
"extract-i18n": {
"builder": "ng-extract-i18n-merge:ng-extract-i18n-merge",
"options": {
"browserTarget": "reponame:build",
"format": "xlf",
"outputPath": "locale",
"targetFiles": [
"messages.de-DE.xlf",
"messages.en-US.xlf"
],
"sourceFile": "/messages.xlf",
"sourceLanguageTargetFile": "messages.en-US.xlf",
"fuzzyMatch": false,
"trim": true,
"newTranslationTargetsBlank": true
}
}
I just run ng extract-i18n
.
I would like to have blank target nodes in the messages.de-DE.xlf file with "new" state (this can be achieved with the newTranslationTargetsBlank set to true), but also would like to copy the source as target nodes in messages.en-US.xlf (and mark them as final).
I started some digging in that code, and noticed that this project is responsible for generating the target files. I actually even made a fix, I just don't really know that is it a valid use case what I'm doing.
If I misunderstood something, please feel free to ask.
ok - this is what I'd expect with the given configuration as well - are you using the latest version? What is the actual output?
but if you spotted the/a bug in the code already, please make a PR - there a discussion can be more specific :)
Hi!
I would like to generate blank target nodes for every locale, but not the one which is the source language. Currently, using the mentioned options together, in the sourceLanguage locale, I get
<target state="final"/>
, which is, I think, not the desired behavior. An expected result would be (giving that the source language is in English, other locale is German:English:
German:
If you agree, I could make a pull request with the fix.