From d1f9f4bfcc415cde0b883a3ba8feec882ed5eef9 Mon Sep 17 00:00:00 2001 From: Fioddor Superconcentrado Date: Tue, 6 Oct 2020 21:35:18 +0200 Subject: [PATCH] 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 [sunil: Mark remaining to status strings also] Signed-off-by: Sunil Mohan Adapa Reviewed-by: Sunil Mohan Adapa --- plinth/package.py | 11 +++++++---- plinth/templates/setup.html | 2 +- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/plinth/package.py b/plinth/package.py index a61fb5ed1..f354568ef 100644 --- a/plinth/package.py +++ b/plinth/package.py @@ -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])) diff --git a/plinth/templates/setup.html b/plinth/templates/setup.html index 9b85b7981..af16c28ee 100644 --- a/plinth/templates/setup.html +++ b/plinth/templates/setup.html @@ -47,7 +47,7 @@ This application is currently not available in your distribution. {% endblocktrans %} {% endif %}