From b8debc577af26c525b59b05f70317fd75fa34fef Mon Sep 17 00:00:00 2001 From: Antoine Makdessi Date: Mon, 19 Apr 2021 16:44:32 +0200 Subject: [PATCH] Update translation.rst --- translation.rst | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/translation.rst b/translation.rst index a612c218454..29285a114a1 100644 --- a/translation.rst +++ b/translation.rst @@ -410,6 +410,15 @@ The ``trans`` filter can be used to translate *variable texts* and complex expre {{ message|trans|raw }} {{ '

bar

'|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: