Open hansmaad opened 5 years ago
@hansmaad Hi. You can copy EN file in messages.zh.xlf and set source-language="en" target-language="zh"
give translator and then set source-language="de" target-language="zh"
What is problem?
@Blucbo I have a messages.en.xlf translated from german
<file source-language="de" target-language="en">
<body>
<trans-unit datatype="html">
<source>Hallo Welt</source>
<target state="final">Hello World</target>
...
If I add chinese as language I'll get
<file source-language="de" target-language="zh">
<body>
<trans-unit datatype="html">
<source>Hallo Welt</source>
<target state="new">Hallo Welt</target>
...
But what I'd like to have is
<file source-language="en" target-language="zh">
<body>
<trans-unit datatype="html">
<source>Hello World</source>
<target state="new">Hello World</target>
...
I don't see a way to simply copy some file. I think I had to take the en file and copy each target
to the source
. My question es if any tooling is available for this task.
@hansmaad You should create extra command that run after xliffmerge.
If you using @@id for bind translated word it is simple.
Parse xlif file and find all
<trans-unit id="anotherPC" datatype="html">
<source>Hallo Welt</source>
<target state="final">Hello World</target>
</trans-unit>
Think of the following situation: Development team has written the templates in german language. They translate into English (messages.en.xlf) theirself. For chinese language they want to give messages.zh.xlf to a translator, who translates from EN to ZH. Is it possible to generate a messages.zh.xlf from the translated messages.en.xlf, so that it has english as source language? If it's not possible with the current tooling, would it be "easy" to implement? Any hints of how this could be done? Can we contribute something? Is there any public API in the lib we could use?