XLIFF wrong formatting
Steps to reproduce
- XLIFF based component
- Change translation for non-source language
- Save and commit
Actual behaviour
After saving new translation, there is added a new trans-unit to that language XLIFF file. But instead of adding <trans-unit></trans-unit> node, the new node is in format:
<ns0:trans-unit xmlns:ns0="urn:oasis:names:tc:xliff:document:1.2" id="id_of_unit" approved="no">
<ns0:source>Source String</ns0:source>
<ns0:target state="needs-translation">Translation</ns0:target>
</ns0:trans-unit>
Also its being ignored, that trans-unit with that id already exists in XLIFF file with standard format.
Expected behaviour
If there is not an trans-unit node with that id, add a standard `
Server configuration
Weblate v2.6
Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.
Can you please include header of your xliff files as well? Also what version of transalate-toolkit do you have installed?
Header for all XLIFF files looks like this:
<?xml version='1.0' encoding='utf-8'?>
<xliff version="1.2" schemaLocation="urn:oasis:names:tc:xliff:document:1.2 http://docs.oasis-open.org/xliff/v1.2/os/xliff-core-1.2-strict.xsd">
I'll add version of translate-toolkit later. Thanks.
Okay, I think the problem is that <xliff> tag lacks namespace. This makes it pretty much invalid file and translate-toolkit thus doesn't see the translaitons there as there are none there in the xliff namespace.
The header should IMHO look like:
<xliff version="1.2" xmlns="urn:oasis:names:tc:xliff:document:1.2">
Ok, thanks for your response.
I changed the header for the base (en.xliff) file and the new translations is being added with correct trans-unit tag.
But one issue still presists. After saving translation, it is added as a new trans-unit even if there already is a trans-unit with that given id.
Deleting all translation xliffs and creating new ones from base en.xliff did solve this.
Didn't the other files have same header as well?