mirror of
https://github.com/jwinterm/modoboa.git
synced 2026-12-02 12:13:54 +01:00
wip: UI refactoring
* translation files update * various fixes see #204
This commit is contained in:
@@ -2,9 +2,8 @@
|
||||
"""
|
||||
Amavis quarantine manager (SQL based)
|
||||
|
||||
|
||||
"""
|
||||
from django.utils.translation import ugettext_noop as _, ugettext
|
||||
from django.utils.translation import ugettext as _, ugettext_lazy
|
||||
from django.core.urlresolvers import reverse
|
||||
from django.template import Template, Context
|
||||
from modoboa.lib import events, parameters
|
||||
@@ -15,7 +14,7 @@ def infos():
|
||||
return {
|
||||
"name" : "Amavis quarantine",
|
||||
"version" : "1.0",
|
||||
"description" : ugettext("Simple amavis quarantine management tool"),
|
||||
"description" : _("Simple amavis quarantine management tool"),
|
||||
"url" : "quarantine"
|
||||
}
|
||||
|
||||
@@ -53,28 +52,28 @@ def load():
|
||||
parameters.register_admin("AM_PDP_MODE", type="list",
|
||||
deflt="unix",
|
||||
values=[("inet", "inet"), ("unix", "unix")],
|
||||
help=_("Mode used to access the PDP server"))
|
||||
help=ugettext_lazy("Mode used to access the PDP server"))
|
||||
parameters.register_admin("AM_PDP_HOST", type="string",
|
||||
deflt="localhost",
|
||||
help=_("PDP server address (if inet mode)"))
|
||||
help=ugettext_lazy("PDP server address (if inet mode)"))
|
||||
parameters.register_admin("AM_PDP_PORT", type="int",
|
||||
deflt=9998,
|
||||
help=_("PDP server port (if inet mode)"))
|
||||
help=ugettext_lazy("PDP server port (if inet mode)"))
|
||||
parameters.register_admin("AM_PDP_SOCKET", type="string",
|
||||
deflt=_("/var/amavis/amavisd.sock"),
|
||||
help=_("Path to the PDP server socket (if unix mode)"))
|
||||
deflt="/var/amavis/amavisd.sock",
|
||||
help=ugettext_lazy("Path to the PDP server socket (if unix mode)"))
|
||||
parameters.register_admin("CHECK_REQUESTS_INTERVAL", type="int",
|
||||
deflt=30,
|
||||
help=_("Interval between two release requests checks"))
|
||||
help=ugettext_lazy("Interval between two release requests checks"))
|
||||
parameters.register_admin("USER_CAN_RELEASE", type="list_yesno", deflt="no",
|
||||
help=_("Allow users to directly release their messages"))
|
||||
help=ugettext_lazy("Allow users to directly release their messages"))
|
||||
parameters.register_admin("SELF_SERVICE", type="list_yesno", deflt="no",
|
||||
help=_("Activate the 'self-service' mode"))
|
||||
help=ugettext_lazy("Activate the 'self-service' mode"))
|
||||
|
||||
parameters.register_user(
|
||||
"MESSAGES_PER_PAGE", type="int", deflt=40,
|
||||
label="Number of displayed emails per page",
|
||||
help=_("Sets the maximum number of messages displayed in a page")
|
||||
help=ugettext_lazy("Sets the maximum number of messages displayed in a page")
|
||||
)
|
||||
|
||||
def destroy():
|
||||
@@ -88,9 +87,8 @@ def menu(target, user):
|
||||
if target == "top_menu":
|
||||
return [
|
||||
{"name" : "quarantine",
|
||||
"label" : ugettext("Quarantine"),
|
||||
"url" : reverse('modoboa.extensions.amavis_quarantine.views.index'),
|
||||
"img" : static_url("pics/quarantine.png")}
|
||||
"label" : _("Quarantine"),
|
||||
"url" : reverse('modoboa.extensions.amavis_quarantine.views.index')}
|
||||
]
|
||||
return []
|
||||
|
||||
@@ -133,7 +131,7 @@ $(document).ready(function() {
|
||||
success_cb: function(data) {
|
||||
var $link = $("#nbrequests");
|
||||
if (data.requests > 0) {
|
||||
$link.html(data.requests + " " + gettext("pending requests"));
|
||||
$link.html(data.requests + " " + "{{ text }}");
|
||||
$link.parent().removeClass('hidden');
|
||||
} else {
|
||||
$link.parent().addClass('hidden');
|
||||
@@ -144,7 +142,7 @@ $(document).ready(function() {
|
||||
</script>""")
|
||||
url = reverse("modoboa.extensions.amavis_quarantine.views.nbrequests")
|
||||
interval = int(parameters.get_admin("CHECK_REQUESTS_INTERVAL")) * 1000
|
||||
return [tpl.render(Context(dict(url=url, interval=interval)))]
|
||||
return [tpl.render(Context(dict(url=url, interval=interval, text=_("pending requests"))))]
|
||||
|
||||
@events.observe("TopNotifications")
|
||||
def display_requests(user):
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
# coding: utf-8
|
||||
|
||||
from datetime import datetime
|
||||
from django.utils.translation import ugettext as _, ugettext_noop
|
||||
from django.utils.translation import ugettext as _, ugettext_lazy
|
||||
from django.db.models import Q
|
||||
from modoboa.lib import tables
|
||||
from modoboa.lib.webutils import static_url
|
||||
@@ -20,10 +20,10 @@ class Qtable(tables.Table):
|
||||
sortable=False
|
||||
)
|
||||
rstatus = tables.ImgColumn("rstatus", width='25px')
|
||||
from_ = tables.Column("from", label=ugettext_noop("From"), limit=30)
|
||||
subject = tables.Column("subject", label=ugettext_noop("Subject"), limit=40)
|
||||
time = tables.Column("date", label=ugettext_noop("Date"))
|
||||
to = tables.Column("to", label=ugettext_noop("To"), sortable=False)
|
||||
from_ = tables.Column("from", label=ugettext_lazy("From"), limit=30)
|
||||
subject = tables.Column("subject", label=ugettext_lazy("Subject"), limit=40)
|
||||
time = tables.Column("date", label=ugettext_lazy("Date"))
|
||||
to = tables.Column("to", label=ugettext_lazy("To"), sortable=False)
|
||||
|
||||
cols_order = []
|
||||
|
||||
|
||||
@@ -7,7 +7,7 @@ The *limits* extension
|
||||
from django.contrib.auth.models import Permission, Group
|
||||
from django.db import IntegrityError
|
||||
from django.contrib.contenttypes.models import ContentType
|
||||
from django.utils.translation import ugettext_noop as _, ugettext
|
||||
from django.utils.translation import ugettext as _
|
||||
from django.core.urlresolvers import reverse
|
||||
from modoboa.lib import events
|
||||
from modoboa.lib.webutils import static_url
|
||||
@@ -52,7 +52,7 @@ def infos():
|
||||
return {
|
||||
"name" : "Limits",
|
||||
"version" : "1.0",
|
||||
"description" : ugettext("Limits for objects creation"),
|
||||
"description" : _("Per administrator resources to limit the number of objects they can create"),
|
||||
"url" : baseurl
|
||||
}
|
||||
|
||||
|
||||
+13
-12
@@ -1,24 +1,24 @@
|
||||
# coding: utf-8
|
||||
|
||||
from django import forms
|
||||
from django.utils.translation import ugettext_noop as _
|
||||
from django.utils.translation import ugettext_lazy as _
|
||||
from django.contrib.auth.models import User, Group
|
||||
from models import *
|
||||
from lib import *
|
||||
|
||||
class ResourcePoolForm(forms.Form):
|
||||
domain_admins_limit = forms.IntegerField(
|
||||
ugettext_noop("Max domain admins"),
|
||||
help_text=ugettext_noop("Maximum number of domain administrators that can be created by this user")
|
||||
label=ugettext_lazy("Domain admins"),
|
||||
help_text=ugettext_lazy("Maximum number of domain administrators this user can create")
|
||||
)
|
||||
domains_limit = forms.IntegerField(ugettext_noop("Max domains"),
|
||||
help_text=ugettext_noop("Maximum number of domains that can be created by this user"))
|
||||
domain_aliases_limit = forms.IntegerField(ugettext_noop("Max domain aliases"),
|
||||
help_text=ugettext_noop("Maximum number of domain aliases that can be created by this user"))
|
||||
mailboxes_limit = forms.IntegerField(ugettext_noop("Max mailboxes"),
|
||||
help_text=ugettext_noop("Maximum number of mailboxes that can be created by this user"))
|
||||
mailbox_aliases_limit = forms.IntegerField(ugettext_noop("Max mailbox aliases"),
|
||||
help_text=ugettext_noop("Maximum number of mailbox aliases that can be created by this user"))
|
||||
domains_limit = forms.IntegerField(label=ugettext_lazy("Domains"),
|
||||
help_text=ugettext_lazy("Maximum number of domains this user can create"))
|
||||
domain_aliases_limit = forms.IntegerField(label=ugettext_lazy("Domain aliases"),
|
||||
help_text=ugettext_lazy("Maximum number of domain aliases this user can create"))
|
||||
mailboxes_limit = forms.IntegerField(label=ugettext_lazy("Mailboxes"),
|
||||
help_text=ugettext_lazy("Maximum number of mailboxes this user can create"))
|
||||
mailbox_aliases_limit = forms.IntegerField(label=ugettext_lazy("Mailbox aliases"),
|
||||
help_text=ugettext_lazy("Maximum number of mailbox aliases this user can create"))
|
||||
|
||||
def __init__(self, *args, **kwargs):
|
||||
if kwargs.has_key("instance"):
|
||||
@@ -29,6 +29,7 @@ class ResourcePoolForm(forms.Form):
|
||||
if self.account.group != "Resellers":
|
||||
del self.fields["domain_admins_limit"]
|
||||
del self.fields["domains_limit"]
|
||||
del self.fields["domain_aliases_limit"]
|
||||
self.load_from_user(self.account)
|
||||
|
||||
def check_limit_value(self, lname):
|
||||
@@ -57,7 +58,7 @@ class ResourcePoolForm(forms.Form):
|
||||
def allocate_from_pool(self, limit, pool):
|
||||
ol = pool.get_limit(limit.name)
|
||||
if ol.maxvalue == -2:
|
||||
raise BadLimitValue(_("Your pool is not initialized yet"))
|
||||
raise BadLimitValue(_("Your resources are not initialized yet"))
|
||||
newvalue = self.cleaned_data[limit.name]
|
||||
if newvalue == -1 and ol.maxvalue != -1:
|
||||
raise BadLimitValue(_("You're not allowed to define unlimited values"))
|
||||
|
||||
@@ -20,7 +20,7 @@ class UnsifficientResource(ModoboaException):
|
||||
self.limit = limit
|
||||
|
||||
def __str__(self):
|
||||
return _("Not enough resource into your pool")
|
||||
return _("Not enough resources")
|
||||
|
||||
class BadLimitValue(ModoboaException):
|
||||
pass
|
||||
|
||||
@@ -2,15 +2,15 @@
|
||||
|
||||
from django.db import models
|
||||
from django.contrib.contenttypes import generic
|
||||
from django.utils.translation import ugettext as _, ugettext_noop
|
||||
from django.utils.translation import ugettext as _, ugettext_lazy
|
||||
from modoboa.admin.models import User
|
||||
|
||||
limits_tpl = [
|
||||
("domain_admins_limit", ugettext_noop("Domain admins")),
|
||||
("domains_limit", ugettext_noop("Domains")),
|
||||
("domain_aliases_limit", ugettext_noop("Domain aliases")),
|
||||
("mailboxes_limit", ugettext_noop("Mailboxes")),
|
||||
("mailbox_aliases_limit", ugettext_noop("Mailbox aliases"))
|
||||
("domain_admins_limit", ugettext_lazy("Domain admins")),
|
||||
("domains_limit", ugettext_lazy("Domains")),
|
||||
("domain_aliases_limit", ugettext_lazy("Domain aliases")),
|
||||
("mailboxes_limit", ugettext_lazy("Mailboxes")),
|
||||
("mailbox_aliases_limit", ugettext_lazy("Mailbox aliases"))
|
||||
]
|
||||
|
||||
class LimitsPool(models.Model):
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{% load i18n libextras %}
|
||||
<div class="well">
|
||||
<h6>{% trans "Resource usage" %}</h6>{% for l in limits %}
|
||||
<h6>{% trans "Resources usage" %}</h6>{% for l in limits %}
|
||||
<div class="resource">
|
||||
{{ l.label }} ({{ l }})
|
||||
<div rel="tooltip" title="{{ l.curvalue }}/{{ l.maxvalue }}" class="progress {% progress_color l.usage %}"><div class="bar" style="width: {{ l }}"></div></div>
|
||||
|
||||
@@ -8,7 +8,7 @@ functionality into Postfix.
|
||||
"""
|
||||
from django.conf.urls.defaults import include
|
||||
from django.core.urlresolvers import reverse
|
||||
from django.utils.translation import ugettext_noop as _, ugettext
|
||||
from django.utils.translation import ugettext as _, ugettext_lazy
|
||||
from modoboa.lib import events, parameters
|
||||
from modoboa.lib.webutils import static_url
|
||||
from models import *
|
||||
@@ -17,7 +17,7 @@ def infos():
|
||||
return {
|
||||
"name" : "Postfix autoreply",
|
||||
"version" : "1.0",
|
||||
"description" : ugettext("Auto-reply (vacation) functionality using Postfix"),
|
||||
"description" : _("Auto-reply (vacation) functionality using Postfix"),
|
||||
"url" : "postfix_autoreply"
|
||||
}
|
||||
|
||||
@@ -42,7 +42,7 @@ def load():
|
||||
parameters.register_admin(
|
||||
"AUTOREPLIES_TIMEOUT",
|
||||
type="int", deflt=86400,
|
||||
help=_("Timeout in seconds between two auto-replies to the same recipient")
|
||||
help=ugettext_lazy("Timeout in seconds between two auto-replies to the same recipient")
|
||||
)
|
||||
|
||||
def destroy():
|
||||
@@ -65,7 +65,7 @@ def menu(target, user):
|
||||
return [
|
||||
{"name" : "autoreply",
|
||||
"url" : reverse(views.autoreply),
|
||||
"label" : ugettext("Auto-reply message"),
|
||||
"label" : ugettext_lazy("Auto-reply message"),
|
||||
"modal": True,
|
||||
"modalcb" : "arform_cb"}
|
||||
]
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
# coding: utf-8
|
||||
from django.utils.translation import ugettext_noop as _, ugettext
|
||||
from django.utils.translation import ugettext as _, ugettext_lazy
|
||||
from django.core.urlresolvers import reverse
|
||||
from modoboa.lib import events, parameters
|
||||
from modoboa.lib.webutils import static_url
|
||||
@@ -12,24 +12,24 @@ def load():
|
||||
|
||||
parameters.register_admin("SERVER", type="string",
|
||||
deflt="127.0.0.1",
|
||||
help=_("Address of your MANAGESIEVE server"))
|
||||
help=ugettext_lazy("Address of your MANAGESIEVE server"))
|
||||
parameters.register_admin("PORT", type="int", deflt="2000",
|
||||
help=_("Listening port of your MANAGESIEVE server"))
|
||||
help=ugettext_lazy("Listening port of your MANAGESIEVE server"))
|
||||
parameters.register_admin("STARTTLS", type="list_yesno", deflt="no",
|
||||
help=_("Use the STARTTLS extension"))
|
||||
help=ugettext_lazy("Use the STARTTLS extension"))
|
||||
|
||||
values = [('AUTO', 'auto')]
|
||||
for m in SUPPORTED_AUTH_MECHS:
|
||||
values += [(m, m.lower())]
|
||||
parameters.register_admin("AUTHENTICATION_MECH", type="list", deflt="auto",
|
||||
values=values,
|
||||
help=_("Prefered authentication mechanism"))
|
||||
help=ugettext_lazy("Prefered authentication mechanism"))
|
||||
|
||||
# User parameters
|
||||
parameters.register_user("EDITOR_MODE", type="list", deflt="raw",
|
||||
label=_("Editor mode"),
|
||||
label=ugettext_lazy("Editor mode"),
|
||||
values=[("raw", "raw"), ("gui", "simplified")],
|
||||
help=_("Select the mode you want the editor to work in"))
|
||||
help=ugettext_lazy("Select the mode you want the editor to work in"))
|
||||
|
||||
def destroy():
|
||||
events.unregister("UserMenuDisplay", menu)
|
||||
@@ -39,7 +39,7 @@ def infos():
|
||||
return {
|
||||
"name" : "Sieve filters",
|
||||
"version" : "1.0",
|
||||
"description" : ugettext("Plugin to easily create server-side filters"),
|
||||
"description" : _("Plugin to easily create server-side filters"),
|
||||
"url" : "sfilters"
|
||||
}
|
||||
|
||||
@@ -53,7 +53,7 @@ def menu(target, user):
|
||||
return []
|
||||
return [
|
||||
{"name" : "sievefilters",
|
||||
"label" : ugettext("Message filters"),
|
||||
"label" : _("Message filters"),
|
||||
"url" : reverse(views.index),
|
||||
"img" : "icon-check"}
|
||||
]
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
from django import forms
|
||||
from django.http import QueryDict
|
||||
from django.utils.translation import ugettext as _, ugettext_noop
|
||||
from django.utils.translation import ugettext as _, ugettext_lazy
|
||||
from django.forms.widgets import RadioFieldRenderer, RadioSelect, RadioInput
|
||||
from django.utils.safestring import mark_safe
|
||||
from django.utils.html import conditional_escape
|
||||
@@ -11,7 +11,7 @@ class FiltersSetForm(forms.Form):
|
||||
name = forms.CharField()
|
||||
active = forms.BooleanField(label=gender("Active", "m"), required=False,
|
||||
initial=False,
|
||||
help_text=ugettext_noop("Check to activate this filters set"))
|
||||
help_text=ugettext_lazy("Check to activate this filters set"))
|
||||
|
||||
class CustomRadioInput(RadioInput):
|
||||
def __unicode__(self):
|
||||
|
||||
@@ -8,7 +8,7 @@ sent, received, bounced, rejected
|
||||
|
||||
"""
|
||||
from django.core.urlresolvers import reverse
|
||||
from django.utils.translation import ugettext_noop as _, ugettext
|
||||
from django.utils.translation import ugettext as _, ugettext_lazy
|
||||
from django.conf.urls.defaults import *
|
||||
from modoboa.lib import events, parameters
|
||||
from modoboa.lib.webutils import static_url
|
||||
@@ -17,23 +17,23 @@ def infos():
|
||||
return {
|
||||
"name" : "Statistics",
|
||||
"version" : "1.0",
|
||||
"description" : ugettext("Graphical statistics about emails traffic using RRDtool"),
|
||||
"description" : _("Graphical statistics about emails traffic using RRDtool"),
|
||||
"url" : "stats"
|
||||
}
|
||||
|
||||
def load():
|
||||
parameters.register_admin("LOGFILE", type="string",
|
||||
deflt="/var/log/mail.log",
|
||||
help=_("Path to log file used to collect statistics"))
|
||||
help=ugettext_lazy("Path to log file used to collect statistics"))
|
||||
parameters.register_admin("RRD_ROOTDIR", type="string",
|
||||
deflt="/tmp/modoboa",
|
||||
help=_("Path to directory where RRD files are stored"))
|
||||
help=ugettext_lazy("Path to directory where RRD files are stored"))
|
||||
parameters.register_admin("IMG_ROOTDIR", type="string",
|
||||
deflt="/tmp/modoboa",
|
||||
help=_("Path to directory where PNG files are stored"))
|
||||
help=ugettext_lazy("Path to directory where PNG files are stored"))
|
||||
parameters.register_admin("GRAPHS_LOCATION", type="string",
|
||||
deflt="graphs",
|
||||
help=_("Graphics location (to build URLs)"))
|
||||
help=ugettext_lazy("Graphics location (to build URLs)"))
|
||||
|
||||
def destroy():
|
||||
events.unregister("AdminMenuDisplay", menu)
|
||||
@@ -44,6 +44,6 @@ def menu(target, user):
|
||||
return []
|
||||
return [
|
||||
{"name" : "stats",
|
||||
"label" : ugettext("Statistics"),
|
||||
"label" : _("Statistics"),
|
||||
"url" : reverse('fullindex')}
|
||||
]
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
# coding: utf-8
|
||||
from django.utils.translation import ugettext as _, ugettext_noop
|
||||
from django.utils.translation import ugettext as _, ugettext_lazy
|
||||
from modoboa.lib.webutils import _render, _render_to_string, ajax_simple_response
|
||||
from modoboa.admin.models import Domain, Mailbox
|
||||
from django.contrib.auth.decorators \
|
||||
@@ -8,14 +8,14 @@ from modoboa.extensions.stats.grapher import *
|
||||
from modoboa.lib.exceptions import *
|
||||
|
||||
graph_types = ['AVERAGE', 'MAX']
|
||||
graph_list = [{"name" : "traffic", "label" : ugettext_noop("Average normal traffic")},
|
||||
{"name" : "badtraffic", "label" : ugettext_noop("Average bad traffic")},
|
||||
{"name" : "size", "label" : ugettext_noop("Average normal traffic size")}]
|
||||
periods = [{"name" : "day", "label" : ugettext_noop("Day")},
|
||||
{"name" : "week", "label" : ugettext_noop("Week")},
|
||||
{"name" : "month", "label" : ugettext_noop("Month")},
|
||||
{"name" : "year", "label" : ugettext_noop("Year")},
|
||||
{"name" : "custom", "label" : ugettext_noop("Custom")}]
|
||||
graph_list = [{"name" : "traffic", "label" : ugettext_lazy("Average normal traffic")},
|
||||
{"name" : "badtraffic", "label" : ugettext_lazy("Average bad traffic")},
|
||||
{"name" : "size", "label" : ugettext_lazy("Average normal traffic size")}]
|
||||
periods = [{"name" : "day", "label" : ugettext_lazy("Day")},
|
||||
{"name" : "week", "label" : ugettext_lazy("Week")},
|
||||
{"name" : "month", "label" : ugettext_lazy("Month")},
|
||||
{"name" : "year", "label" : ugettext_lazy("Year")},
|
||||
{"name" : "custom", "label" : ugettext_lazy("Custom")}]
|
||||
|
||||
@login_required
|
||||
@permission_required("admin.view_mailboxes")
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
# coding: utf-8
|
||||
from django.utils.translation import ugettext_noop as _, ugettext
|
||||
from django.utils.translation import ugettext as _, ugettext_lazy
|
||||
from django.core.urlresolvers import reverse
|
||||
from modoboa.lib import events, parameters
|
||||
from modoboa.lib.webutils import static_url
|
||||
@@ -9,58 +9,58 @@ def load():
|
||||
|
||||
parameters.register_admin("IMAP_SERVER", type="string",
|
||||
deflt="127.0.0.1",
|
||||
help=_("Address of your IMAP server"))
|
||||
help=ugettext_lazy("Address of your IMAP server"))
|
||||
parameters.register_admin("IMAP_SECURED", type="list_yesno",
|
||||
deflt="no",
|
||||
help=_("Use a secured connection to access IMAP server"))
|
||||
help=ugettext_lazy("Use a secured connection to access IMAP server"))
|
||||
parameters.register_admin("IMAP_PORT", type="int", deflt="143",
|
||||
help=_("Listening port of your IMAP server"))
|
||||
help=ugettext_lazy("Listening port of your IMAP server"))
|
||||
parameters.register_admin("SMTP_SERVER", type="string",
|
||||
deflt="127.0.0.1",
|
||||
help=_("Address of your SMTP server"))
|
||||
help=ugettext_lazy("Address of your SMTP server"))
|
||||
parameters.register_admin("SMTP_SECURED_MODE", type="list",
|
||||
values=[("none", _("None")),
|
||||
values=[("none", ugettext_lazy("None")),
|
||||
("starttls", "STARTTLS"),
|
||||
("ssl", "SSL/TLS")],
|
||||
deflt="none",
|
||||
help=_("Use a secured connection to access SMTP server"))
|
||||
help=ugettext_lazy("Use a secured connection to access SMTP server"))
|
||||
parameters.register_admin("SMTP_PORT", type="int", deflt="25",
|
||||
help=_("Listening port of your SMTP server"))
|
||||
help=ugettext_lazy("Listening port of your SMTP server"))
|
||||
parameters.register_admin("SMTP_AUTHENTICATION", type="list_yesno",
|
||||
deflt="no",
|
||||
help=_("Server needs authentication"))
|
||||
help=ugettext_lazy("Server needs authentication"))
|
||||
parameters.register_admin("MAX_ATTACHMENT_SIZE", type="int", deflt=2048,
|
||||
help=_("Maximum attachment size in bytes (or KB, MB, GB if specified)"))
|
||||
help=ugettext_lazy("Maximum attachment size in bytes (or KB, MB, GB if specified)"))
|
||||
|
||||
parameters.register_user("MESSAGES_PER_PAGE", type="int", deflt=40,
|
||||
label=_("Number of displayed emails per page"),
|
||||
help=_("Sets the maximum number of messages displayed in a page"))
|
||||
label=ugettext_lazy("Number of displayed emails per page"),
|
||||
help=ugettext_lazy("Sets the maximum number of messages displayed in a page"))
|
||||
parameters.register_user("REFRESH_INTERVAL", type="int", deflt=300,
|
||||
label=_("Listing refresh rate"),
|
||||
help=_("Automatic folder refresh rate (in seconds)"))
|
||||
label=ugettext_lazy("Listing refresh rate"),
|
||||
help=ugettext_lazy("Automatic folder refresh rate (in seconds)"))
|
||||
parameters.register_user("TRASH_FOLDER", type="string", deflt="Trash",
|
||||
label=_("Trash folder"),
|
||||
help=_("Folder where deleted messages go"))
|
||||
label=ugettext_lazy("Trash folder"),
|
||||
help=ugettext_lazy("Folder where deleted messages go"))
|
||||
parameters.register_user("SENT_FOLDER", type="string", deflt="Sent",
|
||||
label=_("Sent folder"),
|
||||
help=_("Folder where copies of sent messages go"))
|
||||
label=ugettext_lazy("Sent folder"),
|
||||
help=ugettext_lazy("Folder where copies of sent messages go"))
|
||||
parameters.register_user("DRAFTS_FOLDER", type="string", deflt="Drafts",
|
||||
label=_("Drafts folder"),
|
||||
help=_("Folder where drafts go"))
|
||||
label=ugettext_lazy("Drafts folder"),
|
||||
help=ugettext_lazy("Folder where drafts go"))
|
||||
parameters.register_user("SIGNATURE", type="text", deflt="",
|
||||
label=_("Signature text"),
|
||||
help=_("User defined email signature"))
|
||||
label=ugettext_lazy("Signature text"),
|
||||
help=ugettext_lazy("User defined email signature"))
|
||||
parameters.register_user("EDITOR", type="list", deflt="plain",
|
||||
label=_("Default editor"),
|
||||
label=ugettext_lazy("Default editor"),
|
||||
values=[("html", "html"), ("plain", "text")],
|
||||
help=_("The default editor to use when composing a message"))
|
||||
help=ugettext_lazy("The default editor to use when composing a message"))
|
||||
parameters.register_user("DISPLAYMODE", type="list", deflt="plain",
|
||||
label=_("Default message display mode"),
|
||||
label=ugettext_lazy("Default message display mode"),
|
||||
values=[("html", "html"), ("plain", "text")],
|
||||
help=_("The default mode used when displaying a message"))
|
||||
help=ugettext_lazy("The default mode used when displaying a message"))
|
||||
parameters.register_user("ENABLE_LINKS", type="list_yesno", deflt="no",
|
||||
label=_("Enable HTML links display"),
|
||||
help=_("Enable/Disable HTML links display"))
|
||||
label=ugettext_lazy("Enable HTML links display"),
|
||||
help=ugettext_lazy("Enable/Disable HTML links display"))
|
||||
|
||||
def destroy():
|
||||
events.unregister("UserMenuDisplay", menu)
|
||||
@@ -70,7 +70,7 @@ def infos():
|
||||
return {
|
||||
"name" : "Webmail",
|
||||
"version" : "1.0",
|
||||
"description" : ugettext("Simple IMAP webmail"),
|
||||
"description" : _("Simple IMAP webmail"),
|
||||
"url" : "webmail"
|
||||
}
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
from django import forms
|
||||
from django.utils.translation import ugettext_noop as _
|
||||
from django.utils.translation import ugettext_lazy as _
|
||||
|
||||
class ComposeMailForm(forms.Form):
|
||||
from_ = forms.CharField(label=_("From"))
|
||||
|
||||
@@ -8,7 +8,7 @@ import email
|
||||
import lxml
|
||||
from django.core.files.uploadhandler import FileUploadHandler, StopUpload, SkipFile
|
||||
from django.http import HttpResponse
|
||||
from django.utils.translation import ugettext as _, ugettext_noop as __
|
||||
from django.utils.translation import ugettext as _, ugettext_lazy
|
||||
from django.conf import settings
|
||||
from modoboa.lib import u2u_decode, tables, imap_utf7, parameters
|
||||
from modoboa.lib.webutils import static_url, size2integer
|
||||
@@ -30,9 +30,9 @@ class WMtable(tables.Table):
|
||||
)
|
||||
flags = tables.ImgColumn("flags", width="4%")
|
||||
withatts = tables.ImgColumn("withatts", width="2%")
|
||||
subject = tables.Column("subject", label=__("Subject"), width="50%", limit=60)
|
||||
from_ = tables.Column("from", width="20%", label=__("From"), limit=30)
|
||||
date = tables.Column("date", width="10%", label=__("Date"))
|
||||
subject = tables.Column("subject", label=ugettext_lazy("Subject"), width="50%", limit=60)
|
||||
from_ = tables.Column("from", width="20%", label=ugettext_lazy("From"), limit=30)
|
||||
date = tables.Column("date", width="10%", label=ugettext_lazy("Date"))
|
||||
|
||||
cols_order = ["select", "withatts", "flags", "subject", "from_", "date"]
|
||||
|
||||
|
||||
Reference in New Issue
Block a user