Commit 2f458789 authored by Michal Čihař's avatar Michal Čihař

Display source change (issue #74)

parent 84be24e3
......@@ -61,6 +61,12 @@
<th class="source">{% trans "Source" %}</th>
<td class="translatetext">{{ unit.source|fmttranslation }}</td>
</tr>
{% if unit.previous_source %}
<tr>
<th>{% trans "Source change" %}</th>
<td>{{ unit.previous_source|fmtsourcediff:unit }}</td>
</tr>
{% endif %}
{% if unit.context %}
<tr>
<th>{% trans "Context" %}</th>
......
......@@ -126,6 +126,15 @@ def fmttranslationdiff(value, other):
return fmttranslation(value, other.translation.language, other.target)
@register.filter
@stringfilter
def fmtsourcediff(value, other):
'''
Formats diff between two sources.
'''
return fmttranslation(other.source, diff=value)
@register.filter
@stringfilter
def site_title(value):
......
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