Skip to content

Commit b8debc5

Browse files
noniagriconomiejaviereguiluz
authored andcommitted
Update translation.rst
1 parent 683c628 commit b8debc5

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

translation.rst

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -410,6 +410,15 @@ The ``trans`` filter can be used to translate *variable texts* and complex expre
410410
{{ message|trans|raw }}
411411
{{ '<h3>bar</h3>'|trans|raw }}
412412
413+
.. tip::
414+
415+
When a number is provided as a parameter named "%count%", the message is parsed for plural
416+
forms and a translation is chosen according to this number using the following rules:
417+
418+
.. code-block:: twig
419+
420+
{{ message|trans({'%name%': 'Fabien', '%count%' => 1}, 'app') }}
421+
413422
.. tip::
414423

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

0 commit comments

Comments
 (0)