Login Account

XLIFF 1.2 Example Translated with doloc

Doloc offers a streamlined approach to localizing your application’s content. By utilizing its API, you can efficiently translate your XLIFF 1.2 files into multiple languages. Here’s an example to illustrate the process:

Original XLIFF 1.2 File BEFORE localization

messages_de.xlf

<?xml version="1.0" encoding="UTF-8"?>
<xliff version="1.2">
  <file source-language="en" target-language="de" datatype="plaintext" original="messages">
    <body>
      <trans-unit id="greeting">
        <source>Ahoy there!</source>
        <target state="final">Ahoi!</target>
      </trans-unit>
      <trans-unit id="description">
        <source>Innovation at your fingertips, shaping tomorrow today.</source>
        <target state="final">Innovation zum Greifen nah bei dir, heute schon das morgen gestalten</target>
      </trans-unit>
	    <trans-unit id="footer">
        <source>Don’t miss out, be a part of the future.</source>
        <target state="new"></target>
      </trans-unit>
      <trans-unit id="contact">
        <source>Let’s get the ball rolling, we’re just a message away!</source>
        <target state="new"></target>
      </trans-unit>
      <trans-unit id="terms">
        <source>If you proceed, you accept the mysteries that lie ahead.</source>
        <target state="new"></target>
      </trans-unit>
    </body>
  </file>
</xliff>

Running the doloc curl command

To translate this file into German using doloc’s API, execute the following curl command (be sure to get your $API_TOKEN in your doloc account):

curl https://api.doloc.io -H "Authorization: Bearer $API_TOKEN" --data-binary "@messages_de.xlf" -o messages_de.xlf

Note: For further customization, refer to the options you can pass as query parameters in the URL! This allows you to tailor the experience to your needs.

XLIFF 1.2 file file AFTER localization

After running the command, the translated XLIFF file will appear as follows:

messages_de.xlf

<?xml version="1.0" encoding="UTF-8"?>
<xliff version="1.2">
  <file source-language="en" target-language="de" datatype="plaintext" original="messages">
    <body>
      <trans-unit id="greeting">
        <source>Ahoy there!!</source>
        <target state="final">Ahoi!!</target>
      </trans-unit>
      <trans-unit id="description">
        <source>Innovation at your fingertips, shaping tomorrow today.</source>
        <target state="final">Innovation zum Greifen nah bei dir, heute schon das morgen gestalten</target>
      </trans-unit>
	    <trans-unit id="footer">
        <source>Don’t miss out, be a part of the future.</source>
        <target state="translated">Verpasse es nicht, sei ein Teil der Zukunft.</target>
      </trans-unit>
      <trans-unit id="contact">
        <source>Let’s get the ball rolling, we’re just a message away!</source>
        <target state="translated">Lass uns ins Rollen kommen, wir sind nur eine Nachricht entfernt!</target>
      </trans-unit>
      <trans-unit id="terms">
        <source>If you proceed, you accept the mysteries that lie ahead.</source>
        <target state="translated">Wenn du fortfährst, akzeptierst du die Geheimnisse, die vor dir liegen.</target>
      </trans-unit>
    </body>
  </file>
</xliff>
All new texts are also translated according to existing translations. E.g. informal "you" of id="description" translation is respected.

This process demonstrates how doloc can seamlessly integrate into your development workflow, providing instant translations and accelerating your application’s localization.

Translation Status

The state attribute is updated to reflect the translation status. If you want to QA the translations, you can use the state attribute to find automated translations (state="translated") and finalize them (state="final"). Of course, one can configure the state attribute with Xliff 1.2 options.

Getting started with XLIFF 1.2 localization

Ready to get started with doloc? It is only three steps:

  1. Register now!
  2. Create your personal $API_TOKEN
  3. Add the curl command (see above) to your dev workflow.

Make sure to check out our dedicated Angular Framework Guide and complete XLIFF 1.2 Format Documentation.