mirror of
https://github.com/freedombox/FreedomBox.git
synced 2026-09-19 04:59:01 +00:00
Internationalize names module.
This commit is contained in:
parent
e0bfd1401f
commit
d476326212
@ -19,7 +19,7 @@
|
|||||||
Plinth module to configure name services
|
Plinth module to configure name services
|
||||||
"""
|
"""
|
||||||
|
|
||||||
from gettext import gettext as _
|
from django.utils.translation import ugettext as _, ugettext_lazy
|
||||||
import logging
|
import logging
|
||||||
|
|
||||||
from plinth import cfg
|
from plinth import cfg
|
||||||
@ -27,9 +27,9 @@ from plinth.signals import domain_added, domain_removed
|
|||||||
|
|
||||||
|
|
||||||
SERVICES = [
|
SERVICES = [
|
||||||
('http', _('HTTP'), 80),
|
('http', ugettext_lazy('HTTP'), 80),
|
||||||
('https', _('HTTPS'), 443),
|
('https', ugettext_lazy('HTTPS'), 443),
|
||||||
('ssh', _('SSH'), 22),
|
('ssh', ugettext_lazy('SSH'), 22),
|
||||||
]
|
]
|
||||||
|
|
||||||
depends = ['plinth.modules.system']
|
depends = ['plinth.modules.system']
|
||||||
@ -43,7 +43,8 @@ logger = logging.getLogger(__name__)
|
|||||||
def init():
|
def init():
|
||||||
"""Initialize the names module."""
|
"""Initialize the names module."""
|
||||||
menu = cfg.main_menu.get('system:index')
|
menu = cfg.main_menu.get('system:index')
|
||||||
menu.add_urlname(_('Name Services'), 'glyphicon-th', 'names:index', 19)
|
menu.add_urlname(ugettext_lazy('Name Services'), 'glyphicon-th',
|
||||||
|
'names:index', 19)
|
||||||
|
|
||||||
domain_added.connect(on_domain_added)
|
domain_added.connect(on_domain_added)
|
||||||
domain_removed.connect(on_domain_removed)
|
domain_removed.connect(on_domain_removed)
|
||||||
|
|||||||
@ -19,10 +19,11 @@
|
|||||||
{% endcomment %}
|
{% endcomment %}
|
||||||
|
|
||||||
{% load bootstrap %}
|
{% load bootstrap %}
|
||||||
|
{% load i18n %}
|
||||||
|
|
||||||
{% block content %}
|
{% block content %}
|
||||||
|
|
||||||
<h2>Name Services</h2>
|
<h2>{{ title }}</h2>
|
||||||
|
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-sm-5">
|
<div class="col-sm-5">
|
||||||
@ -47,9 +48,9 @@
|
|||||||
{% for service in name_service.services_enabled %}
|
{% for service in name_service.services_enabled %}
|
||||||
<td>
|
<td>
|
||||||
{% if service %}
|
{% if service %}
|
||||||
<span class="label label-success">Enabled</span>
|
<span class="label label-success">{% trans "Enabled" %}</span>
|
||||||
{% else %}
|
{% else %}
|
||||||
<span class="label label-warning">Disabled<span>
|
<span class="label label-warning">{% trans "Disabled" %}</span>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
</td>
|
</td>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
|
|||||||
@ -20,7 +20,7 @@ Plinth module for name services
|
|||||||
"""
|
"""
|
||||||
|
|
||||||
from django.template.response import TemplateResponse
|
from django.template.response import TemplateResponse
|
||||||
from gettext import gettext as _
|
from django.utils.translation import ugettext as _
|
||||||
|
|
||||||
from . import SERVICES, get_domain_types, get_description
|
from . import SERVICES, get_domain_types, get_description
|
||||||
from . import get_domain, get_services_status
|
from . import get_domain, get_services_status
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user