diff --git a/admin/forms.py b/admin/forms.py index 238662d2e..9623af164 100644 --- a/admin/forms.py +++ b/admin/forms.py @@ -1,6 +1,7 @@ from django import forms from mailng.admin.models import Domain, Mailbox, Alias from django.utils.translation import ugettext as _ +from mailng.admin.templatetags.admin_extras import gender class DomainForm(forms.ModelForm): class Meta: @@ -10,7 +11,7 @@ class MailboxForm(forms.ModelForm): quota = forms.IntegerField(label=_("Quota"), required=False) password1 = forms.CharField(label=_("Password"), widget=forms.PasswordInput) password2 = forms.CharField(label=_("Confirmation"), widget=forms.PasswordInput) - enabled = forms.BooleanField(label=_("Enabled"), required=False) + enabled = forms.BooleanField(label=gender("Enabled", "f"), required=False) class Meta: model = Mailbox diff --git a/admin/locale/fr/LC_MESSAGES/django.mo b/admin/locale/fr/LC_MESSAGES/django.mo deleted file mode 100644 index e1b2ac249..000000000 Binary files a/admin/locale/fr/LC_MESSAGES/django.mo and /dev/null differ diff --git a/admin/locale/fr/LC_MESSAGES/djangojs.mo b/admin/locale/fr/LC_MESSAGES/djangojs.mo deleted file mode 100644 index 9db57682a..000000000 Binary files a/admin/locale/fr/LC_MESSAGES/djangojs.mo and /dev/null differ diff --git a/admin/templatetags/admin_extras.py b/admin/templatetags/admin_extras.py index fcc4ae1f9..d8802dee0 100644 --- a/admin/templatetags/admin_extras.py +++ b/admin/templatetags/admin_extras.py @@ -1,36 +1,21 @@ from django import template from django.template.loader import render_to_string +from django.utils.translation import ugettext as _ register = template.Library() +genders = { + "Enabled" : (_("enabled_m"), _("enabled_f")) +} + @register.simple_tag def domain_menu(domain_id, selection): return render_to_string('admin/domain_menu.html', {"selection" : selection, "domain_id" : domain_id}) - -# class MyVar(template.Node): -# def __init__(self, value, var_name): -# self.var_name = var_name -# self.value = value - -# def render(self, context): -# context[self.var_name] = self.value -# return "" - -# import re - -# @register.tag(name="var") -# def do_my_var(parser, token): -# try: -# tag_name, arg = token.contents.split(None, 1) -# except ValueError: -# raise template.TemplateSyntaxError, '%r tag requires arguments' \ -# % token.contents.split()[0] -# m = re.search('(.*?) as (\w+)', arg) -# if not m: -# raise template.TemplateSyntaxError, "%r tag had invalid arguments" \ -# % tag_name -# value, var_name = m.groups() -# return MyVar(value, var_name) +@register.filter +def gender(value, target): + if genders.has_key(value): + return target == "m" and genders[value][0] or genders[value][1] + return value diff --git a/locale/fr/LC_MESSAGES/django.po b/locale/fr/LC_MESSAGES/django.po new file mode 100644 index 000000000..5757cdea9 --- /dev/null +++ b/locale/fr/LC_MESSAGES/django.po @@ -0,0 +1,229 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER +# This file is distributed under the same license as the PACKAGE package. +# FIRST AUTHOR , YEAR. +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: PACKAGE VERSION\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2009-03-30 18:07+0200\n" +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" +"Last-Translator: Antoine Nguyen \n" +"Language-Team: LANGUAGE \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" + +#: admin/forms.py:10 templates/admin/domains.html:20 +#: templates/admin/mailboxes.html:17 +msgid "Quota" +msgstr "" + +#: admin/forms.py:11 +msgid "Password" +msgstr "Mot de passe" + +#: admin/forms.py:12 +msgid "Confirmation" +msgstr "" + +#: admin/forms.py:13 templates/admin/aliases.html:17 +#: templates/admin/domains.html:21 +msgid "Enabled" +msgstr "Activé" + +#: admin/forms.py:21 +msgid "Passwords mismatch" +msgstr "Les mots de passe diffèrent" + +#: admin/models.py:9 admin/models.py:43 +msgid "name" +msgstr "Nom" + +#: admin/models.py:11 admin/models.py:91 +msgid "enabled" +msgstr "Activé" + +#: admin/models.py:44 admin/models.py:88 +msgid "address" +msgstr "Adresse" + +#: admin/models.py:46 +msgid "password" +msgstr "Mot de passe" + +#: admin/models.py:90 +msgid "mailbox" +msgstr "Boite aux lettres" + +#: admin/views.py:43 admin/views.py:71 +msgid "Domain with this name already defined" +msgstr "Un domaine avec ce nom existe déjà" + +#: admin/views.py:51 +msgid "Failed to initialise domain, check permissions" +msgstr "Impossible d'initialiser le domaine, vérifier les permissions" + +#: admin/views.py:74 +msgid "Failed to rename domain, check permissions" +msgstr "Impossible de renommer le domaine, vérifier les permissions" + +#: admin/views.py:113 admin/views.py:161 +msgid "Mailbox with this address already exists" +msgstr "Une boite aux lettres pour cette adresse existe déjà" + +#: admin/views.py:140 +msgid "Failed to initialise mailbox, check permissions" +msgstr "" +"Impossible d'initialiser la boite aux lettres, vérifier les permissions" + +#: admin/views.py:164 +msgid "Failed to rename mailbox, check permissions" +msgstr "Impossible de renommer la boite aux lettres, vérifier les permissions." + +#: admin/views.py:228 admin/views.py:256 +msgid "Alias with this address already exists" +msgstr "Un alias avec cette adresse existe déjà" + +#: admin/templatetags/admin_extras.py:7 +msgid "enabled_m" +msgstr "Activé" + +#: admin/templatetags/admin_extras.py:7 +msgid "enabled_f" +msgstr "Activée" + +#: templates/admin/aliases.html:10 +msgid "No alias defined." +msgstr "Aucun alias défini." + +#: templates/admin/aliases.html:14 templates/admin/domains.html:17 +#: templates/admin/mailboxes.html:14 +msgid "Actions" +msgstr "" + +#: templates/admin/aliases.html:15 templates/admin/mailboxes.html:16 +msgid "Address" +msgstr "Adresse" + +#: templates/admin/aliases.html:16 +msgid "Mailbox" +msgstr "Boite aux lettres" + +#: templates/admin/aliases.html:25 +msgid "Edit alias" +msgstr "Editer cet alias" + +#: templates/admin/aliases.html:29 +msgid "Delete alias" +msgstr "Supprimer cet alias" + +#: templates/admin/domain_header.html:8 templates/admin/editdomain.html:7 +msgid "Domain" +msgstr "Domaine" + +#: templates/admin/domain_menu.html:12 templates/admin/newmailbox.html:7 +msgid "New mailbox" +msgstr "Nouvelle boite aux lettres" + +#: templates/admin/domain_menu.html:18 templates/admin/domains.html:19 +msgid "Mailboxes" +msgstr "Boites aux lettres" + +#: templates/admin/domain_menu.html:22 +msgid "Aliases" +msgstr "Alias" + +#: templates/admin/domain_menu.html:27 +msgid "Properties" +msgstr "Propriétés" + +#: templates/admin/domains.html:8 +msgid "Available domains" +msgstr "Domaines disponibles" + +#: templates/admin/domains.html:13 +msgid "No domain defined." +msgstr "Aucun alias défini." + +#: templates/admin/domains.html:18 templates/admin/mailboxes.html:15 +msgid "Name" +msgstr "Nom" + +#: templates/admin/domains.html:29 +msgid "Edit domain" +msgstr "Editer le domaine" + +#: templates/admin/domains.html:33 +msgid "Delete domain" +msgstr "Supprimer le domaine" + +#: templates/admin/domains.html:39 templates/admin/mailboxes.html:45 +msgid "MB" +msgstr "Mo" + +#: templates/admin/domains.html:40 templates/admin/mailboxes.html:46 +msgid "yes,no" +msgstr "oui,non" + +#: templates/admin/editalias.html:14 templates/admin/editdomain.html:15 +#: templates/admin/editmailbox.html:16 +msgid "Update" +msgstr "Mettre à jour" + +#: templates/admin/layout.html:17 +msgid "Logout" +msgstr "Déconnexion" + +#: templates/admin/layout.html:29 templates/admin/newdomain.html:7 +msgid "New domain" +msgstr "Nouveau domaine" + +#: templates/admin/layout.html:35 +msgid "Domains" +msgstr "Domaines" + +#: templates/admin/layout.html:41 +msgid "Settings" +msgstr "Paramètres" + +#: templates/admin/mailboxes.html:10 +msgid "No mailbox defined." +msgstr "Aucune boite aux lettres définie." + +#: templates/admin/mailboxes.html:26 +msgid "Edit mailbox" +msgstr "Editer la boite aux lettres" + +#: templates/admin/mailboxes.html:31 +msgid "Delete mailbox" +msgstr "Supprimer la boite aux lettres" + +#: templates/admin/mailboxes.html:36 +msgid "Add new alias" +msgstr "Ajouter un alias" + +#: templates/admin/mailboxes.html:40 +msgid "Mailbox aliases" +msgstr "Alias de cette boite aux lettres" + +#: templates/admin/newalias.html:7 +msgid "New alias" +msgstr "Nouvel alias" + +#: templates/admin/newalias.html:14 templates/admin/newdomain.html:15 +#: templates/admin/newmailbox.html:16 +msgid "Create" +msgstr "Créer" + +#: templates/registration/login.html:8 +msgid "Welcome" +msgstr "Bienvenue" + +#: templates/registration/login.html:11 +msgid "Your username and password didn't match. Please try again." +msgstr "" +"Votre nom d'utilisateur et mot de passe ne correspondent pas. Veuillez " +"réessayer." diff --git a/locale/fr/LC_MESSAGES/djangojs.po b/locale/fr/LC_MESSAGES/djangojs.po new file mode 100644 index 000000000..3242faace --- /dev/null +++ b/locale/fr/LC_MESSAGES/djangojs.po @@ -0,0 +1,29 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER +# This file is distributed under the same license as the PACKAGE package. +# FIRST AUTHOR , YEAR. +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: PACKAGE VERSION\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2009-03-30 10:14+0200\n" +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" +"Last-Translator: FULL NAME \n" +"Language-Team: LANGUAGE \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" + +#: static/js/domains.js:15 +msgid "Delete this domain?" +msgstr "Supprimer ce domaine?" + +#: static/js/domains.js:21 +msgid "Delete this mailbox?" +msgstr "Supprimer cette boite aux lettres?" + +#: static/js/domains.js:27 +msgid "Delete this alias?" +msgstr "Supprimer cet alias?" diff --git a/templates/admin/aliases.html b/templates/admin/aliases.html index ae17cbb7b..f8d03e38e 100644 --- a/templates/admin/aliases.html +++ b/templates/admin/aliases.html @@ -11,10 +11,10 @@ {% else %} - - - - + + + + {% for alias in aliases %} diff --git a/templates/admin/editalias.html b/templates/admin/editalias.html index e67c724a8..acef7838a 100644 --- a/templates/admin/editalias.html +++ b/templates/admin/editalias.html @@ -3,6 +3,7 @@ {% endblock %} {% block content %} +{% load i18n %}

Alias {{ alias.address }}

{% if error %}
{{ error }}
{% endif %} {% url admin.views.editalias alias.mbox.domain.id alias.id as edit_url %} diff --git a/templates/admin/index.html b/templates/admin/index.html deleted file mode 100644 index eecfc9cd3..000000000 --- a/templates/admin/index.html +++ /dev/null @@ -1,12 +0,0 @@ -{% extends "admin/layout.html" %} - -{%block pagetitle %}Administration{%endblock %} -{%block breadcrumb %}Domains{%endblock %} -{% block html_head %} - -{% endblock %} - - -{% block content %} -{% include default %} -{% endblock %} diff --git a/templates/admin/mailbox.html b/templates/admin/mailbox.html deleted file mode 100644 index 5427ecfbe..000000000 --- a/templates/admin/mailbox.html +++ /dev/null @@ -1,22 +0,0 @@ -{% extends "admin/layout.html" %} -{% block html_head %}{% endblock %} -{% block content %} -
-

Mailbox {{ mbox.address }}@{{ mbox.domain.name }}

-
- - - -
-
- -
- -

Aliases

- {% for alias in aliases %} - {{ alias.address }} - {% endfor %} -
-{% endblock %} diff --git a/templates/admin/mailboxes.html b/templates/admin/mailboxes.html index 296495b25..c73a0e05e 100644 --- a/templates/admin/mailboxes.html +++ b/templates/admin/mailboxes.html @@ -15,7 +15,7 @@ - + {% for mb in mailboxes %} diff --git a/templates/admin/mbaliases.html b/templates/admin/mbaliases.html deleted file mode 100644 index 7aefb2796..000000000 --- a/templates/admin/mbaliases.html +++ /dev/null @@ -1,14 +0,0 @@ -{% extends "admin/layout_simple.html" %} -{% block html_head %} - -{% endblock %} -{% block content %} -

Aliases for {{ mbox.address }}

-

-

    - {% for alias in aliases %} -
  • {{alias.address}}
  • - {% endfor %} -
-

-{% endblock %} diff --git a/templates/base.html b/templates/base.html deleted file mode 100644 index 39353db47..000000000 --- a/templates/base.html +++ /dev/null @@ -1,36 +0,0 @@ - - - - - MailNG - {%block pagetitle %}{% endblock %} - - - - - {%block html_head %}{% endblock %} - - - - - -
- {%block content %}{% endblock %} -
- -
- - - - - diff --git a/urls.py b/urls.py index 8e1250b56..31b00f480 100644 --- a/urls.py +++ b/urls.py @@ -20,7 +20,7 @@ urlpatterns = patterns('', (r'^accounts/login/$', 'django.contrib.auth.views.login'), (r'^accounts/logout/$', 'django.contrib.auth.views.logout_then_login'), (r'^jsi18n/$', 'django.views.i18n.javascript_catalog', - {'packages': ('mailng.admin',),}) + {'packages': ('mailng',),}) ) if settings.DEBUG:
ActionsAddressMailboxEnabled{% trans "Actions" %}{% trans "Address" %}{% trans "Mailbox" %}{% trans "Enabled" %}
{% trans "Name" %} {% trans "Address" %} {% trans "Quota" %}{% trans "Enabled" %}{{ "Enabled"|gender:"f" }}