weblate/docs/formats/xliff2.rst
Gersona 725bd96349
feat(docs): Automatically generate format features docmentation (#18106)
* initial implementation suggestion

* basic supported features snippets generation

* Add API identifiers, read-only strings and common extensions to features table

* generate doc features snippet files

* autogenerated snippets cleanup

* changelog update

* delete one file to test auto-update

* replace SUPPORTS_FUZZY with file format additional_states flag

* docs: Documentation snippets update

* fix include statetement typo

* fix incorrect monolingual attributes

* minor styling change

* docs: Documentation snippets update

* exclude snippets from being treated as standalone documents

* Set YAMLFormat as both mono/bilingual

* docs: Documentation snippets update

* fix duplicate format IDs

* only use backwards quotes for literals

---------

Co-authored-by: gersona <6675010+gersona@users.noreply.github.com>
Co-authored-by: Michal Čihař <michal@weblate.org>
2026-04-01 15:41:20 +00:00

56 lines
2 KiB
ReStructuredText

XLIFF 2.0
---------
.. versionadded:: 5.15
.. include:: /snippets/format-in-development.rst
.. note::
:doc:`/formats/xliff` is a different format and is not compatible with XLIFF 2.0.
XML-based format created to standardize translation files, but in the end it
is one of `many standards <https://xkcd.com/927/>`_, in this area.
`XML Localization Interchange File Format (XLIFF) 2.0` is currently only supported as bilingual.
Weblate supports XLIFF in several variants:
`XLIFF 2.0 translation file`
Simple XLIFF file where content of the elements is stored as plain text (all XML elements being escaped).
`XLIFF 2.0 with placeables support`
Standard XLIFF supporting placeables and other XML elements.
.. seealso::
* `XML Localization Interchange File Format (XLIFF) 2.0`_ specification
* `XLIFF on Wikipedia <https://en.wikipedia.org/wiki/XLIFF>`_
* :doc:`tt:formats/xliff`
.. _XML Localization Interchange File Format (XLIFF) 2.0: https://docs.oasis-open.org/xliff/xliff-core/v2.0/xliff-core-v2.0.html
Example files
+++++++++++++
Example XLIFF file:
.. literalinclude:: ../../weblate/trans/tests/data/cs.xliff2
:language: xml
.. include:: /snippets/format-features/xliff2-features.rst
Weblate configuration
+++++++++++++++++++++
+-----------------------------------------------------------------------+
| Typical Weblate :ref:`component` |
+================================+======================================+
| File mask | ``localizations/*.xliff`` |
+--------------------------------+--------------------------------------+
| Monolingual base language file | `Empty` |
+--------------------------------+--------------------------------------+
| Template for new translations | ``localizations/en-US.xliff`` |
+--------------------------------+--------------------------------------+
| File format | `XLIFF 2.0 Translation File` |
+--------------------------------+--------------------------------------+