WeblateOrg / weblate

Web based localization tool with tight version control integration.
https://weblate.org/
GNU General Public License v3.0
4.48k stars 994 forks source link

language ignored when importing TBX #850

Open danielnaber opened 8 years ago

danielnaber commented 8 years ago

I'm not very familiar with TBX, but according to a DTD validation, this should be valid TBX (TBX-Basic, actually):

    <body>
        <termEntry id="c5">
            <langSet xml:lang="en"><tig><term>English term</term></tig></langSet>
            <langSet xml:lang="de"><tig><term>German term</term></tig></langSet>
            <langSet xml:lang="es"><tig><term>S</term></tig></langSet>
        </termEntry>
    </body>

I can import this to the German translation and it works as expected, but when I import it to the Spanish translation, the German term gets imported as translation. It seems as if the xml:lang is ignored.

nijel commented 8 years ago

Indeed, translate-toolkit doesn't seem to look at the xml:lang attribute at all - it always picks the fist two langSet entries, taking first one as source and second one as target.

nijel commented 8 years ago

However Weblate could add support on top of that by using unit.getlanguageNode('de') internal API.