@@ -59,8 +59,8 @@ Configuration
5959-------------
6060
6161The previous command creates an initial config file where you can define the
62- default locale of the app and the :ref:`fallback locales < translation-fallback>`
63- that will be used if Symfony can't find some translation :
62+ default locale of the application and the directory where the translation files
63+ are located :
6464
6565.. configuration-block::
6666
@@ -70,8 +70,7 @@ that will be used if Symfony can't find some translation:
7070 framework:
7171 default_locale: 'en'
7272 translator:
73- fallbacks: ['en']
74- # ...
73+ default_path: '%kernel.project_dir%/translations'
7574
7675 .. code-block:: xml
7776
@@ -87,7 +86,7 @@ that will be used if Symfony can't find some translation:
8786
8887 <framework:config default-locale="en">
8988 <framework:translator>
90- <framework:fallback>en </framework:fallback >
89+ <framework:default-path>'%kernel.project_dir%/translations' </framework:default-path >
9190 <!-- ... -->
9291 </framework:translator>
9392 </framework:config>
@@ -98,7 +97,7 @@ that will be used if Symfony can't find some translation:
9897 // config/packages/translation.php
9998 $container->loadFromExtension('framework', [
10099 'default_locale' => 'en',
101- 'translator' => ['fallbacks ' => ['en'] ],
100+ 'translator' => ['default_path ' => '%kernel.project_dir%/translations' ],
102101 // ...
103102 ]);
104103
@@ -397,8 +396,52 @@ checks translation resources for several locales:
397396#. If it wasn't found, Symfony looks for the translation in a ``fr`` translation
398397 resource (e.g. ``messages.fr.xlf``);
399398
400- #. If the translation still isn't found, Symfony uses the ``fallbacks`` configuration
401- parameter, which defaults to ``en`` (see `Configuration`_).
399+ #. If the translation still isn't found, Symfony uses the ``fallbacks`` option,
400+ which can be configured as follows:
401+
402+ .. configuration-block::
403+
404+ .. code-block:: yaml
405+
406+ # config/packages/translation.yaml
407+ framework:
408+ translator:
409+ fallbacks: ['en']
410+ # ...
411+
412+ .. code-block:: xml
413+
414+ <!-- config/packages/translation.xml -->
415+ <?xml version="1.0" encoding="UTF-8" ?>
416+ <container xmlns="http://symfony.com/schema/dic/services"
417+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
418+ xmlns:framework="http://symfony.com/schema/dic/symfony"
419+ xsi:schemaLocation="http://symfony.com/schema/dic/services
420+ https://symfony.com/schema/dic/services/services-1.0.xsd
421+ http://symfony.com/schema/dic/symfony
422+ https://symfony.com/schema/dic/symfony/symfony-1.0.xsd">
423+
424+ <framework:config>
425+ <framework:translator>
426+ <framework:fallback>en</framework:fallback>
427+ <!-- ... -->
428+ </framework:translator>
429+ </framework:config>
430+ </container>
431+
432+ .. code-block:: php
433+
434+ // config/packages/translation.php
435+ $container->loadFromExtension('framework', [
436+ 'translator' => ['fallbacks' => ['en']],
437+ // ...
438+ ]);
439+
440+ .. deprecated:: 4.4
441+
442+ In Symfony versions before 4.4, the ``fallbacks`` option was initialized to
443+ ``en`` (English) when not configured explicitly. Starting from Symfony 4.4,
444+ this option is initialized to the same value as the ``default_locale`` option.
402445
403446.. note::
404447
0 commit comments