Skip to content

Change '.xliff' extensions to '.xlf' #5190

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 26, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion best_practices/i18n.rst
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ English in the application would be:

.. code-block:: xml

<!-- app/Resources/translations/messages.en.xliff -->
<!-- app/Resources/translations/messages.en.xlf -->
<?xml version="1.0"?>
<xliff version="1.2" xmlns="urn:oasis:names:tc:xliff:document:1.2">
<file source-language="en" target-language="en" datatype="plaintext" original="file.ext">
Expand Down
14 changes: 7 additions & 7 deletions book/translation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ different formats, XLIFF being the recommended format:

.. code-block:: xml

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

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

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

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

* ``xliff``: XLIFF file;
* ``xlf``: XLIFF file;
* ``php``: PHP file;
* ``yml``: YAML file.

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

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

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

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

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

.. code-block:: xml

<!-- validators.en.xliff -->
<!-- validators.en.xlf -->
<?xml version="1.0"?>
<xliff version="1.2" xmlns="urn:oasis:names:tc:xliff:document:1.2">
<file source-language="en" datatype="plaintext" original="file.ext">
Expand Down
10 changes: 5 additions & 5 deletions components/translation/introduction.rst
Original file line number Diff line number Diff line change
Expand Up @@ -188,13 +188,13 @@ organization, translations were split into three different domains:
loaded like this::

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

$translator->addResource('xliff', 'messages.fr.xliff', 'fr_FR');
$translator->addResource('xliff', 'admin.fr.xliff', 'fr_FR', 'admin');
$translator->addResource('xlf', 'messages.fr.xlf', 'fr_FR');
$translator->addResource('xlf', 'admin.fr.xlf', 'fr_FR', 'admin');
$translator->addResource(
'xliff',
'navigation.fr.xliff',
'xlf',
'navigation.fr.xlf',
'fr_FR',
'navigation'
);
Expand Down