# XLIFF 2.0

#### Versionadded
Added in version 5.15.

#### Versionchanged
Förändrat i version 2026.9.

#### NOTE
Stöd för detta format är under utveckling. Vissa funktioner kanske ännu inte är tillgängliga och funktionen kan ändras mellan olika versioner. Feedback från testning är välkommen.

#### NOTE
[XLIFF 1.1 och 1.2](https://docs.weblate.org/sv/latest/formats/xliff.md) är ett annat format och är inte kompatibelt med XLIFF 2.0.

XML-baserat format som skapats för att standardisera översättningsfiler, men i slutändan är det en av [många standarder](https://xkcd.com/927/) inom detta område.

XML Localization Interchange File Format (XLIFF) 2.0 stöds för närvarande endast som tvåspråkigt.

Weblate supports XLIFF 2.0 as a single file format. Placeables handling is
controlled by the `xliff_placeables` [Filformatsparametrar](https://docs.weblate.org/sv/latest/formats.md#file-format-params):

* Plain text — escape XML elements in the content (the historical
  default for existing XLIFF 2.0 components).
* Placeables — preserve placeables and other XML elements (the
  default for new components). Tags then appear as placeholders in the editor.

#### SEE ALSO
* [XML Localization Interchange File Format (XLIFF) 2.0](https://docs.oasis-open.org/xliff/xliff-core/v2.0/xliff-core-v2.0.html) specifikation
* [XLIFF på Wikipedia](https://en.wikipedia.org/wiki/XLIFF)
* [XLIFF](https://docs.translatehouse.org/projects/translate-toolkit/en/latest/formats/xliff.html)
* [Filformatsparametrar](https://docs.weblate.org/sv/latest/formats.md#file-format-params)

## Exempel-filer

Exempel på XLIFF-fil:

```xml
<?xml version="1.0" encoding="UTF-8"?>
<xliff xmlns="urn:oasis:names:tc:xliff:document:2.0" version="2.0" srcLang="en" trgLang="cs">
  <file id="translation">
    <unit id="hello">
      <segment>
        <source xml:space="preserve">Hello, world!
</source>
        <target xml:space="preserve">Ahoj světe!
</target>
      </segment>
    </unit>
    <unit id="orangutan">
      <segment>
        <source xml:space="preserve">Orangutan has %d banana.
</source>
      </segment>
    </unit>
    <unit id="weblate">
      <segment>
        <source xml:space="preserve">Try Weblate at &lt;https://demo.weblate.org/&gt;!
</source>
      </segment>
    </unit>
    <unit id="thanks">
      <segment>
        <source>Thank you for using Weblate.</source>
      </segment>
    </unit>
  </file>
</xliff>
```

<!-- AUTOGENERATED START: format-features xliff2 -->
<!-- This section is automatically generated by `./manage.py list_format_features`. Do not edit manually. -->

#### Stödda funktioner

| File extensions                                                                                      | `.xlf`, `.xliff`            |
|------------------------------------------------------------------------------------------------------|-----------------------------|
| Språkkunskaper [ⓘ](https://docs.weblate.org/sv/latest/formats.md#bimono)                               | Bilingual                   |
| Supports plural [ⓘ](https://docs.weblate.org/sv/latest/formats.md#format-plurals)                      | `Yes`                       |
| Supports descriptions [ⓘ](https://docs.weblate.org/sv/latest/formats.md#format-description)            | `Yes`                       |
| Supports explanation [ⓘ](https://docs.weblate.org/sv/latest/formats.md#format-explanation)             | `No`                        |
| Supports context [ⓘ](https://docs.weblate.org/sv/latest/formats.md#format-context)                     | `Yes`                       |
| Supports location [ⓘ](https://docs.weblate.org/sv/latest/formats.md#format-location)                   | `Yes`                       |
| Supports flags [ⓘ](https://docs.weblate.org/sv/latest/formats.md#format-flags)                         | `Yes`                       |
| Additional states [ⓘ](https://docs.weblate.org/sv/latest/formats.md#format-states)                     | `Approved`, `Needs editing` |
| API identifier                                                                                       | `xliff2`                    |
| Supports read-only strings [ⓘ](https://docs.weblate.org/sv/latest/formats.md#read-only-strings)        | `Yes`                       |
| Supports removing obsolete strings [ⓘ](https://docs.weblate.org/sv/latest/formats.md#obsolete-strings) | `No`                        |
<!-- AUTOGENERATED END: format-features xliff2 -->

## Weblate-konfiguration

|                             | Typisk Weblate [Komponentkonfiguration](https://docs.weblate.org/sv/latest/admin/projects.md#component)   |
|-----------------------------|--------------------------------------------------------------------------------------------------|
| Filmask                     | `localizations/*.xliff`                                                                          |
| Enspråkig basspråkfil       | Tom                                                                                              |
| Mall för nya översättningar | `localizations/en-US.xliff`                                                                      |
| Filformat                   | XLIFF 2.0-översättningsfil                                                                       |
