From 74cc7c2058e5e3cfce5c0b9429d2e30480d5cd64 Mon Sep 17 00:00:00 2001 From: Christian Decruynaere Date: Sun, 14 Jul 2013 01:45:54 +0200 Subject: [PATCH 1/4] [The Book, Translations] Added doc for #8489 Some information about translation domain cascading. --- book/translation.rst | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/book/translation.rst b/book/translation.rst index 7c99115f63c..461603358c2 100644 --- a/book/translation.rst +++ b/book/translation.rst @@ -493,6 +493,15 @@ you must specify the domain as the third argument of ``trans()``:: Symfony2 will now look for the message in the ``admin`` domain of the user's locale. +In some cases, you may need a fallback mechanism: you can also provide an +array of domains instead of a simple string: + + $this->get('translator')->trans('Do something', array(), array('specialized', 'messages', 'last_resort')); + +At first, the translator will look for the message in the ``specialized`` +domain. Without result, it will then look in the ``messages`` domain, and +so on… + .. index:: single: Translations; User's locale From b7425adbce4b1ccd24627f346789db05b2dc1637 Mon Sep 17 00:00:00 2001 From: Christian Decruynaere Date: Sun, 14 Jul 2013 13:19:43 +0200 Subject: [PATCH 2/4] [The Book, Translations] fixed domain cascading doc --- book/translation.rst | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/book/translation.rst b/book/translation.rst index 461603358c2..1a9df9df5d1 100644 --- a/book/translation.rst +++ b/book/translation.rst @@ -494,14 +494,21 @@ Symfony2 will now look for the message in the ``admin`` domain of the user's locale. In some cases, you may need a fallback mechanism: you can also provide an -array of domains instead of a simple string: +array of domains instead: - $this->get('translator')->trans('Do something', array(), array('specialized', 'messages', 'last_resort')); + $this->get('translator')->trans( + 'Do something', + array(), + array('specialized', 'messages', 'last_resort') + ); At first, the translator will look for the message in the ``specialized`` domain. Without result, it will then look in the ``messages`` domain, and so on… +.. versionadded:: 2.4 + Support for translation domain cascading was added in Symfony 2.4. + .. index:: single: Translations; User's locale From 86c432e056a5a7ebe2ca41b05fa078d808bf657f Mon Sep 17 00:00:00 2001 From: Christian Decruynaere Date: Sun, 14 Jul 2013 13:19:43 +0200 Subject: [PATCH 3/4] [The Book, Translations] fixed domain cascading doc --- book/translation.rst | 3 +++ 1 file changed, 3 insertions(+) diff --git a/book/translation.rst b/book/translation.rst index 1a9df9df5d1..01ea7f37387 100644 --- a/book/translation.rst +++ b/book/translation.rst @@ -493,6 +493,9 @@ you must specify the domain as the third argument of ``trans()``:: Symfony2 will now look for the message in the ``admin`` domain of the user's locale. +.. versionadded:: 2.4 + Support for translation domain cascading was added in Symfony 2.4. + In some cases, you may need a fallback mechanism: you can also provide an array of domains instead: From 346dbe4887a19ed8e5a86aeeab0641731fcb2688 Mon Sep 17 00:00:00 2001 From: Christian Decruynaere Date: Mon, 22 Jul 2013 15:44:04 +0200 Subject: [PATCH 4/4] [The Book, Translations] fixed domain cascading doc --- book/translation.rst | 3 --- 1 file changed, 3 deletions(-) diff --git a/book/translation.rst b/book/translation.rst index 01ea7f37387..0392202650e 100644 --- a/book/translation.rst +++ b/book/translation.rst @@ -509,9 +509,6 @@ At first, the translator will look for the message in the ``specialized`` domain. Without result, it will then look in the ``messages`` domain, and so on… -.. versionadded:: 2.4 - Support for translation domain cascading was added in Symfony 2.4. - .. index:: single: Translations; User's locale