Angular XLIFF
- Extension
- .xlf
- Import
- yes
- Export
- yes
Angular XLIFF files are Angular generated files, composed of one <file> element.
The <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.
Important
The export cannot be performed without setting a Default Reference Language on the project.
The values in the Reference Language go to the <source> tag, while the translations end up in the <target> tag.
Documentation
To export to Angular XLIFF, set the default language in the project settings: this format stores both the source and the translation.
Example
Download the example file<?xml version="1.0" encoding="UTF-8"?> <xliff version="1.2" xmlns="urn:oasis:names:tc:xliff:document:1.2"> <file source-language="en" target-language="fr" datatype="plaintext" original="ng2.template"> <body> <trans-unit id="addTerm" datatype="html"> <target>Ajouter une traduction</target> <source>Add translation</source> </trans-unit> <trans-unit id="cancel" datatype="html"> <target>Annuler</target> <source>Cancel</source> </trans-unit> <trans-unit id="confirm" datatype="html"> <target>Confirmer</target> <source>Confirm</source> </trans-unit> <trans-unit id="enterProjectName" datatype="html"> <target>Entrez le nom du projet</target> <source>Enter project name</source> </trans-unit> <trans-unit id="helloWorld" datatype="html"> <target>Bonjour le monde</target> <source>Hello World</source> </trans-unit> <trans-unit id="hi" datatype="html"> <target>Bonjour</target> <source>Hello</source> </trans-unit> <trans-unit id="selectLanguage" datatype="html"> <target>Choisir la langue</target> <source>Choose language</source> </trans-unit> <trans-unit id="settings" datatype="html"> <target>Paramètres</target> <source>Settings</source> </trans-unit> </body> </file> </xliff>