Switch to Django i18n for code strings

Django i18n layer is on top of gettext and provide may crucial features
such as per-request locales, lazy translations etc.
This commit is contained in:
Sunil Mohan Adapa committed 2015-11-13 22:08:43 +05:30
1 parent 02cd89b60d
commit 3df1a88824
65 files changed
+302 -289

No files matched your search

+1 -1
View File
@@ -19,7 +19,7 @@
Plinth module to configure system date and time
"""
from gettext import gettext as _
from django.utils.translation import ugettext_lazy as _
import subprocess
from plinth import actions
+1 -1
View File
@@ -20,7 +20,7 @@ Forms for configuring date and time
"""
from django import forms
from gettext import gettext as _
from django.utils.translation import ugettext_lazy as _
import glob
import re
+3 -3
View File
@@ -21,7 +21,7 @@ Plinth module for configuring date and time
from django.contrib import messages
from django.template.response import TemplateResponse
from gettext import gettext as _
from django.utils.translation import ugettext as _
import logging
from .forms import DateTimeForm
@@ -90,8 +90,8 @@ def _apply_changes(request, old_status, new_status):
try:
actions.superuser_run('timezone-change', [new_status['time_zone']])
except Exception as exception:
messages.error(request, _('Error setting time zone: %s') %
exception)
messages.error(request, _('Error setting time zone: {exception}')
.format(exception=exception))
else:
messages.success(request, _('Time zone set'))