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 2020-10-06 21:35:18 +02:00 committed by Sunil Mohan Adapa
parent e03161201c
commit d1f9f4bfcc
No known key found for this signature in database
GPG Key ID: 43EA1CFF0AA7C5F2
2 changed files with 8 additions and 5 deletions

View File

@ -9,8 +9,10 @@ import subprocess
import threading import threading
from django.utils.translation import ugettext as _ from django.utils.translation import ugettext as _
from django.utils.translation import ugettext_lazy
from plinth import actions from plinth import actions
from plinth.utils import format_lazy
logger = logging.getLogger(__name__) logger = logging.getLogger(__name__)
@ -153,13 +155,14 @@ class Transaction(object):
status_map = { status_map = {
'pmstatus': 'pmstatus':
_('installing'), ugettext_lazy('installing'),
'dlstatus': 'dlstatus':
_('downloading'), ugettext_lazy('downloading'),
'media-change': 'media-change':
_('media change'), ugettext_lazy('media change'),
'pmconffile': '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.status_string = status_map.get(parts[0], '')
self.percentage = int(float(parts[2])) self.percentage = int(float(parts[2]))

View File

@ -47,7 +47,7 @@
This application is currently not available in your distribution. This application is currently not available in your distribution.
{% endblocktrans %} {% endblocktrans %}
<button type="submit" class="btn btn-default btn-sm" name="refresh-packages"> <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> </button>
</div> </div>
{% endif %} {% endif %}