forsatus / Xliff-AI-Translator

AI-driven solution for efficient XLIFF/XLF file translation, bridging the gap between languages for localized content.
GNU General Public License v3.0
2 stars 2 forks source link

XLIFF 2.0 support #1

Open godfryd opened 11 months ago

godfryd commented 11 months ago

It seems that the code supports XLIFF 1.2 only. Is it possible to add support for XLIFF 2.0?

forsatus commented 11 months ago

It seems that the code supports XLIFF 1.2 only.

Is it possible to add support for XLIFF 2.0?

Of course, I’ll add it soon. Just give me some time to understand the XLIFF 2.0 syntax 🙂

forsatus commented 11 months ago

It seems that the code supports XLIFF 1.2 only. Is it possible to add support for XLIFF 2.0?

Could you send me an XLIFF 2.0 example file?

godfryd commented 11 months ago

one small example:

<?xml version="1.0"?><xliff version="2.0" xmlns="urn:oasis:names:tc:xliff:document:2.0" srcLang="pl" trgLang="en">
  <file id="ngi18n" original="ng.template">
    <unit id="3647207640640701057">
      <segment state="translated">
        <source>Wyloguj</source>
        <target>Logout</target>
      </segment>
    </unit>
    <unit id="509865884254450024">
      <segment state="translated">
        <source>Zaloguj / Zapisz się</source>
        <target>Log in / Register</target>
      </segment>
    </unit>
    <unit id="WELCOME">
      <segment state="translated">
        <source>Witaj w <pc id="0" equivStart="START_BOLD_TEXT" equivEnd="CLOSE_BOLD_TEXT" type="fmt" dispStart="&lt;b>" dispEnd="&lt;/b>">Parkour</pc></source>
        <target>Welcome to <pc id="0" equivStart="START_BOLD_TEXT" equivEnd="CLOSE_BOLD_TEXT" type="fmt" dispStart="&lt;b>" dispEnd="&lt;/b>">Parkour</pc></target>
      </segment>
    </unit>
    <unit id="2622782859314043460">
      <segment state="translated">
        <source>Zaloguj się</source>
        <target>Sign in</target>
      </segment>
    </unit>
    <unit id="3211344377721758174">
      <segment state="translated">
        <source>Użyj konta Google</source>
        <target>Use your Google account</target>
      </segment>
    </unit>
  </file>
</xliff>
forsatus commented 11 months ago

one small example:

<?xml version="1.0"?><xliff version="2.0" xmlns="urn:oasis:names:tc:xliff:document:2.0" srcLang="pl" trgLang="en">
  <file id="ngi18n" original="ng.template">
    <unit id="3647207640640701057">
      <segment state="translated">
        <source>Wyloguj</source>
        <target>Logout</target>
      </segment>
    </unit>
    <unit id="509865884254450024">
      <segment state="translated">
        <source>Zaloguj / Zapisz się</source>
        <target>Log in / Register</target>
      </segment>
    </unit>
    <unit id="WELCOME">
      <segment state="translated">
        <source>Witaj w <pc id="0" equivStart="START_BOLD_TEXT" equivEnd="CLOSE_BOLD_TEXT" type="fmt" dispStart="&lt;b>" dispEnd="&lt;/b>">Parkour</pc></source>
        <target>Welcome to <pc id="0" equivStart="START_BOLD_TEXT" equivEnd="CLOSE_BOLD_TEXT" type="fmt" dispStart="&lt;b>" dispEnd="&lt;/b>">Parkour</pc></target>
      </segment>
    </unit>
    <unit id="2622782859314043460">
      <segment state="translated">
        <source>Zaloguj się</source>
        <target>Sign in</target>
      </segment>
    </unit>
    <unit id="3211344377721758174">
      <segment state="translated">
        <source>Użyj konta Google</source>
        <target>Use your Google account</target>
      </segment>
    </unit>
  </file>
</xliff>

Do you have the original file not translated ?

godfryd commented 11 months ago
<?xml version="1.0" encoding="UTF-8" ?>
<xliff version="2.0" xmlns="urn:oasis:names:tc:xliff:document:2.0" srcLang="pl">
  <file id="ngi18n" original="ng.template">
    <unit id="3647207640640701057">
      <segment>
        <source>Wyloguj</source>
      </segment>
    </unit>
    <unit id="509865884254450024">
      <segment>
        <source>Zaloguj / Zapisz się</source>
      </segment>
    </unit>
    <unit id="WELCOME">
      <segment>
        <source>Witaj w <pc id="0" equivStart="START_BOLD_TEXT" equivEnd="CLOSE_BOLD_TEXT" type="fmt" dispStart="&lt;b&gt;" dispEnd="&lt;/b&gt;">Parkour</pc></source>
      </segment>
    </unit>
    <unit id="2622782859314043460">
      <segment>
        <source>Zaloguj się</source>
      </segment>
    </unit>
    <unit id="3211344377721758174">
      <segment>
        <source>Użyj konta Google</source>
      </segment>
    </unit>
  </file>
</xliff>