|
File Extensions |
.xlf, .xliff |
|
API Extension |
xliff_2 |
|
Import |
Yes |
|
Export |
Yes |
|
Plural forms support |
Yes |
|
Plural forms support |
No |
|
Format options These options that can be specified when a file is uploaded and/or downloaded. Depending on the upload/download method (API, CLI, Repo sync etc.), they can be specified in query parameters |
ignore_source_translations, ignore_target_translations, override_file_language, enclose_in_cdata, include_translation_state |
XLIFF 2.0 is an update on the more commonly used XLIFF 1.2.
It is an XML-based variation that uses tags such as <source>, <target> to store original and translated texts for a given source file. In addition, it extracts non-translatable data including variables, codes, and comments and saves them in customized elements.
Compared with XLIFF 1.2, XLIFF 2.0 has the advantage of simplicity coming from a better organized DOM structure and the application of modularity.
XLIFF 2.0 has a different DOM structure than XLIFF 1.2. The two formats are usually incompatible.
Format Options
|
Identifier |
ignore_source_translations |
|
Type |
boolean |
|
Upload |
Yes |
|
Download |
No |
|
Default |
false |
|
Description |
Ignores the source translations in the file during the upload (to avoid accidental source language updates) |
|
Identifier |
ignore_target_translations |
|
Type |
boolean |
|
Upload |
Yes |
|
Download |
No |
|
Default |
false |
|
Description |
Ignores the target translations in the file during the upload (to avoid accidental target language updates) |
|
Identifier |
override_file_language |
|
Type |
boolean |
|
Upload |
Yes |
|
Download |
No |
|
Default |
false |
|
Description |
This file format typically contains language information in the file itself. Use this option to override the language with one you specify. |
|
Identifier |
enclose_in_cdata |
|
Type |
boolean |
|
Upload |
No |
|
Download |
Yes |
|
Default |
false |
|
Description |
Encloses translations containing html tags in CDATA. If disabled, unsupported HTML entities are replaced with their decoded values. For example:
|
Code Sample
<?xml version="1.0" encoding="UTF-8" ?>
<xliff version="2.0" xmlns="urn:oasis:names:tc:xliff:document:2.0" srcLang="en" trgLang="de">
<file original="ng.template" id="ngi18n">
<unit id="key_name">
<notes>
<note category="meaning">header</note>
<note category="location">app/app.component.ts:2</note>
</notes>
<segment>
<source>Hello</source>
<target>Hallo</target>
</segment>
</unit>
</file>
</xliff>
Plural forms
Pluralized keys will be exported using the following syntax:
<unit id="plural_key">
<segment>
<source>{"one":"a plural","other":"some plurals"}</source>
<target>{"one":"ein Plural","other":"einige Plurale"}</target>
</segment>
</unit>