XLIFF

From Okapi Framework
Revision as of 19:20, 4 June 2016 by Ysavourel (talk | contribs) (1 revision imported)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Overview

XLIFF (XML Localisation Interchange File Format) provides a standard markup language for extracted localizable text. It is maintained by the XLIFF Technical Committee at OASIS. The version 1.2 specification and can be found here: http://docs.oasis-open.org/xliff/xliff-core/xliff-core.html.

An XLIFF document is composed of one or more <file> elements. Each <file> element corresponds to an original file or source (i.e. database table). A <file> contains the source of the localizable data and, once translated, the corresponding localized data for one, and only one, locale.

Localizable data are stored in <trans-unit> elements. The <trans-unit> element holds a <source> element to store the source text, and a <target> element to store the latest translated text. The <target> elements are not mandatory, and it can hold a copy of the original source text if needed at the beginning of the process.

<trans-unit id="1">
 <source xml:lang="en">Cannot find the file.</source>
 <target xml:lang="fr">Fichier non trouvé.</target>
</trans-unit>

Any translations of the <source> text that is not the latest (i.e. before proof, before edit, etc.), as well as possible proposed translations provided at some point during the localization process, can be stored in an unlimited number of <alt-trans> elements. The different versions of the translations can be linked to a specific phase of the process by the phase-name attribute. The details on the different phases can be stored in the <phase> elements, grouped in the <phase-group> element of the <header> (one per <file> element). If needed the <alt-trans> element can have also a corresponding <source> (i.e. for fuzzy matches).

The example below shows an XLIFF document storing text extracted from a Photoshop file (PSD file) and its translation in Japanese:

<xliff version="1.2">
 <file original="Graphic Example.psd"
  source-language="en-US" target-language="ja-JP"
  tool="Rainbow" datatype="photoshop">
  <header>
   <skl>
    <external-file uid="3BB236513BB24732" href="Graphic Example.psd.skl"/>
   </skl>
   <phase-group>
    <phase phase-name="extract" process-name="extraction"
     tool="Rainbow" date="20010926T152258Z"
     company-name="NeverLand Inc." job-id="123"
     contact-name="Peter Pan" contact-email="ppan@xyzcorp.com">
     <note>Make sure to use the glossary I sent you yesterday.
      Thanks.</note>
    </phase>
   </phase-group>
  </header>
  <body>
   <trans-unit id="1" maxbytes="14">
    <source xml:lang="en-US">Quetzal</source>
    <target xml:lang="ja-JP">Quetzal</target>
   </trans-unit>
   <trans-unit id="3" maxbytes="114">
    <source xml:lang="en-US">An application to manipulate and 
     process XLIFF documents</source>
    <target xml:lang="ja-JP">XLIFF 文書を編集、または処理
     するアプリケーションです。</target>
   </trans-unit>
   <trans-unit id="4" maxbytes="36">
    <source xml:lang="en-US">XLIFF Data Manager</source>
    <target xml:lang="ja-JP">XLIFF データ・マネージャ</target>
   </trans-unit>
  </body>
 </file>
</xliff>

Useful Resources

Version 2.0

The version 2.0 of XLIFF is the latest standard version of XLIFF

Some useful links:

XLIFF in the Okapi Framework

The Okapi Framework use XLIFF in many places. For example: