What is XLIFF?

XLIFF is a dedicated XML-based format standardising data with language-related content. The standard improves the exchange interoperability of such data between systems.

XLIFF format lets translators concentrate on translating the text without worrying about text layout or breaking other content elements irrelated to translation. It is one of the most common formats used in the localization process by CAT tools and is widely adopted by many language service providers.

XLIFF is often used in software localization, but many popular Content Management Systems (CMS) allow exporting and importing XLIFF files for its substantial benefits for translation.

XLIFF is one of the OASIS standards with published specifications for versions 1.2 and 2.0. The specifications have many common elements but are not compatible. Version 1.2 is still the most popular, so we will focus on this version here.

XLIFF 1.2

XLIFF files usually have the .xliff or .xlf extension. Both extensions are valid, and there is no difference between such files regarding functionality and content.

Structure of an XLIFF 1.2 file

<xliff version=’1.2‘ xmlns=’urn:oasis:names:tc:xliff:document:1.2‘>

<file original=’hello.txt‘ source-language=’en‘ target-language=’fr‘ datatype=’plaintext‘>

<body>
<trans-unit id=’hi‘>

<source>Hello world</source>

<target>Bonjour le monde</target>

<alt-trans> <target xml:lang=’es‘>Hola mundo</target> </alt-trans>

</trans-unit>

</body>

</file>

</xliff>

As an XML application, XLIFF begins with an XML declaration. After the declaration comes the XLIFF document itself, enclosed within the <xliff> element.

An XLIFF document is composed of one or more sections, each enclosed within a <file> element. The <file> element consists of a <header> element, which contains metadata about the <file> , and a <body> element, which contains the extracted translatable data from the <file>. The translatable data within <trans-unit> elements is organized into <source> and <target> paired elements. These <trans-unit> elements can be grouped recursively in <group> elements.

In addition, XLIFF provides the ability to maintain information about the processing of the file via the <phase> element. Possible translations for a specific <source> element can be generated from any number of MT (Machine Translation) and CAT (Computer Assisted Translation) systems and stored next to the <source> in <alt-trans> elements. Context for a <source> that could be used by a translator or a TM (Translation Memory) system is provided by the <context> element. Binary data can be made available via the <bin-unit>, which may also be translated and contain an associated <trans-unit>.

It is strongly recommended that content within the <file> element be uniformly bilingual. In other words, each <source> and <target> element that is a child of <trans-unit> is of the same language as the source-language and target-language attributes of the <file> element, respectively.

How to open and edit the XLIFF file?

Because the XLIFF file is an XML file, you can open it in any text editor. However, we recommend using a dedicated XML editor to avoid potential syntax and structural errors.

A typical process of translating a XLIFF file with TextUnited

It is straightforward to translate XLIFF files in TextUnited, as the process is the same as for other file formats.

But keep a few points in mind:

  • XLIFF files can be monolingual or bilingual or contain even more language pairs. Before starting a TextUnited project, double-check in the header of the XLIFF file what language is set up as a source language.
  • You must set up the TextUnited project with the same source language.
  • You have more flexibility with setting up the target language in the project:
    If your XLIFF file contains some target elements in the project’s target language, the translations from the project will overwrite them.
    Otherwise, the translations from the project will be added to the file.
  • Last but not least: your file should comply with XLIFF 1.2 standard and have a valid XML structure. You can validate it here.

Some more advanced information related to processing XLIFF files in TextUnited you can find here.

 

We support a plethora of file types and we’re long-time runners in the field of file translation – if you have any additional questions about XLIFF or other file formats, don’t hesitate to reach out to us. We will be glad to help!