Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Update translation.rst #4815

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jan 16, 2015
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 12 additions & 11 deletions book/translation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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::

Expand Down Expand Up @@ -727,18 +727,19 @@ And suppose you've already setup some translations for the ``fr`` locale inside
</file>
</xliff>


.. 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
return array(
'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::
Expand All @@ -758,18 +759,18 @@ and for the ``en`` locale:
</file>
</xliff>

.. 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
return array(
'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
Expand Down