XLIFF (.xlf, .xliff)
Dmitry Olenovs avatar
Written by Dmitry Olenovs
Updated over a week ago

To learn more about XLIFF files in general and how to work with them in Lokalise, please check out our detailed blog post.

Currently we support XLIFF files (.xlf, .xliff) version 1.2 as per XLIFF specification. Some XLIFF usage examples are:

Get your free 14 days trial on Lokalise and start working with XLIFF files today!

Elements supported

The XLIFF specification is more or less "tl;dr" so we support the most popular stuff. Non-supported information or elements will not be saved. The context and notes will be saved as custom key attributes along with some other information for the Angular XLIFF format. The supported elements are:


As the file is imported, we try to find the source and target language tags and match them against existing languages. If only one of either source or target languages is defined in the file, we import the language specified, however XLIFF specifications indicate both source and target must be specified. Specifying the language manually will assume the target language is the one you are setting.

Handling translation states

Your target tags can contain certain translation states, for example:

<source>source text</source>
<target state="translated">target translation</target>

Lokalise reads these states and updates translation statuses accordingly.

XLIFF state

Translation status on Lokalise


Reviewed = false, unverified = false

final, signed-off

Reviewed = true, unverified = false


Reviewed = false, unverified = false


Reviewed = false, unverified = true


Reviewed = false, unverified = true


Reviewed = false, unverified = true


Reviewed = false, unverified = true


Reviewed = false, unverified = true


Reviewed = false, unverified = true

Please note that the Reviewed status will become available only if the project admin has enabled the Reviewing feature in the project settings.


Select the appropriate platform's format when exporting. Choosing Angular XLIFF causes plurals (see below) to be exported in ICU format (you can also check our blog post which gives a nice introduction to the ICU message format). As for the other XLIFF formats, plurals will be exported as JSON objects with keys and values.

Working with offline XLIFF

If the Offline translation feature is enabled in the project settings, task assignees can export the assigned items in the XLIFF format to work on them offline. Then, the finalized XLIFF file can be imported back to the assigned task. To achieve that, open the Tasks page, find the task you are interested in, and click on the Offline XLIFF dropdown:

Plural support

For all three we support ICU message format and JSON encoded string plurals. Currently, this is the predefined set of plural forms according to the Unicode CLDR Project which are described in the Plural Rules specification. Each language has its own set of tags specified in the Language Plural Rules

For Apple XLIFF files we also support the Apple format for keeping plurals. It's similar to the process in .stringsdict files as it contains format key and plural forms. There are keys for each format plural form and one for format. See example for details.

  <file original="Hello/en.lproj/Localizable.stringsdict" source-language="en" datatype="plaintext" target-language="ru">
      <trans-unit id="/plural_test:dict/NSStringLocalizedFormatKey:dict/:string">
      <trans-unit id="/plural_test:dict/format:dict/few:dict/:string">
      <trans-unit id="/plural_test:dict/format:dict/many:dict/:string">
      <trans-unit id="/plural_test:dict/format:dict/one:dict/:string">
      <trans-unit id="/plural_test:dict/format:dict/other:dict/:string">

Supported forms are:

  • zero

  • one

  • two

  • few

  • many

  • other

Forms like =0 or =404 will be lost at import.

Read more about plurals in our docs article.

Custom attributes

You can easily set XLIFF attributes in the useful JSON in our key editor. Follow the examples below.

Sample data

An XLIFF file example with English as the source language with 2 plural forms and Arabic as the target language with 6 plural forms:

<!--?xml version="1.0" encoding="UTF-8" ?-->
<xliff version="1.2" xmlns="urn:oasis:names:tc:xliff:document:1.2">
    <file source-language="en" target-language="ar" datatype="plaintext" original="user_section.tmpl">
            <trans-unit id="header" datatype="html">
                <target> ... </target>
                <context-group purpose="location">
                    <context context-type="sourcefile">app/app.component.ts</context>
                    <context context-type="linenumber">14</context>
                <note priority="1" from="description">Sample header</note>
                <note priority="1" from="meaning">Welcome visitors</note>
            <trans-unit id="wolves" datatype="html">
                <source>{wolves, plural, one {one} other {wolves}}</source>
                <target>{wolves, plural, zero {...} one {...} two {...} few {...} many {...} other {...}}</target>

Here is a full example of custom attributes in JSON with 1 context group and 2 notes:

    "datatype": "html",
    "context-groups": [
            "contexts": [
                    "context-type": "sourcefile",
                    "value": "app/app.component.ts"
                    "context-type": "linenumber",
                    "value": "1"
            "purpose": "location"
    "notes": [
            "value": "An introduction header for this sample",
            "priority": "1",
            "from": "description"
            "value": "User welcome",
            "priority": "1",
            "from": "meaning"
Did this answer your question?