From 93bc1bf8a72034a69c3ae3ffc93e5bb080d5cd58 Mon Sep 17 00:00:00 2001 From: "Andrew (Andrius) Marcinkevicius" Date: Tue, 13 Jan 2015 11:11:00 +0200 Subject: [PATCH] Update translation.rst | Q | A | ------------- | --- | Doc fix? | yes | New docs? | no | Applies to | 2.5 | Fixed tickets | --- book/translation.rst | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/book/translation.rst b/book/translation.rst index 13c99f02883..47c029da259 100644 --- a/book/translation.rst +++ b/book/translation.rst @@ -692,7 +692,7 @@ It will also detect the following translator usages in PHP templates: $view['translator']->trans("Symfony2 is great"); - $view['translator']->trans('Symfony2 is great'); + $view['translator']->transChoice('Symfony2 is great', 1); .. caution:: @@ -727,6 +727,12 @@ And suppose you've already setup some translations for the ``fr`` locale inside + + .. code-block:: yaml + + # src/Acme/AcmeDemoBundle/Resources/translations/messages.fr.yml + Symfony2 is great: J'aime Symfony2 + .. code-block:: php // src/Acme/AcmeDemoBundle/Resources/translations/messages.fr.php @@ -734,11 +740,6 @@ And suppose you've already setup some translations for the ``fr`` locale inside 'Symfony2 is great' => 'J\'aime Symfony2', ); - .. code-block:: yaml - - # src/Acme/AcmeDemoBundle/Resources/translations/messages.fr.yml - Symfony2 is great: J'aime Symfony2 - and for the ``en`` locale: .. configuration-block:: @@ -758,6 +759,11 @@ and for the ``en`` locale: + .. code-block:: yaml + + # src/Acme/AcmeDemoBundle/Resources/translations/messages.en.yml + Symfony2 is great: Symfony2 is great + .. code-block:: php // src/Acme/AcmeDemoBundle/Resources/translations/messages.en.php @@ -765,11 +771,6 @@ and for the ``en`` locale: 'Symfony2 is great' => 'Symfony2 is great', ); - .. code-block:: yaml - - # src/Acme/AcmeDemoBundle/Resources/translations/messages.en.yml - Symfony2 is great: Symfony2 is great - To inspect all messages in the ``fr`` locale for the AcmeDemoBundle, run: .. code-block:: bash