mirror of
https://github.com/freedombox/FreedomBox.git
synced 2026-11-29 08:25:10 +00:00
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:
1 parent
02cd89b60d
commit
3df1a88824
65 files changed
+302
-289
No files matched your search
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
@@ -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'))
|
||||
|
||||
|
||||
Reference in new issue
Block a user