Skip to content

Commit

Permalink
Update translation.rst
Browse files Browse the repository at this point in the history
  • Loading branch information
noniagriconomie authored and javiereguiluz committed Aug 12, 2021
1 parent 683c628 commit b8debc5
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions translation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -410,6 +410,15 @@ The ``trans`` filter can be used to translate *variable texts* and complex expre
{{ message|trans|raw }}
{{ '<h3>bar</h3>'|trans|raw }}
.. tip::

When a number is provided as a parameter named "%count%", the message is parsed for plural
forms and a translation is chosen according to this number using the following rules:

.. code-block:: twig
{{ message|trans({'%name%': 'Fabien', '%count%' => 1}, 'app') }}
.. tip::

You can set the translation domain for an entire Twig template with a single tag:
Expand Down

0 comments on commit b8debc5

Please sign in to comment.