Commit 563cb484 authored by Michal Čihař's avatar Michal Čihař

Show which file format is current

Fixes #1037
Signed-off-by: default avatarMichal Čihař <michal@cihar.com>
parent a89c1f78
{% load i18n %}
<li><a href="{% url 'download_translation' project=object.subproject.project.slug subproject=object.subproject.slug lang=object.language.code %}" title="{% trans "Download for an offline translation." %}">{% trans "Download original translation file" %}</a></li>
<li><a href="{% url 'download_translation' project=object.subproject.project.slug subproject=object.subproject.slug lang=object.language.code %}" title="{% trans "Download for an offline translation." %}">{% blocktrans with object.subproject.file_format_name as format %}Download original translation file ({{format}}){% endblocktrans %}</a></li>
<li><a href="{% url 'download_translation_format' project=object.subproject.project.slug subproject=object.subproject.slug lang=object.language.code fmt='xliff'%}" title="{% trans "Download for an offline translation." %}">{% trans "Download translation as XLIFF" %}</a></li>
<li><a href="{% url 'download_translation_format' project=object.subproject.project.slug subproject=object.subproject.slug lang=object.language.code fmt='xliff12'%}" title="{% trans "Download for an offline translation." %}">{% trans "Download translation as XLIFF 1.2" %}</a></li>
<li><a href="{% url 'download_translation_format' project=object.subproject.project.slug subproject=object.subproject.slug lang=object.language.code fmt='po'%}" title="{% trans "Download for an offline translation." %}">{% trans "Download translation as Gettext PO" %}</a></li>
......
......@@ -1372,6 +1372,10 @@ class SubProject(models.Model, PercentMixin, URLMixin, PathMixin):
"""Checks whether there is something to push to remote repository"""
return self.repository.needs_push()
@property
def file_format_name(self):
return self.file_format_cls.name
@property
def file_format_cls(self):
"""Returns file format object """
......
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