July 17, 2014 Javier Eguiluz

Internationalization is one of the toughest features to implement in a web application. Specifically, translating contents is a challenging task that requires not only an advanced knowledge of the subject to translate, but as much contextual information as possible.

This recent conversation on the Symfony repository is a good example of the challenges that translators face when trying to adhere as closely as possible to the original meaning.

Since good translations are all about context information, Symfony 2.6 will add support for adding <note> elements to the XLIFF files. According to the XLIFF specification:

The <note> element is used to add localization-related comments to the XLIFF document. The content of <note> may include instructions from developers about how to handle the <source> , comments from the translator about the translation, or any comment from anyone involved in processing the XLIFF file.

The previous versions of Symfony removed the <note> nodes from XLIFF files when executing the translation:update command. Now, this command will preserve the <note> nodes alongside any optional from and priority attributes. The following is an example of a complex XLIFF file supported in Symfony 2.6: