From 412540a63eea7b68fbb882f9aa4c22827291ece5 Mon Sep 17 00:00:00 2001 From: tonio Date: Mon, 30 Mar 2009 18:16:48 +0200 Subject: [PATCH] Simple gender handling in translations (for languages like french which need this feature). Back to previous 'locale' location because it's not possible to access translations that are defined inside the 'templates' directory while scanning with django-admin.py from the 'admin' directory. --- admin/forms.py | 3 +- admin/locale/fr/LC_MESSAGES/django.mo | Bin 3126 -> 0 bytes admin/locale/fr/LC_MESSAGES/djangojs.mo | Bin 561 -> 0 bytes admin/templatetags/admin_extras.py | 35 ++-- locale/fr/LC_MESSAGES/django.po | 229 ++++++++++++++++++++++++ locale/fr/LC_MESSAGES/djangojs.po | 29 +++ templates/admin/aliases.html | 8 +- templates/admin/editalias.html | 1 + templates/admin/index.html | 12 -- templates/admin/mailbox.html | 22 --- templates/admin/mailboxes.html | 2 +- templates/admin/mbaliases.html | 14 -- templates/base.html | 36 ---- urls.py | 2 +- 14 files changed, 277 insertions(+), 116 deletions(-) delete mode 100644 admin/locale/fr/LC_MESSAGES/django.mo delete mode 100644 admin/locale/fr/LC_MESSAGES/djangojs.mo create mode 100644 locale/fr/LC_MESSAGES/django.po create mode 100644 locale/fr/LC_MESSAGES/djangojs.po delete mode 100644 templates/admin/index.html delete mode 100644 templates/admin/mailbox.html delete mode 100644 templates/admin/mbaliases.html delete mode 100644 templates/base.html 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 e1b2ac2497d3250712c894e873af5126ebef6f52..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 3126 zcmb7_Pi$009LGmMks_!d{znEBT4>+0f%t=4#XeQ&y*`gUgXX5P}( zn3!my2NS&*jR(TXP!m0xc;T|qlQBW`V$=g(J*XFBG|}(xy?L~?h%niCpEvV<^PAuN ze!uzck6YHg%g_qwkD|YI8)L`7zt-S^_RCtvHi5r_>%qUlJ>dFv*|-4Si}4}w4)6?k z7dQ&ix);FB;Jo|Z0e55kDoFZ11be_wz>VN%Ag%x0eg7IH+r9($gBxyVY#(?8><2@T z_I(E=livgH20sA%z>mNU;1v)m*bi=e6{LNC25H~lK|04;DBA*V1Gj>G;GN*0o3DVh z?m0IffcUWp4?2$lOW@0H{Hfz5$1gy#<13K#UIFoA-{WxrE5^L01>KKK~MAA_|1OYjNs8xTMC2Ogw<4V*&f-3mSe?gmM|3?2tZ zz%$^R;2?MzJPmHf;VC{-Ao)80IXDX*0^b11f0sa{3cC!F{I?**HM<>6)eau6rvrwZLQeIIb|L#HGi4J$9{sq#w zvvL@6CC+g_lD?r)EDT5^eoopsZs(-oel`!OSomRwiv?+{6BA(Dmytgc2_EXEFO^{@ zA!h{}7Ll;RDR+ZRB>x2QXhtuv;dG(HvYnORr1jahp_r9Qgigw^N+_*Up1wNO>3goY zqR6n2ox(;UkW)OT1@nbizwB8;iVQ7+>NCip3*d z@t}9$2tRPJRD7zxh#3fay@6WZ>%>F`^rSV z)p3cJmDNabUT-8Fq4=QHO6n7;(NP5*H;!Y0Y9xL`coV{JmUy*XKRro?4_2!uBALn5 zMrxI%qdi$D_MFtp3Wc3IEtqV@g5BSW;JKqnd_OkA9-Evv{V2tLjMu9LXckRk)y%22DO>n<00v;g5xV720tXSZ#brnD9ap;f zFSCZz`h!(eJXUP&CYJ4+&s=ZQa$sezVOLXIB)pqJ=FiS{FCro~t&XwmF52#*LG_INX7^&6!nHJ&dG`Xx#f#aH6sj#$ zBG{D1_cV>e-o#4$nV}lNJGd~|WoZ-mG0-t?11?#Jt;m`JpAw0TBJmQZ3ulbq5it(t Vu5zBisWVska>b!^B2iHl`v+M~I;a2u diff --git a/admin/locale/fr/LC_MESSAGES/djangojs.mo b/admin/locale/fr/LC_MESSAGES/djangojs.mo deleted file mode 100644 index 9db57682afb6279cbc58817d3e4402a61a4a4702..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 561 zcmY+B%}#?r5XbTB!ohfKi`@g;mE zFTR9Fr+!48G%~s=4cSiKvp1fDXO~lSL&;wki~zEl)S6Pb*rV-E%pox z`s@OAB~{@<%WIr_ryMSL(hlOLonWc7VNsRIK06*|6-$*1b}LRyqA;9zkQe7OIQ>$--EN*je@nSxXJBMREDKm6jd&a(k`5I z!VsEX#G%F`F9?r3-%ohEeMr_K8;J~Aiel(O=rvC}la^~?c$CX^rL#jj3L^gdQ=99K z-B5+Wg1+%kQnLofW~0n$Hv7;U2wkB$=%goX_t!V+, 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" }}