Skip to content

Commit f620113

Browse files
committed
minor #16693 [Translation] Improve the section about loaders (javiereguiluz)
This PR was squashed before being merged into the 6.1 branch. Discussion ---------- [Translation] Improve the section about loaders Fixes #16547. Commits ------- 7fa9ced [Translation] Improve the section about loaders
2 parents f014bea + 7fa9ced commit f620113

File tree

2 files changed

+17
-9
lines changed

2 files changed

+17
-9
lines changed

.doctor-rst.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ rules:
1111
ensure_link_definition_contains_valid_url: ~
1212
ensure_order_of_code_blocks_in_configuration_block: ~
1313
extend_abstract_controller: ~
14-
extension_xlf_instead_of_xliff: ~
14+
# extension_xlf_instead_of_xliff: ~
1515
indention: ~
1616
lowercase_as_in_use_statements: ~
1717
max_blank_lines:

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
@@ -940,3 +944,7 @@ Learn more
940944
.. _`Translatable Extension`: https://github.com/doctrine-extensions/DoctrineExtensions/blob/main/doc/translatable.md
941945
.. _`Translatable Behavior`: https://github.com/KnpLabs/DoctrineBehaviors
942946
.. _`Custom Language Name setting`: https://docs.lokalise.com/en/articles/1400492-uploading-files#custom-language-codes
947+
.. _`ICU resource bundle`: https://github.com/unicode-org/icu-docs/blob/main/design/bnf_rb.txt
948+
.. _`Portable object format`: https://www.gnu.org/software/gettext/manual/html_node/PO-Files.html
949+
.. _`Machine object format`: https://www.gnu.org/software/gettext/manual/html_node/MO-Files.html
950+
.. _`QT Translations TS XML`: https://doc.qt.io/qt-5/linguist-ts-file-format.html

0 commit comments

Comments
 (0)