Skip to content

Commit 22f17c6

Browse files
committed
fixed trans tag usage
1 parent 8ec9389 commit 22f17c6

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

book/translation.rst

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -712,9 +712,9 @@ You can also specify the message domain and pass some additional variables:
712712

713713
.. code-block:: jinja
714714
715-
{% trans with {'name': 'Fabien'} from "app" %}Hello %name%{% endtrans %}
715+
{% trans with {'%name%': 'Fabien'} from "app" %}Hello %name%{% endtrans %}
716716
717-
{% transchoice count with {'name': 'Fabien'} from "app" %}
717+
{% transchoice count with {'%name%': 'Fabien'} from "app" %}
718718
{0} There is no apples|{1} There is one apple|]1,Inf] There are %count% apples
719719
{% endtranschoice %}
720720
@@ -727,9 +727,9 @@ texts* and complex expressions:
727727
728728
{{ message | transchoice(5) }}
729729
730-
{{ message | trans({'name': 'Fabien'}, "app") }}
730+
{{ message | trans({'%name%': 'Fabien'}, "app") }}
731731
732-
{{ message | transchoice(5, {'name': 'Fabien'}, 'app') }}
732+
{{ message | transchoice(5, {'%name%': 'Fabien'}, 'app') }}
733733
734734
.. tip::
735735

@@ -820,4 +820,4 @@ steps:
820820

821821
.. _`strtr function`: http://www.php.net/manual/en/function.strtr.php
822822
.. _`ISO 31-11`: http://en.wikipedia.org/wiki/Interval_%28mathematics%29#The_ISO_notation
823-
.. _`Translatable Extension`: https://github.com/l3pp4rd/DoctrineExtensions
823+
.. _`Translatable Extension`: https://github.com/l3pp4rd/DoctrineExtensions

0 commit comments

Comments
 (0)