XLIFF Import / Export for Web

Using the XLIFF file format to import/export content

Within the Localize dashboard we provide you with an ability to import and export phrases and website translations in various file formats.

You can also import/export Glossary terms.

Importing / Exporting

To see a general explanation of how importing and exporting works in Localize, click here. Be sure to adhere to the file requirements below so that Localize will be able to successfully read your files.

File Requirements

🚧

UTF-8 Character Encoding

Be sure that you are using the UTF-8 character encoding when working with the external files you are creating for importing purposes, so that special characters like accents are encoded properly.

XLIFF is a format that's used to exchange data between participants in a translation project. This special format enables translators to concentrate on the text to be translated, without worrying about text layout.
Use the following sample for guidance when creating your XLIFF file for importing into Localize.

The following data is required:

  • <?xml version = "1.0" encoding="UTF-8"?> element: standard XML v 1.0 element, specifying the encoding
  • <xliff version="1.2"> element: parent element of all other elements that follow
  • <file> element: Currently, Localize only supports 1 element
    • original attribute: ???
    • source-language attribute: the source language code
    • target-language attribute: the target language code
  • <trans-unit>: For each phrase:
    • <source> element: this is the source language phrase
      • xml:lang attribute: the value is the source language code

The following data is optional for each phrase (trans-unit):

  • id - an attribute of the trans-unit element - this internal ID will be seen in any files exported from Localize
  • <note> element - a string which provides context for your translators
    • xml:lang attribute: the value is the source language code
  • <labels> element: A comma-separated of strings which are labels to apply to the phrase
    • Note that any pre-existing labels on the phrase will be replaced by the ones in the import file.
    • Any labels added to the phrase in the file being imported will be added to the Localize dashboard.
  • <target> element
    • If present, this is the translation of the source text
    • The target language code must be specified in the xml:lang attribute
<?xml version = "1.0" encoding="UTF-8"?>
<xliff version="1.2">
    <file original="main" source-language="en" target-language="es">
        <head></head>
        <body>
            <trans-unit id="5e3325d441c51b0f14d4bcbb">
                <note xml:lang="en">this is some context</note>
                <source xml:lang="en">Here’s another new sentence.</source>
            </trans-unit>
            <trans-unit id="5e05ff60b5f2a4f81803b695">
                <note xml:lang="en">Translator: import</note>
                <source xml:lang="en">We can’t possibly run irrigation to this tree, so it will have to survive on its own.</source>
                <target xml:lang="es">No es posible que podamos regar este árbol, por lo que tendrá que sobrevivir por sí solo.</target>
            </trans-unit>
            <trans-unit id="5d3f4a7b85fe7e1d173f1d6f">
                <labels xml:lang="en">lzm-meta-og:title, lz-page-title</labels>
                <source xml:lang="en">What we do | Localize — LZ Product Demo</source>
                <target xml:lang="es">Lo que hacemos | Localize - LZ Product Demo</target>
            </trans-unit>
        </body>
    </file>
</xliff>

Troubleshooting

If your import fails you will see a message on screen after the failure occurs. Or you can view the error here under Import History.


Did this page help you?