Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Example and note with usage of trimmed option in blocktrans #4479

Merged
merged 2 commits into from
Aug 22, 2018
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 9 additions & 2 deletions docs/i18n.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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 %}

Expand All @@ -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,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

removes ... replaces

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

3 sentences, 2 mistakes. At least is not 3/3. I'm improving my skills 😝

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Language is hard. :)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn’t it be "multi-line examples", (without the s after line), though ?

(Not 100% sure)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Uh, yes, it should. 😅

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK! I reached the best score: 3/3 🥇

Thanks!

helping translators when translating these strings.


Strings in Python
-----------------

Expand Down