From f87f5f41344b140b055fab8c36d63cf1f97b9f51 Mon Sep 17 00:00:00 2001 From: Pierre Maraitre Date: Sat, 5 Dec 2015 09:51:07 +0100 Subject: [PATCH 1/7] Fix #5236 [Translation] specify additional translation loading paths --- book/translation.rst | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/book/translation.rst b/book/translation.rst index 7cd2fe0e8a9..9d601817ff0 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,18 @@ 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:: + + The the paths at which Symfony will look for message files can be modified by adding + your custom resources path in your config.yml: + + .. code-block:: yml + + framework: + translator: + paths: + - %kernel.root_dir%/../vendor/Symfony/Component/Form/Resources/translations + .. note:: You can also store translations in a database, or any other storage by From 40b7b78c9a411d75342d221745ea27087dfa3c7e Mon Sep 17 00:00:00 2001 From: Pierre Maraitre Date: Sat, 5 Dec 2015 09:57:31 +0100 Subject: [PATCH 2/7] Double "the" --- book/translation.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/book/translation.rst b/book/translation.rst index 9d601817ff0..1a644eaed9e 100644 --- a/book/translation.rst +++ b/book/translation.rst @@ -374,7 +374,7 @@ For more options, see :ref:`component-translator-message-catalogs`. .. note:: - The the paths at which Symfony will look for message files can be modified by adding + The paths at which Symfony will look for message files can be modified by adding your custom resources path in your config.yml: .. code-block:: yml From c220cd0a5bbc1d2b20296c30e2db00b68863a57e Mon Sep 17 00:00:00 2001 From: Pierre Maraitre Date: Sat, 5 Dec 2015 10:00:51 +0100 Subject: [PATCH 3/7] Clearer formulation --- book/translation.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/book/translation.rst b/book/translation.rst index 1a644eaed9e..a89c278003b 100644 --- a/book/translation.rst +++ b/book/translation.rst @@ -375,7 +375,7 @@ For more options, see :ref:`component-translator-message-catalogs`. .. note:: The paths at which Symfony will look for message files can be modified by adding - your custom resources path in your config.yml: + your custom resources path in your config.yml file: .. code-block:: yml From 0d8eadc4860d26d1529001177affdec96cb2ce01 Mon Sep 17 00:00:00 2001 From: Pierre Maraitre Date: Sat, 5 Dec 2015 10:23:37 +0100 Subject: [PATCH 4/7] Wrong code-block tag --- book/translation.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/book/translation.rst b/book/translation.rst index a89c278003b..5a05b74846a 100644 --- a/book/translation.rst +++ b/book/translation.rst @@ -377,7 +377,7 @@ For more options, see :ref:`component-translator-message-catalogs`. The paths at which Symfony will look for message files can be modified by adding your custom resources path in your config.yml file: - .. code-block:: yml + .. code-block:: yaml framework: translator: From 2cabebe6848578fd01d595fe974d6a84c1d42386 Mon Sep 17 00:00:00 2001 From: Pierre Maraitre Date: Sat, 5 Dec 2015 11:56:35 +0100 Subject: [PATCH 5/7] Replace with a shorter phrase --- .idea/dictionaries/pmaraitre.xml | 7 +++++++ book/translation.rst | 3 +-- 2 files changed, 8 insertions(+), 2 deletions(-) create mode 100644 .idea/dictionaries/pmaraitre.xml diff --git a/.idea/dictionaries/pmaraitre.xml b/.idea/dictionaries/pmaraitre.xml new file mode 100644 index 00000000000..d22c22cd2d5 --- /dev/null +++ b/.idea/dictionaries/pmaraitre.xml @@ -0,0 +1,7 @@ + + + + symfony + + + \ No newline at end of file diff --git a/book/translation.rst b/book/translation.rst index 5a05b74846a..1eac0983444 100644 --- a/book/translation.rst +++ b/book/translation.rst @@ -374,8 +374,7 @@ For more options, see :ref:`component-translator-message-catalogs`. .. note:: - The paths at which Symfony will look for message files can be modified by adding - your custom resources path in your config.yml file: + You can add other translation paths with the ``paths`` option in the configuration: .. code-block:: yaml From b3fa9412cdb4d98aa4fbed90bf5d659b2a0b00fa Mon Sep 17 00:00:00 2001 From: Pierre Maraitre Date: Sat, 5 Dec 2015 12:01:58 +0100 Subject: [PATCH 6/7] Adding configuration examples for other formats --- book/translation.rst | 48 ++++++++++++++++++++++++++++++++++++-------- 1 file changed, 40 insertions(+), 8 deletions(-) diff --git a/book/translation.rst b/book/translation.rst index 1eac0983444..18522a94f25 100644 --- a/book/translation.rst +++ b/book/translation.rst @@ -374,14 +374,46 @@ For more options, see :ref:`component-translator-message-catalogs`. .. note:: - You can add other translation paths with the ``paths`` option in the configuration: - - .. code-block:: yaml - - framework: - translator: - paths: - - %kernel.root_dir%/../vendor/Symfony/Component/Form/Resources/translations + 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:: From 46de0d6bb04a09cde0ef29216811f81f8ff92b6d Mon Sep 17 00:00:00 2001 From: Pierre Maraitre Date: Sat, 5 Dec 2015 12:31:38 +0100 Subject: [PATCH 7/7] Delete pmaraitre.xml Delete file pushed automatically by PhpStorm --- .idea/dictionaries/pmaraitre.xml | 7 ------- 1 file changed, 7 deletions(-) delete mode 100644 .idea/dictionaries/pmaraitre.xml diff --git a/.idea/dictionaries/pmaraitre.xml b/.idea/dictionaries/pmaraitre.xml deleted file mode 100644 index d22c22cd2d5..00000000000 --- a/.idea/dictionaries/pmaraitre.xml +++ /dev/null @@ -1,7 +0,0 @@ - - - - symfony - - - \ No newline at end of file