1
0
mirror of https://github.com/django/django.git synced 2025-10-31 09:41:08 +00:00

Fixed #30585 -- Added {% translate %} and {% blocktranslate %} template tags.

This commit is contained in:
Mike Hansen
2019-06-21 09:41:01 -07:00
committed by Mariusz Felisiak
parent 70d95682b1
commit d291c72bf2
14 changed files with 346 additions and 175 deletions

View File

@@ -85,9 +85,11 @@ continued here.{% endcomment %}
{% blocktrans context 'Special blocktrans context wrapped in single quotes' %}Translatable literal with context wrapped in single quotes{% endblocktrans %}
{% blocktrans context "Special blocktrans context wrapped in double quotes" %}Translatable literal with context wrapped in double quotes{% endblocktrans %}
{% blocktranslate %}blocktranslate text{% endblocktranslate %}
{% translate "translate text" %}
{# BasicExtractorTests.test_blocktrans_trimmed #}
{% blocktrans %}
{# BasicExtractorTests.test_blocktranslate_trimmed #}
{% blocktranslate %}
Text with a few
line breaks.
{% endblocktrans %}
@@ -98,10 +100,10 @@ continued here.{% endcomment %}
{% endblocktrans %}
{% trans "Get my line number" %}
{% blocktrans trimmed count counter=mylist|length %}
First `trans`, then `blocktrans` with a plural
{% blocktranslate trimmed count counter=mylist|length %}
First `translate`, then `blocktranslate` with a plural
{% plural %}
Plural for a `trans` and `blocktrans` collision case
{% endblocktrans %}
Plural for a `translate` and `blocktranslate` collision case
{% endblocktranslate %}
{% trans "Non-breaking space :" %}