Skip to content

Commit df18348

Browse files
committed
added a note about escaping % in a string to translate
1 parent 87a54f7 commit df18348

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

book/translation.rst

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -708,6 +708,11 @@ The ``transchoice`` tag automatically gets the ``%count%`` variable from
708708
the current context and passes it to the translator. This mechanism only
709709
works when you use a placeholder following the ``%var%`` pattern.
710710

711+
.. tip::
712+
713+
If you need to use the percent character (``%``) in a string, escape it by
714+
doubling it: ``{% trans %}Percent: %percent%%%{% endtrans %}``
715+
711716
You can also specify the message domain and pass some additional variables:
712717

713718
.. code-block:: jinja

0 commit comments

Comments
 (0)