diff --git a/book/translation.rst b/book/translation.rst index 7cd2fe0e8a9..18522a94f25 100644 --- a/book/translation.rst +++ b/book/translation.rst @@ -334,7 +334,7 @@ The translator service is accessible in PHP templates through the Translation Resource/File Names and Locations --------------------------------------------- -Symfony looks for message files (i.e. translations) in the following locations: +Symfony looks for message files (i.e. translations) in the following default locations: * the ``app/Resources/translations`` directory; @@ -372,6 +372,49 @@ The choice of which loader to use is entirely up to you and is a matter of taste. The recommended option is to use ``xlf`` for translations. For more options, see :ref:`component-translator-message-catalogs`. +.. note:: + + You can add other directories with the ``paths`` option in the configuration: + + .. configuration-block:: + + .. code-block:: yaml + + # app/config/config.yml + framework: + translator: + paths: + - "%kernel.root_dir%/../translations" + + .. code-block:: xml + + + + + + + %kernel.root_dir%/../translations + + + + + .. code-block:: php + + $container->loadFromExtension('framework', array( + 'translator' => array( + 'paths' => array( + '%kernel.root_dir%/../translations' + ) + ), + )); + .. note:: You can also store translations in a database, or any other storage by