@@ -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
@@ -379,8 +378,52 @@ checks translation resources for several locales:
379378#. If it wasn't found, Symfony looks for the translation in a ``fr `` translation
380379 resource (e.g. ``messages.fr.xlf ``);
381380
382- #. If the translation still isn't found, Symfony uses the ``fallbacks `` configuration
383- parameter, which defaults to ``en `` (see `Configuration `_).
381+ #. If the translation still isn't found, Symfony uses the ``fallbacks `` option,
382+ which can be configured as follows:
383+
384+ .. configuration-block ::
385+
386+ .. code-block :: yaml
387+
388+ # config/packages/translation.yaml
389+ framework :
390+ translator :
391+ fallbacks : ['en']
392+ # ...
393+
394+ .. code-block :: xml
395+
396+ <!-- config/packages/translation.xml -->
397+ <?xml version =" 1.0" encoding =" UTF-8" ?>
398+ <container xmlns =" http://symfony.com/schema/dic/services"
399+ xmlns : xsi =" http://www.w3.org/2001/XMLSchema-instance"
400+ xmlns : framework =" http://symfony.com/schema/dic/symfony"
401+ xsi : schemaLocation =" http://symfony.com/schema/dic/services
402+ https://symfony.com/schema/dic/services/services-1.0.xsd
403+ http://symfony.com/schema/dic/symfony
404+ https://symfony.com/schema/dic/symfony/symfony-1.0.xsd" >
405+
406+ <framework : config >
407+ <framework : translator >
408+ <framework : fallback >en</framework : fallback >
409+ <!-- ... -->
410+ </framework : translator >
411+ </framework : config >
412+ </container >
413+
414+ .. code-block :: php
415+
416+ // config/packages/translation.php
417+ $container->loadFromExtension('framework', [
418+ 'translator' => ['fallbacks' => ['en']],
419+ // ...
420+ ]);
421+
422+ .. deprecated :: 4.4
423+
424+ In Symfony versions before 4.4, the ``fallbacks `` option was initialized to
425+ ``en `` (English) when not configured explicitly. Starting from Symfony 4.4,
426+ this option is initialized to the same value as the ``default_locale `` option.
384427
385428.. note ::
386429
0 commit comments