Skip to content

Commit c2d1f3d

Browse files
committed
minor #5190 Change '.xliff' extensions to '.xlf' (xelaris)
This PR was merged into the 2.3 branch. Discussion ---------- Change '.xliff' extensions to '.xlf' | Q | A | ------------- | --- | Doc fix? | yes | New docs? | no | Applies to | 2.3+ | Fixed tickets | I'm not committed to this PR, since I prefer `.xliff` over `.xlf` extension personally, but when calling `app/console translation:update --output-format xlf en --force` you get a `app/Resources/translations/messages.en.xlf` file and this is especially bad if you already have an equivalent `.xliff` file. In addition `.xlf` is the default extension for distributed translations since symfony/symfony@2cb6260 and `XliffFileDumper` uses the `xlf` extension. So I think it is more consistent to show `.xlf` files in the doc. Commits ------- 4ce1a94 Change 'xliff' extensions and loader name to 'xlf'
2 parents 32b874a + 4ce1a94 commit c2d1f3d

File tree

3 files changed

+13
-13
lines changed

3 files changed

+13
-13
lines changed

best_practices/i18n.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ English in the application would be:
8080

8181
.. code-block:: xml
8282
83-
<!-- app/Resources/translations/messages.en.xliff -->
83+
<!-- app/Resources/translations/messages.en.xlf -->
8484
<?xml version="1.0"?>
8585
<xliff version="1.2" xmlns="urn:oasis:names:tc:xliff:document:1.2">
8686
<file source-language="en" target-language="en" datatype="plaintext" original="file.ext">

book/translation.rst

+7-7
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ different formats, XLIFF being the recommended format:
127127

128128
.. code-block:: xml
129129
130-
<!-- messages.fr.xliff -->
130+
<!-- messages.fr.xlf -->
131131
<?xml version="1.0"?>
132132
<xliff version="1.2" xmlns="urn:oasis:names:tc:xliff:document:1.2">
133133
<file source-language="en" datatype="plaintext" original="file.ext">
@@ -359,18 +359,18 @@ must be named according to the following path: ``domain.locale.loader``:
359359

360360
* **locale**: The locale that the translations are for (e.g. ``en_GB``, ``en``, etc);
361361

362-
* **loader**: How Symfony should load and parse the file (e.g. ``xliff``,
362+
* **loader**: How Symfony should load and parse the file (e.g. ``xlf``,
363363
``php``, ``yml``, etc).
364364

365365
The loader can be the name of any registered loader. By default, Symfony
366366
provides many loaders, including:
367367

368-
* ``xliff``: XLIFF file;
368+
* ``xlf``: XLIFF file;
369369
* ``php``: PHP file;
370370
* ``yml``: YAML file.
371371

372372
The choice of which loader to use is entirely up to you and is a matter of
373-
taste. The recommended option is to use ``xliff`` for translations.
373+
taste. The recommended option is to use ``xlf`` for translations.
374374
For more options, see :ref:`component-translator-message-catalogs`.
375375

376376
.. note::
@@ -400,10 +400,10 @@ key ``Symfony is great``. To find the French translation, Symfony actually
400400
checks translation resources for several locales:
401401

402402
#. First, Symfony looks for the translation in a ``fr_FR`` translation resource
403-
(e.g. ``messages.fr_FR.xliff``);
403+
(e.g. ``messages.fr_FR.xlf``);
404404

405405
#. If it wasn't found, Symfony looks for the translation in a ``fr`` translation
406-
resource (e.g. ``messages.fr.xliff``);
406+
resource (e.g. ``messages.fr.xlf``);
407407

408408
#. If the translation still isn't found, Symfony uses the ``fallbacks`` configuration
409409
parameter, which defaults to ``en`` (see `Configuration`_).
@@ -661,7 +661,7 @@ bundle.
661661

662662
.. code-block:: xml
663663
664-
<!-- validators.en.xliff -->
664+
<!-- validators.en.xlf -->
665665
<?xml version="1.0"?>
666666
<xliff version="1.2" xmlns="urn:oasis:names:tc:xliff:document:1.2">
667667
<file source-language="en" datatype="plaintext" original="file.ext">

components/translation/introduction.rst

+5-5
Original file line numberDiff line numberDiff line change
@@ -188,13 +188,13 @@ organization, translations were split into three different domains:
188188
loaded like this::
189189

190190
// ...
191-
$translator->addLoader('xliff', new XliffFileLoader());
191+
$translator->addLoader('xlf', new XliffFileLoader());
192192

193-
$translator->addResource('xliff', 'messages.fr.xliff', 'fr_FR');
194-
$translator->addResource('xliff', 'admin.fr.xliff', 'fr_FR', 'admin');
193+
$translator->addResource('xlf', 'messages.fr.xlf', 'fr_FR');
194+
$translator->addResource('xlf', 'admin.fr.xlf', 'fr_FR', 'admin');
195195
$translator->addResource(
196-
'xliff',
197-
'navigation.fr.xliff',
196+
'xlf',
197+
'navigation.fr.xlf',
198198
'fr_FR',
199199
'navigation'
200200
);

0 commit comments

Comments
 (0)