forked from WeblateOrg/weblate
/
translate.html
199 lines (186 loc) · 7.12 KB
/
translate.html
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
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
{% extends "base.html" %}
{% load url from future %}
{% load i18n %}
{% load weblate %}
{% block breadcums %}
<li><a href="{{ unit.translation.subproject.project.get_absolute_url }}">{{ unit.translation.subproject.project }}</a></li>
<li><a href="{{ unit.translation.subproject.get_absolute_url }}">{{ unit.translation.subproject.name }}</a></li>
<li><a href="{{ unit.translation.get_absolute_url }}">{{ unit.translation.language }}</a></li>
<li><a href="{{ unit.translation.get_translate_url }}">{% trans "translate" %}</a></li>
{% endblock %}
{% block content %}
<h2>{% trans "Translate" %}</h2>
<p>{% blocktrans with unit.position as position %}Showing string {{ position }} out of {{ total }}.{% endblocktrans %}
<span class="navi">
<a class="button-first" href="{{ unit.translation.get_translate_url }}?type={{ type }}&pos=1&dir=stay{{ search_url }}">{% trans "First" %}</a>
<a class="button-prev" href="{{ unit.translation.get_translate_url }}?type={{ type }}&pos={{ unit.position }}&dir=back{{ search_url }}">{% trans "Previous" %}</a>
<a class="button-next" href="{{ unit.translation.get_translate_url }}?type={{ type }}&pos={{ unit.position }}{{ search_url }}">{% trans "Next" %}</a>
<a class="button-end" href="{{ unit.translation.get_translate_url }}?type={{ type }}&pos={{ total }}&dir=stay{{ search_url }}">{% trans "Last" %}</a>
</span>
</p>
{% if search_query %}
<p>{% blocktrans %}Searching for "{{ search_query }}".{% endblocktrans %}</p>
{% endif %}
<form action="{{ unit.translation.get_translate_url }}" method="post">
{% csrf_token %}
<input type="hidden" name="type" value="{{ type }}" />
<input type="hidden" name="pos" value="{{ unit.position }}" />
<input type="hidden" name="q" value="{{ search_query }}" />
<input type="hidden" name="exact" value="{{ search_exact }}" />
<input type="hidden" name="src" value="{{ search_source }}" />
<input type="hidden" name="tgt" value="{{ search_target }}" />
<input type="hidden" name="ctx" value="{{ search_context }}" />
<table class="translator">
{% if secondary %}
{% for unit in secondary %}
<tr>
<th class="source">{{ unit.translation.language }}</th>
<td class="translatetext">{{ unit.target|fmttranslation:unit.translation.language }}</td>
</tr>
{% endfor %}
{% endif %}
<tr>
<th class="source">{% trans "Source" %}</th>
<td class="translatetext">{{ unit.source|fmttranslation }}</td>
</tr>
{% if unit.context %}
<tr>
<th>{% trans "Context" %}</th>
<td>{{ unit.context }}</td>
</tr>
{% endif %}
<tr>
<td></td>
<td class="toolbar"><a href="#" id="copy-text">{% trans "Copy" %}</a><img src="/media/loading.gif" id="loading" style="display: none" /></td>
</tr>
<tr>
<th>{% if unit.is_plural %}{% trans "Translations" %}{% else %}{% trans "Translation" %}{% endif %}</th>
<td class="translator">
{{ form.checksum }}
{{ form.target }}
<br />
{{ form.fuzzy }}<label for="id_fuzzy">{% trans "Fuzzy" %}</label>
</td></tr>
{% with unit.active_checks as checks %}
{% if checks %}
<tr>
<th>{% trans "Failing checks" %}</th>
<td>
{% for check in checks %}
<span class="check" id="check-{{ check.id }}">
{% if perms.trans.ignore_check %}
<a href="#" class="ignorecheck" title="{% blocktrans with check.get_check_display as check %}Ignore: {{ check }}{% endblocktrans %}"></a>
{% endif %}
<a href="{{ check.get_doc_url }}" title="{{ check.get_description }}">{{ check.get_check_display }}</a>
</span>
{% endfor %}
</td>
</tr>
{% endif %}
{% endwith %}
{% with unit.suggestions as suggestions %}
{% if suggestions %}
<tr>
<th>{% trans "Suggestions" %}</th>
<td class="suggestions">
<table>
{% for suggestion in suggestions %}
<tr><td class="translatetext">{{ suggestion.target|fmttranslation:unit.translation.language }}</td></tr>
<tr><td>
{% if suggestion.user %}
{% blocktrans with suggestion.user.get_full_name as user %}Suggested by {{ user }}{% endblocktrans %}
{% else %}
{% trans "Suggested by anonymous user" %}
{% endif %}
{% if perms.trans.accept_suggestion or perms.trans.delete_suggestion %}
<div class="suggestionactions">
{% if perms.trans.accept_suggestion %}
<a href="{{ suggestion.get_translate_url }}?type={{ type }}&pos={{ unit.position }}&accept={{ suggestion.id }}{{ search_url }}" class="sug-accept">Accept</a>
{% endif %}
{% if perms.trans.delete_suggestion %}
<a href="{{ suggestion.get_translate_url }}?type={{ type }}&pos={{ unit.position }}&delete={{ suggestion.id }}{{ search_url }}" class="sug-delete">Delete</a>
{% endif %}
</div>
{% endif %}
</td>
{% endfor %}
</table>
</td>
</tr>
{% endif %}
{% endwith %}
{% if unit.location %}
<tr>
<th>{% trans "Used in" %}</th>
<td>{{ unit.get_location_links }}</td>
</tr>
{% endif %}
{% if unit.comment %}
<tr>
<th>{% trans "Comments" %}</th>
<td>{{ unit.comment }}</td>
</tr>
{% endif %}
{% if unit.flags %}
<tr>
<th>{% trans "Flags" %}</th>
<td>{{ unit.flags }}</td>
</tr>
{% endif %}
<tr><td></td><td>
{% if perms.trans.save_translation %}
<input class="button" type="submit" value="{% trans "Save" %}" name="save" />
{% else %}
{% url 'django.contrib.auth.views.login' as login_url %}
{% with unit.translation.get_translate_url as translate_url %}
{% blocktrans %}<a href="{{ login_url }}?next={{ translate_url }}">Log in</a> for saving translations.{% endblocktrans %}
{% endwith %}
{% endif %}
<input class="button" type="submit" value="{% trans "Suggest" %}" name="suggest" />
</td></tr>
</table>
</form>
<h2>{% trans "Translation context" %}</h2>
<div class="tabs">
<ul>
<li><a href="#tab-nearby" title="{% trans "Messages placed around this one" %}">{% trans "Nearby messages" %}</a></li>
<li><a href="/js/similar/{{ unit.id }}/" title="{% trans "Similar messages" %}">{% trans "Similar messages" %}</a></li>
<li><a href="/js/other/{{ unit.id }}/?type={{ type }}&pos={{ unit.position }}{{ search_url }}" title="{% trans "Same message used in different subprojects" %}">{% trans "All locations" %}</a></li>
<li><a href="/js/dictionary/{{ unit.id }}/" title="{% trans "Words extracted from dictionary" %}">{% trans "Words in dictionary" %}</a></li>
<li><a href="#tab-changes" title="{% trans "List of recent changes done in Weblate" %}">{% trans "Recent edits" %}</a></li>
<li><a href="#tab-project" title="{% trans "Information about project" %}">{% trans "Project" %}</a></li>
</ul>
<div id="tab-nearby">
<table>
<thead>
<tr><th>{% trans "Source" %}</th><th>{% trans "Translation" %}</th></tr>
</thead>
<tbody>
{% for item in unit.nearby %}
<tr>
<td class="translatetext"><a href="{{ item.get_absolute_url }}">{{ item.source|fmttranslation }}</a></td>
<td class="translatetext"><a href="{{ item.get_absolute_url }}">{{ item.target|fmttranslation:unit.translation.language }}</a></td>
</tr>
{% endfor %}
</tbody>
</table>
</div>
<div id="tab-changes">
{% if changes %}
<table>
{% for change in changes %}
<tr>
<td>{{ change.user.get_full_name }}</td>
<td>{{ change.timestamp|date:"DATETIME_FORMAT" }}</td>
</tr>
{% endfor %}
</table>
{% else %}
<p>{% trans "No recent activity has been recorded." %}</p>
{% endif %}
</div>
<div id="tab-project">
{% include "translation_info.html" %}
</div>
</div>
{% endblock %}