The XLIFF format

The XLIFF format

Most professional translation tools support XLIFF. These files use the XML format and are supported by Symfony by default. Besides supporting all Symfony translation features, the XLIFF format also has some specific features.

Adding Notes to Translation Contents

Sometimes translators need additional context to better decide how to translate some content. This context can be provided with notes, which are a collection of comments used to store end user readable information. The only format that supports loading and dumping notes is XLIFF version 2.

If the XLIFF 2.0 document contains <notes> nodes, they are automatically loaded/dumped inside a Symfony application:

  1. <?xml version="1.0" encoding="UTF-8" ?>
  2. <xliff xmlns="urn:oasis:names:tc:xliff:document:2.1" version="2.1"
  3. srcLang="fr-FR" trgLang="en-US">
  4. <file id="messages.en_US">
  5. <unit id="LCa0a2j" name="original-content">
  6. <notes>
  7. <note category="state">new</note>
  8. <note category="approved">true</note>
  9. <note category="section" priority="1">user login</note>
  10. </notes>
  11. <segment>
  12. <source>original-content</source>
  13. <target>translated-content</target>
  14. </segment>
  15. </unit>
  16. </file>
  17. </xliff>

This work, including the code samples, is licensed under a Creative Commons BY-SA 3.0 license.