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