package: i18n: Mark progress status strings for translation

Help: #1938.

- package.py: ugettext_lazy applied to 'installing', 'downloading' and other
statuses.
- setup.html: trans function applied to "Check again" in template.

Signed-off-by: Fioddor Superconcentrado <fioddor@gmail.com>
[sunil: Mark remaining to status strings also]
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
This commit is contained in:
Fioddor Superconcentrado authored and Sunil Mohan Adapa committed 2020-10-20 11:56:57 -07:00
1 parent e03161201c
commit d1f9f4bfcc
2 files changed
+8 -5

No files matched your search

+7 -4
View File
@@ -9,8 +9,10 @@ import subprocess
import threading
from django.utils.translation import ugettext as _
from django.utils.translation import ugettext_lazy
from plinth import actions
from plinth.utils import format_lazy
logger = logging.getLogger(__name__)
@@ -153,13 +155,14 @@ class Transaction(object):
status_map = {
'pmstatus':
_('installing'),
ugettext_lazy('installing'),
'dlstatus':
_('downloading'),
ugettext_lazy('downloading'),
'media-change':
_('media change'),
ugettext_lazy('media change'),
'pmconffile':
_('configuration file: {file}').format(file=parts[1]),
format_lazy(ugettext_lazy('configuration file: {file}'),
file=parts[1]),
}
self.status_string = status_map.get(parts[0], '')
self.percentage = int(float(parts[2]))
+1 -1
View File
@@ -47,7 +47,7 @@
This application is currently not available in your distribution.
{% endblocktrans %}
<button type="submit" class="btn btn-default btn-sm" name="refresh-packages">
<span class="fa fa-refresh"></span> Check again
<span class="fa fa-refresh"></span> {% trans "Check again" %}
</button>
</div>
{% endif %}