# XLIFF 2.0

> XLIFF 2.0 file localization

URL: https://store.crowdin.com/xliff2.0
Identifier: xliff2.0
Category: File Formats
Type: System
Author: Crowdin

XLIFF 2.0 is a natively supported file format, you can use it without an additional installation. Just upload it to your projects and start the localization.

## File Format Details

| Attribute | Value |
| --------- | ----- |
| File Extension | .xliff |
| [API Type](https://developer.crowdin.com/api/v2/#operation/api.projects.files.post) | xliff_two |
| Source can be edited in Crowdin | Yes |
| Generating translated files via [Bundles](https://support.crowdin.com/bundles/) | [Search Crowdin Store](https://store.crowdin.com/tags/string-exporter) |
| Supports pluralization | Yes |
| WYSIWYG Preview in the editor | No |
| Supported types of contextual information | Text comments, Screenshots, In-Context |
| Custom attributes | Yes |
| Existing translations import possibility | Key-value mapping |

## Sample File

```xml
<?xml version="1.0" encoding="utf-8"?>
<xliff xmlns="urn:oasis:names:tc:xliff:document:2.0" version="2.0" srcLang="en" trgLang="fr">
  <file id="f1">
    <notes>
      <note id="n1">Note for file</note>
    </notes>
    <unit id="u1">
      <notes>
        <note id="n1">Note for unit</note>
      </notes>
      <segment id="s1" state="initial">
        <source>text</source>
        <target></target>
      </segment>
    </unit>
    <unit id="u2">
      <notes>
        <note id="n2">Note for unit 2</note>
      </notes>
      <segment id="s2" state="translated">
        <source>text 2</source>
        <target>translation 2</target>
      </segment>
    </unit>
    <unit id="u3">
      <notes>
        <note id="n3">Note for unit 3</note>
      </notes>
      <segment id="s3" state="final">
        <source>text 3</source>
        <target>approved translation 3</target>
      </segment>
    </unit>
  </file>
</xliff>
```

## Translating XLIFF 2.0


**Attributes** 



Translation state of the string: `initial`, `translated`, `final`.



`initial` &ndash; the segment needs translation.  

`translated` &ndash; the segment was translated.  

`final` &ndash; the segment was translated and approved.



```

<segment id="s1" state="initial">

  <source>text</source>

  <target></target>

</segment>

```



```

<segment id="s1" state="translated">

  <source>text 2</source>

  <target>translation 2</target>

</segment>

```



```

<segment id="s1" state="final">

  <source>text 3</source>

  <target>approved translation 3</target>

</segment>

```



**Auto-translation Source**



When Crowdin exports translations, strings auto-translated via Translation Memory, Machine Translation, or AI that haven't been reviewed yet include a `subState` attribute that indicates the auto-translation source. Such strings are exported with `state="translated"`.



`crowdin:leveraged-tm` &ndash; auto-translated via Translation Memory.  

`crowdin:leveraged-mt` &ndash; auto-translated via Machine Translation.  

`crowdin:leveraged-ai` &ndash; auto-translated via AI.



```

<segment id="s1" state="translated" subState="crowdin:leveraged-ai">

  <source>text</source>

  <target>translation</target>

</segment>

```



**Comments** 



```

<unit id="u1">

  <notes>

    <note id="n1">type your comment here</note>

  </notes>

  <segment id="s1" state="translated">

    <source>String for translation</source>

    <target>Translation</target>

  </segment>

</unit>

```



**Plurals**



```

<group id="90290" type="x-gettext:plurals">

  <unit id="90291" name="90290[0]">

    <notes>

      <note category="context">Context: ApplicationPreferencesActivity_messages_per_conversation [one] [other]</note>

    </notes>

    <segment>

      <source>%1s month</source>

      <target xml:lang="pl">%1s miesiąc</target>

    </segment>

  </unit>

  <unit id="90292" name="90290[1]">

    <segment>

      <source>%1s months</source>

      <target xml:lang="pl">%1s miesiące</target>

    </segment>

  </unit>

  <unit id="90293" name="90290[2]">

    <segment>

      <source>%1s months</source>

      <target xml:lang="pl">%1s miesięcy</target>

    </segment>

  </unit>

  <unit id="90294" name="90290[3]">

    <segment>

      <source>%1s months</source>

      <target xml:lang="pl">%1s miesiąca</target>

    </segment>

  </unit>

</group>

```
