File tree 1 file changed +9
-2
lines changed
1 file changed +9
-2
lines changed Original file line number Diff line number Diff line change @@ -147,7 +147,7 @@ filters or accessing object attributes. You can't do that within the ``{%
147
147
blocktrans %} `` block, so you need to bind the expression to a local variable
148
148
first::
149
149
150
- {% blocktrans with revision.created_date|timesince as timesince %}
150
+ {% blocktrans trimmed with revision.created_date|timesince as timesince %}
151
151
{{ revision }} {{ timesince }} ago
152
152
{% endblocktrans %}
153
153
@@ -157,13 +157,20 @@ first::
157
157
counter with the name ``count `` and provide a plural translation after the ``{%
158
158
plural %} `` tag::
159
159
160
- {% blocktrans with amount=article.price count years=i.length %}
160
+ {% blocktrans trimmed with amount=article.price count years=i.length %}
161
161
That will cost $ {{ amount }} per year.
162
162
{% plural %}
163
163
That will cost $ {{ amount }} per {{ years }} years.
164
164
{% endblocktrans %}
165
165
166
166
167
+ .. note ::
168
+
169
+ The previous multi-lines examples also use the ``trimmed `` option.
170
+ This remove newline characters and replace any whitespace at the beginning and end of a line,
171
+ helping translators when translating these strings.
172
+
173
+
167
174
Strings in Python
168
175
-----------------
169
176
You can’t perform that action at this time.
0 commit comments