Commit 76ae4fd7 authored by Weblate's avatar Weblate

Merge remote-tracking branch 'origin/master'

parents 7e4a7e85 a2124648
......@@ -57,22 +57,22 @@
{% csrf_token %}
{% if antispam %}<div id="s_content">{{ antispam|crispy }}</div>{% endif %}
{% if secondary %}
{% for unit in secondary %}
{% for secondary_unit in secondary %}
<div class="form-group">
<label>{{ unit.translation.language }}</label>
{% format_translation unit.target unit.translation.language %}
<label>{{ secondary_unit.translation.language }}</label>
{% format_translation secondary_unit.target secondary_unit.translation.language %}
</div>
{% endfor %}
{% endif %}
{% if unit.previous_source and unit.fuzzy %}
<div class="form-group">
<label>{% trans "Source change" %}</label>
{% format_translation unit.source unit.translation.language unit.previous_source %}
{% format_translation unit.source diff=unit.previous_source num_plurals=unit.translation.language.nplurals %}
</div>
{% endif %}
<div class="form-group">
<label>{% trans "Source" %}</label>
{% format_translation unit.source search_match=search_query %}
{% format_translation unit.source search_match=search_query num_plurals=unit.translation.language.nplurals %}
</div>
{{ form|crispy }}
</div>
......
......@@ -78,7 +78,7 @@ def fmt_whitespace(value):
@register.inclusion_tag('format-translation.html')
def format_translation(value, language=None, diff=None, search_match=None,
simple=False):
simple=False, num_plurals=2):
"""
Nicely formats translation text possibly handling plurals or diff.
"""
......@@ -89,6 +89,10 @@ def format_translation(value, language=None, diff=None, search_match=None,
# Split plurals to separate strings
plurals = split_plural(value)
# Show plurals?
if num_plurals > 1:
plurals = plurals[:1]
# Newline concatenator
newline = u'<span class="hlspace" title="{0}">↵</span><br />'.format(
_('New line')
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment