Skip to content

Commit 319575a

Browse files
committed
[Translation] Improve the section about loaders
1 parent 835d083 commit 319575a

File tree

1 file changed

+16
-8
lines changed

1 file changed

+16
-8
lines changed

translation.rst

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -509,18 +509,22 @@ must be named according to the following path: ``domain.locale.loader``:
509509
``php``, ``yaml``, etc).
510510

511511
The loader can be the name of any registered loader. By default, Symfony
512-
provides many loaders:
512+
provides many loaders which are selected based on the following file extensions:
513513

514-
* ``.yaml``: YAML file
515-
* ``.xlf``: XLIFF file;
516-
* ``.php``: Returning a PHP array;
514+
* ``.yaml``: YAML file (you can also use the ``.yml`` file extension);
515+
* ``.xlf``: XLIFF file (you can also use the ``.xliff`` file extension);
516+
* ``.php``: a PHP file that returns an array with the translations;
517517
* ``.csv``: CSV file;
518518
* ``.json``: JSON file;
519519
* ``.ini``: INI file;
520-
* ``.dat``, ``.res``: ICU resource bundle;
521-
* ``.mo``: Machine object format;
522-
* ``.po``: Portable object format;
523-
* ``.qt``: QT Translations XML file;
520+
* ``.dat``, ``.res``: `ICU resource bundle`_;
521+
* ``.mo``: `Machine object format`_;
522+
* ``.po``: `Portable object format`_;
523+
* ``.qt``: `QT Translations TS XML`_ file;
524+
525+
.. versionadded:: 6.1
526+
527+
The ``.xliff`` file extension support was introduced in Symfony 6.1.
524528

525529
The choice of which loader to use is entirely up to you and is a matter of
526530
taste. The recommended option is to use YAML for simple projects and use XLIFF
@@ -877,3 +881,7 @@ Learn more
877881
.. _`Translatable Extension`: https://github.com/doctrine-extensions/DoctrineExtensions/blob/main/doc/translatable.md
878882
.. _`Translatable Behavior`: https://github.com/KnpLabs/DoctrineBehaviors
879883
.. _`Custom Language Name setting`: https://docs.lokalise.com/en/articles/1400492-uploading-files#custom-language-codes
884+
.. _`ICU resource bundle`: https://github.com/unicode-org/icu-docs/blob/main/design/bnf_rb.txt
885+
.. _`Portable object format`: https://www.gnu.org/software/gettext/manual/html_node/PO-Files.html
886+
.. _`Machine object format`: https://www.gnu.org/software/gettext/manual/html_node/MO-Files.html
887+
.. _`QT Translations TS XML`: https://doc.qt.io/qt-5/linguist-ts-file-format.html

0 commit comments

Comments
 (0)