summaryrefslogtreecommitdiff
path: root/tests/i18n/commands/templates/test.html
blob: e7f7ba93eb5a83c79661326b9e957564f6ad6413 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
{% load i18n %}
{% comment %}Translators: Django comment block for translators
string's meaning unveiled
{% endcomment %}
{% trans "This literal should be included." %}
{% trans "This literal should also be included wrapped or not wrapped depending on the use of the --no-wrap option." %}

{% comment %}Some random comment
Some random comment
Translators: One-line translator comment #1
{% endcomment %}
{% trans "Translatable literal #1a" %}

{% comment %}Some random comment
Some random comment
Translators: Two-line translator comment #1
continued here.
{% endcomment %}
{% trans "Translatable literal #1b" %}

{% comment %}Some random comment
Translators: One-line translator comment #2
{% endcomment %}
{% trans "Translatable literal #2a" %}

{% comment %}Some random comment
Translators: Two-line translator comment #2
continued here.
{% endcomment %}
{% trans "Translatable literal #2b" %}

{% comment %}
    Translators: One-line translator comment #3
{% endcomment %}
{% trans "Translatable literal #3a" %}

{% comment %}
Translators: Two-line translator comment #3
continued here.
{% endcomment %}
{% trans "Translatable literal #3b" %}

{% comment %} Translators: One-line translator comment #4{% endcomment %}
{% trans "Translatable literal #4a" %}

{% comment %}  Translators: Two-line translator comment #4
continued here.{% endcomment %}
{% trans "Translatable literal #4b" %}

{% comment %} Translators: One-line translator comment #5 -- with non ASCII characters: áéíóúö{% endcomment %}
{% trans "Translatable literal #5a" %}

{% comment %}  Translators: Two-line translator comment #5 -- with non ASCII characters: áéíóúö
continued here.{% endcomment %}
{% trans "Translatable literal #6b" %}

{% trans "Translatable literal #7a" context "Special trans context #1" %}
{% trans "Translatable literal #7b" as var context "Special trans context #2" %}
{% trans "Translatable literal #7c" context "Special trans context #3" as var %}

{% trans "Translatable literal #7.1a" | upper context "context #7.1a" %}
{% trans "Translatable literal #7.1b" |upper as var context "context #7.1b" %}
{% trans "Translatable literal #7.1c"| upper context "context #7.1c" as var %}

{% trans "Translatable literal #7.1d"|add:" foo" context "context #7.1d" %}
{% trans "Translatable literal #7.1e"|add:' ûè本' as var context "context #7.1e" %}
{% with foo=" foo" %}
    {% trans "Translatable literal #7.1f"|add:foo context "context #7.1f" as var %}
{% endwith %}
{% trans "Translatable literal #7.1g"|add:2 context "context #7.1g" as var %}
{% trans "Translatable literal #7.1h" | add:"foo" | add:2 context "context #7.1h" as var %}

{% blocktrans context "Special blocktrans context #1" %}Translatable literal #8a{% endblocktrans %}
{% blocktrans count 2 context "Special blocktrans context #2" %}Translatable literal #8b-singular{% plural %}Translatable literal #8b-plural{% endblocktrans %}
{% blocktrans context "Special blocktrans context #3" count 2 %}Translatable literal #8c-singular{% plural %}Translatable literal #8c-plural{% endblocktrans %}
{% blocktrans with a=1 context "Special blocktrans context #4" %}Translatable literal #8d {{ a }}{% endblocktrans %}

{% trans "Translatable literal with context wrapped in single quotes" context 'Context wrapped in single quotes' as var %}
{% trans "Translatable literal with context wrapped in double quotes" context "Context wrapped in double quotes" as var %}
{% 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 %}


{# BasicExtractorTests.test_blocktrans_trimmed #}
{% blocktrans %}
  Text with a few
  line breaks.
{% endblocktrans %}
{% blocktrans trimmed %}
  Again some text with a few
  line breaks, this time
  should be trimmed.
{% endblocktrans %}
{% trans "Get my line number" %}

{% blocktrans trimmed count counter=mylist|length %}
First `trans`, then `blocktrans` with a plural
{% plural %}
Plural for a `trans` and `blocktrans` collision case
{% endblocktrans %}

{% trans "Non-breaking space :" %}