/
Import / Export Translations XLIFF

Import / Export Translations XLIFF

XLIFF is the XML Localization Interchange File Format designed by a group of software providers, localization service providers and localization tools providers. It is intended to give any software provider a single interchange file format that can be understood by any localization provider. It is loosely based on the OpenTag version 1.2 specification and borrows from the TMX 1.2 specification. However, it is different enough from either one to be its own format. The full specification of XLIFF 2.0 can be found here:

https://docs.oasis-open.org/xliff/xliff-core/v2.0/os/xliff-core-v2.0-os.html

Perfion supports a basic import/export of XLIFF. Please read this documentation carefully to learn about the requirements and limitations of the XLIFF support in Perfion.

Perfion only supports XLIFF version 2.0

Export

Export to XLIFF 2.0 Format via ‘Output to file’

This is a step-by-step guide on how to export data from Perfion into XLIFF 2.0 format.

Step 1: Find the data to export

  • XLIFF export is supported through the grid in Perfion. 

  • On any grid in Perfion you’ll find the Output button.

  • Click the button to export the contents of the grid to XLIFF – Note that only localizable features are exported. See the section “Limitations” to learn which feature types are supported.

Step 2: Export data into XLIFF

  • When the decided set of data is displayed in the grid, press the Output button and choose XLIFF 2.0.

  • You will then be asked to select a target language. The target language is the language you wish to have your data translated into.

  • Once a target language is selected click the “OK” button.

  • Checking the ‘Include Existing Translations’ check box will include all already existing translations of the target language.

  • As a last step, you are asked to save the file to disk. Once done the export is finished.

Export to XLIFF 2.0 via Perfion API

Using the ‘targetlanguage’ and ‘exportformat’ attributes

It is possible to output a Perfion Query’s result as XLIFF instead of XML. This is done by adding the targetlanguage and exportformat attributes in the select tag. When adding these attributes, the query will be executed as always, but the final result will be transformed into valid XLIFF.

The targetlanguage attribute takes one parameter which will be interpreted as the target language and the exportformat tells the query to get the result as XLIFF.

Example (good):

<Query>         <Select languages='EN' targetlanguage=’DA’ exportformat='xliff'>                <Feature id='**' view='Config' />         </Select>         <From id ='100'/>         <Where>                <Clause id='Manufacturer' operator='=' value='Volvo' />         </Where> </Query>

In the above example, the data result will be outputted as XLIFF, because targetlanguage and exportformat is specified in the <Select> tag. The source language will be ‘EN’, as this is the first language specified in the languages attribute. The target language will be ‘DE’, because this is specified in the targetlanguage attribute.

Example (bad):

<Query>         <Select languages='EN,DE' targetlanguage=’’ exportformat='xliff'>                <Feature id='**' view='Config' />         </Select>         <From id ='100'/>         <Where>                <Clause id='Manufacturer' operator='=' value='Volvo' />         </Where> </Query>

In the above example, no target language is specified in the targetlanguage attribute, which will result in an error when the query is executed.

Using the ‘IncludeExistingTranslations’ option

When outputting as XLIFF, the ‘IncludeExisitingTranslations’ option can be used to include already existing translations of the target language in the result. If no translation exists, the <target> tag will just be empty.

NOTE: To use this option, the targetlanguage and exportformat must be set according to the correct example shown above.

Example (good):