From fdbb9300dae11200c2bfa1735a1523db32baa7e8 Mon Sep 17 00:00:00 2001 From: Manuel Kaufmann Date: Mon, 6 Aug 2018 12:35:29 -0300 Subject: [PATCH 1/2] Example and note with usage of trimmed option in blocktrans --- docs/i18n.rst | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/docs/i18n.rst b/docs/i18n.rst index cca997b8cad..11cf00922b7 100644 --- a/docs/i18n.rst +++ b/docs/i18n.rst @@ -147,7 +147,7 @@ filters or accessing object attributes. You can't do that within the ``{% blocktrans %}`` block, so you need to bind the expression to a local variable first:: - {% blocktrans with revision.created_date|timesince as timesince %} + {% blocktrans trimmed with revision.created_date|timesince as timesince %} {{ revision }} {{ timesince }} ago {% endblocktrans %} @@ -157,13 +157,20 @@ first:: counter with the name ``count`` and provide a plural translation after the ``{% plural %}`` tag:: - {% blocktrans with amount=article.price count years=i.length %} + {% blocktrans trimmed with amount=article.price count years=i.length %} That will cost $ {{ amount }} per year. {% plural %} That will cost $ {{ amount }} per {{ years }} years. {% endblocktrans %} +.. note:: + + The previous multi-lines examples also use the ``trimmed`` option. + This remove newline characters and replace any whitespace at the beginning and end of a line, + helping translators when translating these strings. + + Strings in Python ----------------- From 2159b2049a3bfcd497f921e62b97ea32c644f2d0 Mon Sep 17 00:00:00 2001 From: Manuel Kaufmann Date: Tue, 7 Aug 2018 19:24:28 -0300 Subject: [PATCH 2/2] Correct usage of the verb tense --- docs/i18n.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/i18n.rst b/docs/i18n.rst index 11cf00922b7..8a82b8c3c76 100644 --- a/docs/i18n.rst +++ b/docs/i18n.rst @@ -167,7 +167,7 @@ plural %}`` tag:: .. note:: The previous multi-lines examples also use the ``trimmed`` option. - This remove newline characters and replace any whitespace at the beginning and end of a line, + This removes newline characters and replaces any whitespace at the beginning and end of a line, helping translators when translating these strings.