diff --git a/html/translate.html b/html/translate.html index 1105feb1f..d9e9ed5c3 100644 --- a/html/translate.html +++ b/html/translate.html @@ -5,6 +5,8 @@ {% include "translation_info.html" %} +

{% trans "Translate" %}

+ {% endblock %} diff --git a/trans/views.py b/trans/views.py index e860f89bd..a6f050681 100644 --- a/trans/views.py +++ b/trans/views.py @@ -37,9 +37,22 @@ def translate(request, project, subproject, lang): except: offset = 0 units = obj.unit_set.filter_type(rqtype) + total = units.count() + if offset >= total: + offset = total - 1 + nextoffset = offset + 1 + if nextoffset >= total: + nextoffset = None + prevoffset = offset - 1 + if prevoffset < 0: + prevoffset = None return render_to_response('translate.html', RequestContext(request, { 'object': obj, 'title': '%s @ Weblate' % (obj.__unicode__()), 'unit': units[offset], + 'total': total, + 'offset': offset, + 'prevoffset': prevoffset, + 'nextoffset': nextoffset, }))