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

xliffmerge overwrites source if different #178

Open
bubblegumsoldier opened this issue Dec 16, 2020 · 0 comments
Open

xliffmerge overwrites source if different #178

bubblegumsoldier opened this issue Dec 16, 2020 · 0 comments

Comments

@bubblegumsoldier
Copy link

Hello,

it seems like the xliffmerge tool doesn't solely rely on the id but overwrites the source and target if the source in the target-file is differing from the one that is supposed to be merged. Sounds oddly specific and confusing? Yes, but here is an example:

Let's say we have a target file called messages.en.xlf with a tag like this:

<trans-unit id="lang-en" datatype="html">
        <source>EN - English</source>
        <target>EN - English</target>
        <note priority="1" from="description">Translated Name for English language</note>
</trans-unit>

and I have an origin file that I extracted from my code called messages.xlf with the following tag:

<trans-unit id="lang-en">
  <source>English</source>
  <note priority="1" from="description">Translated Name for English language</note>
</trans-unit>

When I use xliff merge with default language en to merge the second into the first it will merge it but the output (new messages.en.xlf-file) looks like this:

<trans-unit id="lang-en" datatype="html">
        <source>English</source>
        <target>English</target>
        <note priority="1" from="description">Translated Name for English language</note>
</trans-unit>

So why is it overwriting the source and the target? For other languages other than "en" (e.g. "ru") this does not happen and the source and target of the messages.ru.xlf-file is used.

This is my xliffmergeOptions.json-file that I am using:

{
  "xliffmergeOptions": {
    "srcDir": "./apps/web-client-dt2020/src/locale",
    "genDir": "./apps/web-client-dt2020/src/locale",
    "i18nFile": "messages.xlf",
    "i18nBaseFile": "messages",
    "i18nFormat": "xlf",
    "encoding": "UTF-8",
    "defaultLanguage": "..",
    "languages": [
      "en",
      "de",
      "ru",
      "fr",
      "es",
      "zh"
    ],
    "removeUnusedIds": true,
    "supportNgxTranslate": false,
    "useSourceAsTarget": true,
    "targetPraefix": "",
    "targetSuffix": "",
    "beautifyOutput": true,
    "allowIdChange": false,
    "autotranslate": false,
    "verbose": false,
    "quiet": false
  }
}

I use the following command to execute it:

xliffmerge --profile xliffmergeOptions.json

Is this behaviour supposed to happen? Why isn't the already translated file seen as truth and only the id used as a reference point?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant