Help Center Import/Export
Exported XLIFF - Understanding the File Structure

Exported XLIFF - Understanding the File Structure

Last updated: 19 days ago
3 minute read
Yuliia Kovalchuk
Developer at SiteTran

ALL ARTICLES

Help Center

Exported XLIFF - Understanding the File Structure

When you export data using the XLIFF format, the generated file will contain phrases, translations, and optional metadata that can provide additional context for accurate localization. Here’s what our exported XLIFF file contains:

  • Source Language Text: The original phrase in the source language.
  • Target Language Translations: The translated phrases in the selected target languages.
  • Optional Metadata:
    • Phrase Key: (String, Optional) A unique key associated with the phrase.
    • HTML Tag Name: The name of the HTML tag (e.g., div, span) where the phrase is used. This helps provide context for where the phrase appears on your site.
    • HTML Attribute Name: If the phrase is within a specific HTML attribute (e.g., title, placeholder), this attribute will be included.

Key Points for XLIFF Export:

  • XLIFF Version: We export version 1.2 which is the most widely supported version by translation and localization tools.
  • File Structure: Each phrase and its translation will be encapsulated within translation units, along with any associated metadata (phrase key, tag name, attribute name).
  • Multiple Languages: If you are exporting translations for multiple languages, each language pair (source-target) will be included as a separate file element in the XLIFF export.

Example Exported XLIFF File

Below is an example of an XLIFF file exported with two languages: English to Spanish (en → es) and English to French (en → fr).


<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<xliff version="1.2">
  <file source-language="en" target-language="es" datatype="plaintext" original="messages">
    <body>
      <trans-unit id="1">
        <source>Example phrase</source>
        <target>Frase de ejemplo</target>
        <note>Tag: div, Attribute: title</note>
      </trans-unit>
      <trans-unit id="2">
        <source>Second Example Phrase</source>
        <target>Segunda frase de ejemplo</target>
        <note>Tag: div, Attribute: null</note>
      </trans-unit>
    </body>
  </file>
  <file source-language="en" target-language="fr" datatype="plaintext" original="messages">
    <body>
      <trans-unit id="1">
        <source>Example phrase</source>
        <target>Phrase d'exemple</target>
        <note>Tag: div, Attribute: title</note>
      </trans-unit>
      <trans-unit id="2">
        <source>Second Example Phrase</source>
        <target>Deuxième phrase d'exemple</target>
        <note>Tag: div, Attribute: null</note>
      </trans-unit>
    </body>
  </file>
</xliff>
Couldn't find what you were looking for?

In this article

Website Translation Made Easy