diff --git a/preferences/acl.py b/preferences/acl.py index 1f3f666e..d4b22cfe 100644 --- a/preferences/acl.py +++ b/preferences/acl.py @@ -25,6 +25,7 @@ Here are defined some functions to check acl on the application. """ +from django.utils.translation import ugettext as _ def can_view(user): @@ -38,4 +39,6 @@ def can_view(user): viewing is granted and msg is a message (can be None). """ can = user.has_module_perms('preferences') - return can, None if can else "Vous ne pouvez pas voir cette application." + return can, None if can else _("You don't have the right to view this" + " application.") + diff --git a/preferences/forms.py b/preferences/forms.py index 02463103..7da8b545 100644 --- a/preferences/forms.py +++ b/preferences/forms.py @@ -27,7 +27,7 @@ from __future__ import unicode_literals from django.forms import ModelForm, Form from django import forms - +from django.utils.translation import ugettext_lazy as _ from re2o.mixins import FormRevMixin from .models import ( OptionalUser, @@ -56,9 +56,13 @@ class EditOptionalUserForm(ModelForm): **kwargs ) self.fields['is_tel_mandatory'].label = ( - 'Exiger un numéro de téléphone' + _("Telephone number required") ) - self.fields['self_adhesion'].label = 'Auto inscription' + self.fields['gpg_fingerprint'].label = _("GPG fingerprint") + self.fields['all_can_create_club'].label = _("All can create a club") + self.fields['all_can_create_adherent'].label = _("All can create a member") + self.fields['self_adhesion'].label = _("Self registration") + self.fields['shell_default'].label = _("Default shell") class EditOptionalMachineForm(ModelForm): @@ -74,12 +78,17 @@ class EditOptionalMachineForm(ModelForm): prefix=prefix, **kwargs ) - self.fields['password_machine'].label = "Possibilité d'attribuer\ - un mot de passe par interface" - self.fields['max_lambdauser_interfaces'].label = "Maximum\ - d'interfaces autorisées pour un user normal" - self.fields['max_lambdauser_aliases'].label = "Maximum d'alias\ - dns autorisés pour un user normal" + self.fields['password_machine'].label = _("Possibility to set a" + " password per machine") + self.fields['max_lambdauser_interfaces'].label = _("Maximum number of" + " interfaces" + " allowed for a" + " standard user") + self.fields['max_lambdauser_aliases'].label = _("Maximum number of DNS" + " aliases allowed for" + " a standard user") + self.fields['ipv6_mode'].label = _("IPv6 mode") + self.fields['create_machine'].label = _("Can create a machine") class EditOptionalTopologieForm(ModelForm): @@ -95,10 +104,11 @@ class EditOptionalTopologieForm(ModelForm): prefix=prefix, **kwargs ) - self.fields['vlan_decision_ok'].label = "Vlan où placer les\ - machines après acceptation RADIUS" - self.fields['vlan_decision_nok'].label = "Vlan où placer les\ - machines après rejet RADIUS" + self.fields['radius_general_policy'].label = _("RADIUS general policy") + self.fields['vlan_decision_ok'].label = _("VLAN for machines accepted" + " by RADIUS") + self.fields['vlan_decision_nok'].label = _("VLAN for machines rejected" + " by RADIUS") class EditGeneralOptionForm(ModelForm): @@ -114,18 +124,25 @@ class EditGeneralOptionForm(ModelForm): prefix=prefix, **kwargs ) - self.fields['search_display_page'].label = 'Resultats\ - affichés dans une recherche' - self.fields['pagination_number'].label = 'Items par page,\ - taille normale (ex users)' - self.fields['pagination_large_number'].label = 'Items par page,\ - taille élevée (machines)' - self.fields['req_expire_hrs'].label = 'Temps avant expiration du lien\ - de reinitialisation de mot de passe (en heures)' - self.fields['site_name'].label = 'Nom du site web' - self.fields['email_from'].label = "Adresse mail d\ - 'expedition automatique" - self.fields['GTU_sum_up'].label = "Résumé des CGU" + self.fields['general_message'].label = _("General message") + self.fields['search_display_page'].label = _("Number of results" + " displayed when" + " searching") + self.fields['pagination_number'].label = _("Number of items per page," + " standard size (e.g." + " users)") + self.fields['pagination_large_number'].label = _("Number of items per" + " page, large size" + " (e.g. machines)") + self.fields['req_expire_hrs'].label = _("Time before expiration of the" + " reset password link (in" + " hours)") + self.fields['site_name'].label = _("Website name") + self.fields['email_from'].label = _("Email address for automatic" + " emailing") + self.fields['GTU_sum_up'].label = _("Summary of the General Terms of" + " Use") + self.fields['GTU'].label = _("General Terms of Use") class EditAssoOptionForm(ModelForm): @@ -141,15 +158,19 @@ class EditAssoOptionForm(ModelForm): prefix=prefix, **kwargs ) - self.fields['name'].label = 'Nom de l\'asso' - self.fields['siret'].label = 'SIRET' - self.fields['adresse1'].label = 'Adresse (ligne 1)' - self.fields['adresse2'].label = 'Adresse (ligne 2)' - self.fields['contact'].label = 'Email de contact' - self.fields['telephone'].label = 'Numéro de téléphone' - self.fields['pseudo'].label = 'Pseudo d\'usage' - self.fields['utilisateur_asso'].label = 'Compte utilisé pour\ - faire les modifications depuis /admin' + self.fields['name'].label = _("Organisation name") + self.fields['siret'].label = _("SIRET number") + self.fields['adresse1'].label = _("Address (line 1)") + self.fields['adresse2'].label = _("Address (line 2)") + self.fields['contact'].label = _("Contact email address") + self.fields['telephone'].label = _("Telephone number") + self.fields['pseudo'].label = _("Usual name") + self.fields['utilisateur_asso'].label = _("Account used for editing" + " from /admin") + self.fields['payment'].label = _("Payment") + self.fields['payment_id'].label = _("Payment ID") + self.fields['payment_pass'].label = _("Payment password") + self.fields['description'].label = _("Description") class EditMailMessageOptionForm(ModelForm): @@ -165,10 +186,10 @@ class EditMailMessageOptionForm(ModelForm): prefix=prefix, **kwargs ) - self.fields['welcome_mail_fr'].label = 'Message dans le\ - mail de bienvenue en français' - self.fields['welcome_mail_en'].label = 'Message dans le\ - mail de bienvenue en anglais' + self.fields['welcome_mail_fr'].label = _("Message for the French" + " welcome email") + self.fields['welcome_mail_en'].label = _("Message for the English" + " welcome email") class EditHomeOptionForm(ModelForm): @@ -184,6 +205,9 @@ class EditHomeOptionForm(ModelForm): prefix=prefix, **kwargs ) + self.fields['facebook_url'].label = _("Facebook URL") + self.fields['twitter_url'].label = _("Twitter URL") + self.fields['twitter_account_name'].label = _("Twitter account name") class ServiceForm(ModelForm): @@ -195,13 +219,17 @@ class ServiceForm(ModelForm): def __init__(self, *args, **kwargs): prefix = kwargs.pop('prefix', self.Meta.model.__name__) super(ServiceForm, self).__init__(*args, prefix=prefix, **kwargs) + self.fields['name'].label = _("Name") + self.fields['url'].label = _("URL") + self.fields['description'].label = _("Description") + self.fields['image'].label = _("Image") class DelServiceForm(Form): """Suppression de services sur la page d'accueil""" services = forms.ModelMultipleChoiceField( queryset=Service.objects.none(), - label="Enregistrements service actuels", + label=_("Current services"), widget=forms.CheckboxSelectMultiple ) @@ -239,3 +267,4 @@ class DelMailContactForm(Form): self.fields['mailcontacts'].queryset = instances else: self.fields['mailcontacts'].queryset = MailContact.objects.all() + diff --git a/preferences/locale/fr/LC_MESSAGES/django.mo b/preferences/locale/fr/LC_MESSAGES/django.mo index 21ed01a4..657adab3 100644 Binary files a/preferences/locale/fr/LC_MESSAGES/django.mo and b/preferences/locale/fr/LC_MESSAGES/django.mo differ diff --git a/preferences/locale/fr/LC_MESSAGES/django.po b/preferences/locale/fr/LC_MESSAGES/django.po index 8a4ce095..3535b8d7 100644 --- a/preferences/locale/fr/LC_MESSAGES/django.po +++ b/preferences/locale/fr/LC_MESSAGES/django.po @@ -1,70 +1,609 @@ -# 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. +# Re2o est un logiciel d'administration développé initiallement au rezometz. Il +# se veut agnostique au réseau considéré, de manière à être installable en +# quelques clics. # -#, fuzzy +# Copyright © 2018 Maël Kervella +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License along +# with this program; if not, write to the Free Software Foundation, Inc., +# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. msgid "" msgstr "" -"Project-Id-Version: PACKAGE VERSION\n" +"Project-Id-Version: 2.5\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2018-07-26 21:49+0200\n" -"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" -"Last-Translator: FULL NAME \n" -"Language: \n" +"POT-Creation-Date: 2018-08-18 13:26+0200\n" +"PO-Revision-Date: 2018-06-24 15:54+0200\n" +"Last-Translator: Laouen Fernet \n" +"Language-Team: \n" +"Language: fr_FR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Plural-Forms: nplurals=2; plural=(n > 1);\n" -#: models.py:256 -msgid "Contact email adress" -msgstr "Adresse email de contact" +#: acl.py:42 +msgid "You don't have the right to view this application." +msgstr "Vous n'avez pas le droit de voir cette application." -#: models.py:263 -msgid "Description of the associated email adress." +#: forms.py:59 templates/preferences/display_preferences.html:41 +msgid "Telephone number required" +msgstr "Numéro de téléphone requis" + +#: forms.py:61 +msgid "GPG fingerprint" +msgstr "Empreinte GPG" + +#: forms.py:62 +msgid "All can create a club" +msgstr "Tous peuvent créer un club" + +#: forms.py:63 +msgid "All can create a member" +msgstr "Tous peuvent créer un adhérent" + +#: forms.py:64 templates/preferences/display_preferences.html:43 +msgid "Self registration" +msgstr "Autoinscription" + +#: forms.py:65 +msgid "Default shell" +msgstr "Interface système par défaut" + +#: forms.py:81 +msgid "Possibility to set a password per machine" +msgstr "Possibilité de mettre un mot de passe par machine" + +#: forms.py:83 templates/preferences/display_preferences.html:87 +msgid "Maximum number of interfaces allowed for a standard user" +msgstr "Nombre maximum d'interfaces autorisé pour un utilisateur standard" + +#: forms.py:87 templates/preferences/display_preferences.html:91 +msgid "Maximum number of DNS aliases allowed for a standard user" +msgstr "Nombre maximum d'alias DNS autorisé pour un utilisateur standard" + +#: forms.py:90 +msgid "IPv6 mode" +msgstr "Mode IPv6" + +#: forms.py:91 +msgid "Can create a machine" +msgstr "Peut créer une machine" + +#: forms.py:107 +msgid "RADIUS general policy" +msgstr "Politique générale de RADIUS" + +#: forms.py:108 templates/preferences/display_preferences.html:116 +msgid "VLAN for machines accepted by RADIUS" +msgstr "VLAN pour les machines acceptées par RADIUS" + +#: forms.py:110 templates/preferences/display_preferences.html:118 +msgid "VLAN for machines rejected by RADIUS" +msgstr "VLAN pour les machines rejetées par RADIUS" + +#: forms.py:127 +msgid "General message" +msgstr "Message général" + +#: forms.py:128 templates/preferences/display_preferences.html:137 +msgid "Number of results displayed when searching" +msgstr "Nombre de résultats affichés lors de la recherche" + +#: forms.py:131 +msgid "Number of items per page, standard size (e.g. users)" +msgstr "Nombre d'éléments par page, taille standard (ex : utilisateurs)" + +#: forms.py:134 +msgid "Number of items per page, large size (e.g. machines)" +msgstr "Nombre d'éléments par page, taille importante (ex : machines)" + +#: forms.py:137 templates/preferences/display_preferences.html:145 +msgid "Time before expiration of the reset password link (in hours)" +msgstr "" +"Temps avant expiration du lien de réinitialisation de mot de passe (en " +"heures)" + +#: forms.py:140 templates/preferences/display_preferences.html:131 +msgid "Website name" +msgstr "Nom du site" + +#: forms.py:141 templates/preferences/display_preferences.html:133 +msgid "Email address for automatic emailing" +msgstr "Adresse mail pour les mails automatiques" + +#: forms.py:143 templates/preferences/display_preferences.html:151 +msgid "Summary of the General Terms of Use" +msgstr "Résumé des Conditions Générales d'Utilisation" + +#: forms.py:145 templates/preferences/display_preferences.html:155 +msgid "General Terms of Use" +msgstr "Conditions Générales d'Utilisation" + +#: forms.py:161 +msgid "Organisation name" +msgstr "Nom de l'association" + +#: forms.py:162 templates/preferences/display_preferences.html:170 +msgid "SIRET number" +msgstr "Numéro SIRET" + +#: forms.py:163 +msgid "Address (line 1)" +msgstr "Adresse (ligne 1)" + +#: forms.py:164 +msgid "Address (line 2)" +msgstr "Adresse (ligne 2)" + +#: forms.py:165 models.py:288 +#: templates/preferences/display_preferences.html:178 +msgid "Contact email address" +msgstr "Adresse mail de contact" + +#: forms.py:166 templates/preferences/display_preferences.html:182 +msgid "Telephone number" +msgstr "Numéro de téléphone" + +#: forms.py:167 templates/preferences/display_preferences.html:184 +msgid "Usual name" +msgstr "Nom d'usage" + +#: forms.py:168 +msgid "Account used for editing from /admin" +msgstr "Compte utilisé pour les modifications depuis /admin" + +#: forms.py:170 +msgid "Payment" +msgstr "Paiement" + +#: forms.py:171 +msgid "Payment ID" +msgstr "ID de paiement" + +#: forms.py:172 +msgid "Payment password" +msgstr "Mot de passe de paiement" + +#: forms.py:173 forms.py:224 templates/preferences/aff_service.html:33 +msgid "Description" +msgstr "Description" + +#: forms.py:189 +msgid "Message for the French welcome email" +msgstr "Message pour le mail de bienvenue en français" + +#: forms.py:191 +msgid "Message for the English welcome email" +msgstr "Message pour le mail de bienvenue en anglais" + +#: forms.py:208 +msgid "Facebook URL" +msgstr "URL du compte Facebook" + +#: forms.py:209 +msgid "Twitter URL" +msgstr "URL du compte Twitter" + +#: forms.py:210 templates/preferences/display_preferences.html:233 +msgid "Twitter account name" +msgstr "Nom du compte Twitter" + +#: forms.py:222 templates/preferences/aff_service.html:31 +#: templates/preferences/display_preferences.html:168 +msgid "Name" +msgstr "Nom" + +#: forms.py:223 templates/preferences/aff_service.html:32 +msgid "URL" +msgstr "URL" + +#: forms.py:225 templates/preferences/aff_service.html:34 +msgid "Image" +msgstr "Image" + +#: forms.py:232 +msgid "Current services" +msgstr "Services actuels" + +#: models.py:71 +msgid "Users can create a club" +msgstr "Les utilisateurs peuvent créer un club" + +#: models.py:75 +msgid "Users can create a member" +msgstr "Les utilisateurs peuvent créer un adhérent" + +#: models.py:79 +msgid "A new user can create their account on Re2o" +msgstr "Un nouvel utilisateur peut créer son compte sur Re2o" + +#: models.py:89 templates/preferences/display_preferences.html:49 +msgid "Users can edit their shell" +msgstr "Les utilisateurs peuvent modifier leur interface système" + +#: models.py:93 +msgid "Enable local email accounts for users" +msgstr "Active les comptes mail locaux pour les utilisateurs" + +#: models.py:98 +msgid "Domain to use for local email accounts" +msgstr "Domaine à utiliser pour les comptes mail locaux" + +#: models.py:102 +msgid "Maximum number of local email addresses for a standard user" +msgstr "" +"Nombre maximum d'adresses mail locales autorisé pour un utilisateur standard" + +#: models.py:108 +msgid "Can view the user options" +msgstr "Peut voir les options d'utilisateur" + +#: models.py:110 +msgid "user options" +msgstr "options d'utilisateur" + +#: models.py:117 +msgid "Email domain must begin with @" +msgstr "Un domaine mail doit commencer par @" + +#: models.py:135 +msgid "Autoconfiguration by RA" +msgstr "Configuration automatique par RA" + +#: models.py:136 +msgid "IP addresses assigning by DHCPv6" +msgstr "Attribution d'adresses IP par DHCPv6" + +#: models.py:137 +msgid "Disabled" +msgstr "Désactivé" + +#: models.py:159 +msgid "Can view the machine options" +msgstr "Peut voir les options de machine" + +#: models.py:161 +msgid "machine options" +msgstr "options de machine" + +#: models.py:180 +msgid "On the IP range's VLAN of the machine" +msgstr "Sur le VLAN de la plage d'IP de la machine" + +#: models.py:181 +msgid "Preset in 'VLAN for machines accepted by RADIUS'" +msgstr "Prédéfinie dans 'VLAN pour les machines acceptées par RADIUS'" + +#: models.py:206 +msgid "Can view the topology options" +msgstr "Peut voir les options de topologie" + +#: models.py:208 +msgid "topology options" +msgstr "options de topologie" + +#: models.py:225 +msgid "" +"General message displayed on the French version of the website (e.g. in case " +"of maintenance)" +msgstr "" +"Message général affiché sur la version française du site (ex : en cas de " +"maintenance)" + +#: models.py:231 +msgid "" +"General message displayed on the English version of the website (e.g. in " +"case of maintenance)" +msgstr "" +"Message général affiché sur la version anglaise du site (ex : en cas de " +"maintenance)" + +#: models.py:253 +msgid "Can view the general options" +msgstr "Peut voir les options générales" + +#: models.py:255 +msgid "general options" +msgstr "options générales" + +#: models.py:275 +msgid "Can view the service options" +msgstr "Peut voir les options de service" + +#: models.py:277 +msgid "service" +msgstr "service" + +#: models.py:278 +msgid "services" +msgstr "services" + +#: models.py:295 +msgid "Description of the associated email address." msgstr "Description de l'adresse mail associée." -#: models.py:273 -msgid "Can see contact email" -msgstr "Peut voir un mail de contact" +#: models.py:305 +msgid "Can view a contact email address object" +msgstr "Peut voir un objet adresse mail de contact" -#: templates/preferences/aff_mailcontact.html:30 -msgid "Adress" -msgstr "Adresse" +#: models.py:307 +msgid "contact email address" +msgstr "adresse mail de contact" + +#: models.py:308 +msgid "contact email addresses" +msgstr "adresses mail de contact" + +#: models.py:318 +msgid "Networking organisation school Something" +msgstr "Association de réseau de l'école Machin" + +#: models.py:322 +msgid "Threadneedle Street" +msgstr "1 rue de la Vrillière" + +#: models.py:323 +msgid "London EC2R 8AH" +msgstr "75001 Paris" + +#: models.py:326 +msgid "Organisation" +msgstr "Association" + +#: models.py:340 +msgid "Can view the organisation options" +msgstr "Peut voir les options d'association" + +#: models.py:342 +msgid "organisation options" +msgstr "options d'association" + +#: models.py:371 +msgid "Can view the homepage options" +msgstr "Peut voir les options de page d'accueil" + +#: models.py:373 +msgid "homepage options" +msgstr "options de page d'accueil" + +#: models.py:391 +msgid "Can view the email message options" +msgstr "Peut voir les options de message pour les mails" + +#: models.py:394 +msgid "email message options" +msgstr "options de messages pour les mails" #: templates/preferences/aff_mailcontact.html:31 -msgid "Remark" +#: templates/preferences/display_preferences.html:174 +msgid "Address" +msgstr "Adresse" + +#: templates/preferences/aff_mailcontact.html:32 +msgid "Comment" msgstr "Commentaire" -#: templates/preferences/display_preferences.html:205 -msgid "Contact email adresses list" -msgstr "Liste des adresses email de contact" +#: templates/preferences/display_preferences.html:31 +#: templates/preferences/edit_preferences.html:30 +#: templates/preferences/preferences.html:29 +msgid "Preferences" +msgstr "Préférences" + +#: templates/preferences/display_preferences.html:34 +msgid "User preferences" +msgstr "Préférences d'utilisateur" + +#: templates/preferences/display_preferences.html:37 +#: templates/preferences/display_preferences.html:79 +#: templates/preferences/display_preferences.html:104 +#: templates/preferences/display_preferences.html:125 +#: templates/preferences/display_preferences.html:162 +#: templates/preferences/display_preferences.html:197 +#: templates/preferences/display_preferences.html:219 +#: templates/preferences/edit_preferences.html:40 views.py:170 views.py:234 +msgid "Edit" +msgstr "Modifier" + +#: templates/preferences/display_preferences.html:47 +msgid "Default shell for users" +msgstr "Interface système par défaut pour les utilisateurs" + +#: templates/preferences/display_preferences.html:53 +msgid "Creation of members by everyone" +msgstr "Création d'adhérents par tous" + +#: templates/preferences/display_preferences.html:55 +msgid "Creation of clubs by everyone" +msgstr "Création de clubs par tous" + +#: templates/preferences/display_preferences.html:59 +msgid "GPG fingerprint field" +msgstr "Champ empreinte GPG" + +#: templates/preferences/display_preferences.html:63 +msgid "Email accounts preferences" +msgstr "Préférences de comptes mail" + +#: templates/preferences/display_preferences.html:66 +msgid "Local email accounts enabled" +msgstr "Comptes mail locaux activés" + +#: templates/preferences/display_preferences.html:68 +msgid "Local email domain" +msgstr "Domaine de mail local" + +#: templates/preferences/display_preferences.html:72 +msgid "Maximum number of email aliases allowed" +msgstr "Nombre maximum d'alias mail autorisé pour un utilisateur standard" + +#: templates/preferences/display_preferences.html:76 +msgid "Machines preferences" +msgstr "Préférences de machines" + +#: templates/preferences/display_preferences.html:85 +msgid "Password per machine" +msgstr "Mot de passe par machine" + +#: templates/preferences/display_preferences.html:93 +msgid "IPv6 support" +msgstr "Support de l'IPv6" + +#: templates/preferences/display_preferences.html:97 +msgid "Creation of machines" +msgstr "Création de machines" + +#: templates/preferences/display_preferences.html:101 +msgid "Topology preferences" +msgstr "Préférences de topologie" + +#: templates/preferences/display_preferences.html:110 +msgid "General policy for VLAN setting" +msgstr "Politique générale pour le placement sur un VLAN" + +#: templates/preferences/display_preferences.html:112 +msgid "" +"This setting defines the VLAN policy after acceptance by RADIUS: either on " +"the IP range's VLAN of the machine, or a VLAN preset in 'VLAN for machines " +"accepted by RADIUS'" +msgstr "" +"Ce réglage définit la politique de placement sur un VLAN après acceptation " +"par RADIUS: soit sur le VLAN de la plage d'IP de la machine, soit sur le " +"VLAN prédéfini dans 'VLAN pour les machines acceptées par RADIUS'" + +#: templates/preferences/display_preferences.html:122 +msgid "General preferences" +msgstr "Préférences générales" + +#: templates/preferences/display_preferences.html:139 +msgid "Number of items per page (standard size)" +msgstr "Nombre d'éléments par page (taille standard)" + +#: templates/preferences/display_preferences.html:143 +msgid "Number of items per page (large size)" +msgstr "Nombre d'éléments par page (taille importante)" + +#: templates/preferences/display_preferences.html:149 +msgid "General message displayed on the website" +msgstr "Message général affiché sur le site" + +#: templates/preferences/display_preferences.html:159 +msgid "Information about the organisation" +msgstr "Informations sur l'association" + +#: templates/preferences/display_preferences.html:188 +msgid "User object of the organisation" +msgstr "Objet utilisateur de l'association" + +#: templates/preferences/display_preferences.html:190 +msgid "Description of the organisation" +msgstr "Description de l'association" + +#: templates/preferences/display_preferences.html:194 +msgid "Custom email message" +msgstr "Message personnalisé pour les mails" + +#: templates/preferences/display_preferences.html:203 +msgid "Welcome email (in French)" +msgstr "Mail de bienvenue (en français)" #: templates/preferences/display_preferences.html:207 -msgid "Add an adress" +msgid "Welcome email (in English)" +msgstr "Mail de bienvenue (en anglais)" + +#: templates/preferences/display_preferences.html:211 +msgid "List of services and homepage preferences" +msgstr "Liste des services et préférences de page d'accueil" + +#: templates/preferences/display_preferences.html:213 +msgid " Add a service" +msgstr " Ajouter un service" + +#: templates/preferences/display_preferences.html:215 +msgid " Delete one or several services" +msgstr " Supprimer un ou plusieurs services" + +#: templates/preferences/display_preferences.html:221 +msgid "List of contact email addresses" +msgstr "Liste des adresses mail de contact" + +#: templates/preferences/display_preferences.html:223 +msgid "Add an address" msgstr "Ajouter une adresse" -#: templates/preferences/display_preferences.html:209 -msgid "Delete one or multiple adresses" -msgstr "Supprimer une ou plusieurs adresses" +#: templates/preferences/display_preferences.html:225 +msgid "Delete one or several addresses" +msgstr " Supprimer une ou plusieurs adresses" -#: views.py:210 -msgid "The adress was created." -msgstr "L'adresse a été créée." +#: templates/preferences/display_preferences.html:231 +msgid "Twitter account URL" +msgstr "URL du compte Twitter" -#: views.py:230 -msgid "Email adress updated." -msgstr "L'adresse email a été mise à jour." +#: templates/preferences/display_preferences.html:237 +msgid "Facebook account URL" +msgstr "URL du compte Facebook" -#: views.py:233 -msgid "Edit" -msgstr "Éditer" +#: templates/preferences/edit_preferences.html:35 +msgid "Editing of preferences" +msgstr "Modification des préférences" -#: views.py:251 -msgid "The email adress was deleted." -msgstr "L'adresse email a été supprimée." +#: views.py:98 +msgid "Unknown object" +msgstr "Objet inconnu" -#: views.py:254 +#: views.py:104 +msgid "You don't have the right to edit this option." +msgstr "Vous n'avez pas le droit de modifier cette option." + +#: views.py:121 +msgid "The preferences were edited." +msgstr "Les préférences ont été modifiées." + +#: views.py:140 +msgid "The service was added." +msgstr "Le service a été ajouté." + +#: views.py:143 +msgid "Add a service" +msgstr " Ajouter un service" + +#: views.py:167 +msgid "The service was edited." +msgstr "Le service a été modifié." + +#: views.py:188 +msgid "The service was deleted." +msgstr "Le service a été supprimé." + +#: views.py:190 +#, python-format +msgid "Error: the service %s can't be deleted." +msgstr "Erreur : le service %s ne peut pas être supprimé." + +#: views.py:194 views.py:256 msgid "Delete" msgstr "Supprimer" + +#: views.py:210 +msgid "The contact email address was created." +msgstr "L'adresse mail de contact a été supprimée." + +#: views.py:214 +msgid "Add a contact email address" +msgstr "Ajouter une adresse mail de contact" + +#: views.py:231 +msgid "The contact email address was edited." +msgstr "L'adresse mail de contact a été modifiée." + +#: views.py:253 +msgid "The contact email adress was deleted." +msgstr "L'adresse mail de contact a été supprimée." diff --git a/preferences/migrations/0050_auto_20180818_1329.py b/preferences/migrations/0050_auto_20180818_1329.py new file mode 100644 index 00000000..1cd4a269 --- /dev/null +++ b/preferences/migrations/0050_auto_20180818_1329.py @@ -0,0 +1,146 @@ +# -*- coding: utf-8 -*- +# Generated by Django 1.10.7 on 2018-08-18 11:29 +from __future__ import unicode_literals + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('preferences', '0049_optionaluser_self_change_shell'), + ] + + operations = [ + migrations.AlterModelOptions( + name='assooption', + options={'permissions': (('view_assooption', 'Can view the organisation options'),), 'verbose_name': 'organisation options'}, + ), + migrations.AlterModelOptions( + name='generaloption', + options={'permissions': (('view_generaloption', 'Can view the general options'),), 'verbose_name': 'general options'}, + ), + migrations.AlterModelOptions( + name='homeoption', + options={'permissions': (('view_homeoption', 'Can view the homepage options'),), 'verbose_name': 'homepage options'}, + ), + migrations.AlterModelOptions( + name='mailcontact', + options={'permissions': (('view_mailcontact', 'Can view a contact email address object'),), 'verbose_name': 'contact email address', 'verbose_name_plural': 'contact email addresses'}, + ), + migrations.AlterModelOptions( + name='mailmessageoption', + options={'permissions': (('view_mailmessageoption', 'Can view the email message options'),), 'verbose_name': 'email message options'}, + ), + migrations.AlterModelOptions( + name='optionalmachine', + options={'permissions': (('view_optionalmachine', 'Can view the machine options'),), 'verbose_name': 'machine options'}, + ), + migrations.AlterModelOptions( + name='optionaltopologie', + options={'permissions': (('view_optionaltopologie', 'Can view the topology options'),), 'verbose_name': 'topology options'}, + ), + migrations.AlterModelOptions( + name='optionaluser', + options={'permissions': (('view_optionaluser', 'Can view the user options'),), 'verbose_name': 'user options'}, + ), + migrations.AlterModelOptions( + name='service', + options={'permissions': (('view_service', 'Can view the service options'),), 'verbose_name': 'service', 'verbose_name_plural': 'services'}, + ), + migrations.AlterField( + model_name='assooption', + name='adresse1', + field=models.CharField(default='Threadneedle Street', max_length=128), + ), + migrations.AlterField( + model_name='assooption', + name='adresse2', + field=models.CharField(default='London EC2R 8AH', max_length=128), + ), + migrations.AlterField( + model_name='assooption', + name='name', + field=models.CharField(default='Networking organisation school Something', max_length=256), + ), + migrations.AlterField( + model_name='assooption', + name='pseudo', + field=models.CharField(default='Organisation', max_length=32), + ), + migrations.AlterField( + model_name='generaloption', + name='general_message_en', + field=models.TextField(blank=True, default='', help_text='General message displayed on the English version of the website (e.g. in case of maintenance)'), + ), + migrations.AlterField( + model_name='generaloption', + name='general_message_fr', + field=models.TextField(blank=True, default='', help_text='General message displayed on the French version of the website (e.g. in case of maintenance)'), + ), + migrations.AlterField( + model_name='homeoption', + name='facebook_url', + field=models.URLField(blank=True, null=True), + ), + migrations.AlterField( + model_name='homeoption', + name='twitter_account_name', + field=models.CharField(blank=True, max_length=32, null=True), + ), + migrations.AlterField( + model_name='homeoption', + name='twitter_url', + field=models.URLField(blank=True, null=True), + ), + migrations.AlterField( + model_name='mailcontact', + name='address', + field=models.EmailField(default='contact@example.org', help_text='Contact email address', max_length=254), + ), + migrations.AlterField( + model_name='mailcontact', + name='commentary', + field=models.CharField(blank=True, help_text='Description of the associated email address.', max_length=256, null=True), + ), + migrations.AlterField( + model_name='optionalmachine', + name='create_machine', + field=models.BooleanField(default=True), + ), + migrations.AlterField( + model_name='optionalmachine', + name='ipv6_mode', + field=models.CharField(choices=[('SLAAC', 'Autoconfiguration by RA'), ('DHCPV6', 'IP addresses assigning by DHCPv6'), ('DISABLED', 'Disabled')], default='DISABLED', max_length=32), + ), + migrations.AlterField( + model_name='optionaltopologie', + name='radius_general_policy', + field=models.CharField(choices=[('MACHINE', "On the IP range's VLAN of the machine"), ('DEFINED', "Preset in 'VLAN for machines accepted by RADIUS'")], default='DEFINED', max_length=32), + ), + migrations.AlterField( + model_name='optionaluser', + name='all_can_create_adherent', + field=models.BooleanField(default=False, help_text='Users can create a member'), + ), + migrations.AlterField( + model_name='optionaluser', + name='all_can_create_club', + field=models.BooleanField(default=False, help_text='Users can create a club'), + ), + migrations.AlterField( + model_name='optionaluser', + name='max_email_address', + field=models.IntegerField(default=15, help_text='Maximum number of local email addresses for a standard user'), + ), + migrations.AlterField( + model_name='optionaluser', + name='self_adhesion', + field=models.BooleanField(default=False, help_text='A new user can create their account on Re2o'), + ), + migrations.AlterField( + model_name='optionaluser', + name='self_change_shell', + field=models.BooleanField(default=False, help_text='Users can edit their shell'), + ), + ] diff --git a/preferences/models.py b/preferences/models.py index 0ebb2fec..3199dd6c 100644 --- a/preferences/models.py +++ b/preferences/models.py @@ -63,21 +63,20 @@ class PreferencesModel(models.Model): class OptionalUser(AclMixin, PreferencesModel): """Options pour l'user : obligation ou nom du telephone, activation ou non du solde, autorisation du negatif, fingerprint etc""" - PRETTY_NAME = "Options utilisateur" is_tel_mandatory = models.BooleanField(default=True) gpg_fingerprint = models.BooleanField(default=True) all_can_create_club = models.BooleanField( default=False, - help_text="Les users peuvent créer un club" + help_text=_("Users can create a club") ) all_can_create_adherent = models.BooleanField( default=False, - help_text="Les users peuvent créer d'autres adhérents", + help_text=_("Users can create a member"), ) self_adhesion = models.BooleanField( default=False, - help_text="Un nouvel utilisateur peut se créer son compte sur re2o" + help_text=_("A new user can create their account on Re2o") ) shell_default = models.OneToOneField( 'users.ListShell', @@ -87,33 +86,35 @@ class OptionalUser(AclMixin, PreferencesModel): ) self_change_shell = models.BooleanField( default=False, - help_text="Users can change their shell" + help_text=_("Users can edit their shell") ) local_email_accounts_enabled = models.BooleanField( default=False, - help_text="Enable local email accounts for users" + help_text=_("Enable local email accounts for users") ) local_email_domain = models.CharField( - max_length = 32, - default = "@example.org", - help_text="Domain to use for local email accounts", + max_length=32, + default="@example.org", + help_text=_("Domain to use for local email accounts") ) max_email_address = models.IntegerField( - default = 15, - help_text = "Maximum number of local email address for a standard user" + default=15, + help_text=_("Maximum number of local email addresses for a standard" + " user") ) class Meta: permissions = ( - ("view_optionaluser", "Peut voir les options de l'user"), + ("view_optionaluser", _("Can view the user options")), ) + verbose_name = _("user options") def clean(self): """Clean model: Check the mail_extension """ if self.local_email_domain[0] != "@": - raise ValidationError("Mail domain must begin with @") + raise ValidationError(_("Email domain must begin with @")) @receiver(post_save, sender=OptionalUser) @@ -126,15 +127,14 @@ def optionaluser_post_save(**kwargs): class OptionalMachine(AclMixin, PreferencesModel): """Options pour les machines : maximum de machines ou d'alias par user sans droit, activation de l'ipv6""" - PRETTY_NAME = "Options machines" SLAAC = 'SLAAC' DHCPV6 = 'DHCPV6' DISABLED = 'DISABLED' CHOICE_IPV6 = ( - (SLAAC, 'Autoconfiguration par RA'), - (DHCPV6, 'Attribution des ip par dhcpv6'), - (DISABLED, 'Désactivé'), + (SLAAC, _("Autoconfiguration by RA")), + (DHCPV6, _("IP addresses assigning by DHCPv6")), + (DISABLED, _("Disabled")), ) password_machine = models.BooleanField(default=False) @@ -146,8 +146,7 @@ class OptionalMachine(AclMixin, PreferencesModel): default='DISABLED' ) create_machine = models.BooleanField( - default=True, - help_text="Permet à l'user de créer une machine" + default=True ) @cached_property @@ -157,8 +156,9 @@ class OptionalMachine(AclMixin, PreferencesModel): class Meta: permissions = ( - ("view_optionalmachine", "Peut voir les options de machine"), + ("view_optionalmachine", _("Can view the machine options")), ) + verbose_name = _("machine options") @receiver(post_save, sender=OptionalMachine) @@ -174,13 +174,11 @@ def optionalmachine_post_save(**kwargs): class OptionalTopologie(AclMixin, PreferencesModel): """Reglages pour la topologie : mode d'accès radius, vlan où placer les machines en accept ou reject""" - PRETTY_NAME = "Options topologie" MACHINE = 'MACHINE' DEFINED = 'DEFINED' CHOICE_RADIUS = ( - (MACHINE, 'Sur le vlan de la plage ip machine'), - (DEFINED, 'Prédéfini dans "Vlan où placer les machines\ - après acceptation RADIUS"'), + (MACHINE, _("On the IP range's VLAN of the machine")), + (DEFINED, _("Preset in 'VLAN for machines accepted by RADIUS'")), ) radius_general_policy = models.CharField( @@ -205,8 +203,9 @@ class OptionalTopologie(AclMixin, PreferencesModel): class Meta: permissions = ( - ("view_optionaltopologie", "Peut voir les options de topologie"), + ("view_optionaltopologie", _("Can view the topology options")), ) + verbose_name = _("topology options") @receiver(post_save, sender=OptionalTopologie) @@ -219,17 +218,18 @@ def optionaltopologie_post_save(**kwargs): class GeneralOption(AclMixin, PreferencesModel): """Options générales : nombre de resultats par page, nom du site, temps où les liens sont valides""" - PRETTY_NAME = "Options générales" general_message_fr = models.TextField( default="", blank=True, - help_text="Message général affiché sur le site (maintenance, etc)" + help_text=_("General message displayed on the French version of the" + " website (e.g. in case of maintenance)") ) general_message_en = models.TextField( default="", blank=True, - help_text="General message displayed on the English version of the website." + help_text=_("General message displayed on the English version of the" + " website (e.g. in case of maintenance)") ) search_display_page = models.IntegerField(default=15) pagination_number = models.IntegerField(default=25) @@ -250,8 +250,9 @@ class GeneralOption(AclMixin, PreferencesModel): class Meta: permissions = ( - ("view_generaloption", "Peut voir les options générales"), + ("view_generaloption", _("Can view the general options")), ) + verbose_name = _("general options") @receiver(post_save, sender=GeneralOption) @@ -271,8 +272,10 @@ class Service(AclMixin, models.Model): class Meta: permissions = ( - ("view_service", "Peut voir les options de service"), + ("view_service", _("Can view the service options")), ) + verbose_name = _("service") + verbose_name_plural =_("services") def __str__(self): return str(self.name) @@ -282,14 +285,14 @@ class MailContact(AclMixin, models.Model): address = models.EmailField( default = "contact@example.org", - help_text = _("Contact email adress") + help_text = _("Contact email address") ) commentary = models.CharField( blank = True, null = True, help_text = _( - "Description of the associated email adress."), + "Description of the associated email address."), max_length = 256 ) @@ -299,8 +302,10 @@ class MailContact(AclMixin, models.Model): class Meta: permissions = ( - ("view_mailcontact", _("Can see contact email")), + ("view_mailcontact", _("Can view a contact email address object")), ) + verbose_name = _("contact email address") + verbose_name_plural = _("contact email addresses") def __str__(self): return(self.address) @@ -308,18 +313,17 @@ class MailContact(AclMixin, models.Model): class AssoOption(AclMixin, PreferencesModel): """Options générales de l'asso : siret, addresse, nom, etc""" - PRETTY_NAME = "Options de l'association" name = models.CharField( - default="Association réseau école machin", + default=_("Networking organisation school Something"), max_length=256 ) siret = models.CharField(default="00000000000000", max_length=32) - adresse1 = models.CharField(default="1 Rue de exemple", max_length=128) - adresse2 = models.CharField(default="94230 Cachan", max_length=128) + adresse1 = models.CharField(default=_("Threadneedle Street"), max_length=128) + adresse2 = models.CharField(default=_("London EC2R 8AH"), max_length=128) contact = models.EmailField(default="contact@example.org") telephone = models.CharField(max_length=15, default="0000000000") - pseudo = models.CharField(default="Asso", max_length=32) + pseudo = models.CharField(default=_("Organisation"), max_length=32) utilisateur_asso = models.OneToOneField( 'users.User', on_delete=models.PROTECT, @@ -333,8 +337,9 @@ class AssoOption(AclMixin, PreferencesModel): class Meta: permissions = ( - ("view_assooption", "Peut voir les options de l'asso"), + ("view_assooption", _("Can view the organisation options")), ) + verbose_name = _("organisation options") @receiver(post_save, sender=AssoOption) @@ -346,29 +351,26 @@ def assooption_post_save(**kwargs): class HomeOption(AclMixin, PreferencesModel): """Settings of the home page (facebook/twitter etc)""" - PRETTY_NAME = "Options de la page d'accueil" facebook_url = models.URLField( null=True, - blank=True, - help_text="Url du compte facebook" + blank=True ) twitter_url = models.URLField( null=True, - blank=True, - help_text="Url du compte twitter" + blank=True ) twitter_account_name = models.CharField( max_length=32, null=True, - blank=True, - help_text="Nom du compte à afficher" + blank=True ) class Meta: permissions = ( - ("view_homeoption", "Peut voir les options de l'accueil"), + ("view_homeoption", _("Can view the homepage options")), ) + verbose_name = _("homepage options") @receiver(post_save, sender=HomeOption) @@ -380,12 +382,14 @@ def homeoption_post_save(**kwargs): class MailMessageOption(AclMixin, models.Model): """Reglages, mail de bienvenue et autre""" - PRETTY_NAME = "Options de corps de mail" welcome_mail_fr = models.TextField(default="") welcome_mail_en = models.TextField(default="") class Meta: permissions = ( - ("view_mailmessageoption", "Peut voir les options de mail"), + ("view_mailmessageoption", _("Can view the email message" + " options")), ) + verbose_name = _("email message options") + diff --git a/preferences/templates/preferences/aff_mailcontact.html b/preferences/templates/preferences/aff_mailcontact.html index a87e03bb..98ee8cdc 100644 --- a/preferences/templates/preferences/aff_mailcontact.html +++ b/preferences/templates/preferences/aff_mailcontact.html @@ -24,24 +24,26 @@ with this program; if not, write to the Free Software Foundation, Inc., {% load i18n %} {% load acl %} {% load logs_extra %} - - - - - - - - - {% for mailcontact in mailcontact_list %} + +
{% trans "Adress" %}{% trans "Remark" %}
+ + + + + + + + {% for mailcontact in mailcontact_list %} - {% endfor %} -
{% trans "Address" %}{% trans "Comment" %}
{{ mailcontact.address }} {{ mailcontact.commentary }} - {% can_edit mailcontact %} - {% include 'buttons/edit.html' with href='preferences:edit-mailcontact' id=mailcontact.id %} - {% acl_end %} - {% history_button mailcontact %} + {% can_edit mailcontact %} + {% include 'buttons/edit.html' with href='preferences:edit-mailcontact' id=mailcontact.id %} + {% acl_end %} + {% history_button mailcontact %}
+ {% endfor %} + + diff --git a/preferences/templates/preferences/aff_service.html b/preferences/templates/preferences/aff_service.html index 89cfc641..c08e14e0 100644 --- a/preferences/templates/preferences/aff_service.html +++ b/preferences/templates/preferences/aff_service.html @@ -23,30 +23,31 @@ with this program; if not, write to the Free Software Foundation, Inc., {% endcomment %} {% load acl %} {% load logs_extra %} - - - - - - - - - - - - {% for service in service_list %} +{% load i18n %} + +
NomUrlDescriptionImage
+ + + + + + + + + + {% for service in service_list %} - {% endfor %} -
{% trans "Name" %}{% trans "URL" %}{% trans "Description" %}{% trans "Image" %}
{{ service.name }} {{ service.url }} {{ service.description }} {{ service.image }} - {% can_edit service%} - {% include 'buttons/edit.html' with href='preferences:edit-service' id=service.id %} - {% acl_end %} - {% history_button service %} + {% can_edit service%} + {% include 'buttons/edit.html' with href='preferences:edit-service' id=service.id %} + {% acl_end %} + {% history_button service %}
+ {% endfor %} + diff --git a/preferences/templates/preferences/display_preferences.html b/preferences/templates/preferences/display_preferences.html index a7ada02b..6a499969 100644 --- a/preferences/templates/preferences/display_preferences.html +++ b/preferences/templates/preferences/display_preferences.html @@ -28,223 +28,215 @@ with this program; if not, write to the Free Software Foundation, Inc., {% load design %} {% load i18n %} -{% block title %}Création et modification des préférences{% endblock %} +{% block title %}{% trans "Preferences" %}{% endblock %} {% block content %} -

Préférences utilisateur

- - Editer - - -
Généralités
- - - - - - - - - - - - - - - - - - - - - - - - -
Téléphone obligatoirement requis{{ useroptions.is_tel_mandatory|tick }}Auto inscription{{ useroptions.self_adhesion|tick }}
Shell par défaut des utilisateurs{{ useroptions.shell_default }}Les utilisateurs peuvent changer leur shell{{ useroptions.self_change_shell|tick }}
Creations d'adhérents par tous{{ useroptions.all_can_create_adherent|tick }}Creations de clubs par tous{{ useroptions.all_can_create_club|tick }}
Champ gpg fingerprint{{ useroptions.gpg_fingerprint|tick }}
- -
Comptes mails
- - - - - - - - - - - -
Gestion des comptes mails{{ useroptions.local_email_accounts_enabled | tick }}Extension mail interne{{ useroptions.local_email_domain }}
Nombre d'alias mail max{{ useroptions.max_email_address }}
- - -

Préférences machines

- - Editer - - - - - - - - - - - - - - - - - - -
Mot de passe par machine{{ machineoptions.password_machine|tick }}Machines/interfaces autorisées par utilisateurs{{ machineoptions.max_lambdauser_interfaces }}
Alias dns autorisé par utilisateur{{ machineoptions.max_lambdauser_aliases }}Support de l'ipv6{{ machineoptions.ipv6_mode }}
Creation de machines{{ machineoptions.create_machine|tick }}
- - -

Préférences topologie

- - Editer - - - - - - - - - - - - - - -
Politique générale de placement de vlan{{ topologieoptions.radius_general_policy }} - Ce réglage défini la politique vlan après acceptation radius : - soit sur le vlan de la plage d'ip de la machine, soit sur un - vlan prédéfini dans "Vlan où placer les machines après acceptation - RADIUS" -
Vlan où placer les machines après acceptation RADIUS{{ topologieoptions.vlan_decision_ok }}Vlan où placer les machines après rejet RADIUS{{ topologieoptions.vlan_decision_nok }}
- - -

Préférences generales

- - Editer - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Nom du site web{{ generaloptions.site_name }}Adresse mail d'expedition automatique{{ generaloptions.email_from }}
Affichage de résultats dans le champ de recherche{{ generaloptions.search_display_page }}Nombre d'items affichés en liste (taille normale){{ generaloptions.pagination_number }}
Nombre d'items affichés en liste (taille élevée){{ generaloptions.pagination_large_number }}Temps avant expiration du lien de reinitialisation de mot de passe (en heures){{ generaloptions.req_expire_hrs }}
Message global affiché sur le site{{ generaloptions.general_message }}Résumé des CGU{{ generaloptions.GTU_sum_up }}
CGU{{generaloptions.GTU}} -
- - -

Données de l'association

- - Editer - - - - - - - - - - - - - - - - - - - - - - - - - - -
Nom{{ assooptions.name }}SIRET{{ assooptions.siret }}
Adresse{{ assooptions.adresse1 }}
- {{ assooptions.adresse2 }}
Contact mail{{ assooptions.contact }}
Telephone{{ assooptions.telephone }}Pseudo d'usage{{ assooptions.pseudo }}
Objet utilisateur de l'association{{ assooptions.utilisateur_asso }}Description de l'association{{ assooptions.description | safe }}
- - -

Messages personalisé dans les mails

- - Editer - - - - - - - - - - -
Mail de bienvenue (Français){{ mailmessageoptions.welcome_mail_fr | safe }}
Mail de bienvenue (Anglais){{ mailmessageoptions.welcome_mail_en | safe }}
- - -

Liste des services et préférences page d'accueil

-{% can_create preferences.Service%} - - Ajouter un service - -{% acl_end %} - - Supprimer un ou plusieurs service - -{% include "preferences/aff_service.html" with service_list=service_list %} - - - Editer - - -

{% trans "Contact email adresses list" %}

- {% can_create preferences.MailContact%} - {% trans "Add an adress" %} - {% acl_end %} - {% trans "Delete one or multiple adresses" %} - {% include "preferences/aff_mailcontact.html" with mailcontact_list=mailcontact_list %} -

- - - - - - - - - - - - -
Url du compte twitter{{ homeoptions.twitter_url }}Nom utilisé pour afficher le compte{{ homeoptions.twitter_account_name }}
Url du compte facebook{{ homeoptions.facebook_url }}
+

{% trans "User preferences" %}

+ + + {% trans "Edit" %} + + + + + + + + + + + + + + + + + + + + + + + + +
{% trans "Telephone number required" %}{{ useroptions.is_tel_mandatory|tick }}{% trans "Self registration" %}{{ useroptions.self_adhesion|tick }}
{% trans "Default shell for users" %}{{ useroptions.shell_default }}{% trans "Users can edit their shell" %}{{ useroptions.self_change_shell|tick }}
{% trans "Creation of members by everyone" %}{{ useroptions.all_can_create_adherent|tick }}{% trans "Creation of clubs by everyone" %}{{ useroptions.all_can_create_club|tick }}
{% trans "GPG fingerprint field" %}{{ useroptions.gpg_fingerprint|tick }}
+
{% trans "Email accounts preferences" %} + + + + + + + + + + + +
{% trans "Local email accounts enabled" %}{{ useroptions.local_email_accounts_enabled|tick }}{% trans "Local email domain" %}{{ useroptions.local_email_domain }}
{% trans "Maximum number of email aliases allowed" %}{{ useroptions.max_email_address }}
+

{% trans "Machines preferences" %}

+ + + {% trans "Edit" %} + +

+

+ + + + + + + + + + + + + + + + + +
{% trans "Password per machine" %}{{ machineoptions.password_machine|tick }}{% trans "Maximum number of interfaces allowed for a standard user" %}{{ machineoptions.max_lambdauser_interfaces }}
{% trans "Maximum number of DNS aliases allowed for a standard user" %}{{ machineoptions.max_lambdauser_aliases }}{% trans "IPv6 support" %}{{ machineoptions.ipv6_mode }}
{% trans "Creation of machines" %}{{ machineoptions.create_machine|tick }}
+

{% trans "Topology preferences" %}

+ + + {% trans "Edit" %} + +

+

+ + + + + + + + + + + + + +
{% trans "General policy for VLAN setting" %}{{ topologieoptions.radius_general_policy }}{% trans "This setting defines the VLAN policy after acceptance by RADIUS: either on the IP range's VLAN of the machine, or a VLAN preset in 'VLAN for machines accepted by RADIUS'" %}
{% trans "VLAN for machines accepted by RADIUS" %}{{ topologieoptions.vlan_decision_ok }}{% trans "VLAN for machines rejected by RADIUS" %}{{ topologieoptions.vlan_decision_nok }}
+

{% trans "General preferences" %}

+ + + {% trans "Edit" %} + +

+

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
{% trans "Website name" %}{{ generaloptions.site_name }}{% trans "Email address for automatic emailing" %}{{ generaloptions.email_from }}
{% trans "Number of results displayed when searching" %}{{ generaloptions.search_display_page }}{% trans "Number of items per page (standard size)" %}{{ generaloptions.pagination_number }}
{% trans "Number of items per page (large size)" %}{{ generaloptions.pagination_large_number }}{% trans "Time before expiration of the reset password link (in hours)" %}{{ generaloptions.req_expire_hrs }}
{% trans "General message displayed on the website" %}{{ generaloptions.general_message }}{% trans "Summary of the General Terms of Use" %}{{ generaloptions.GTU_sum_up }}
{% trans "General Terms of Use" %}{{ generaloptions.GTU }} +
+

{% trans "Information about the organisation" %}

+ + + {% trans "Edit" %} + +

+

+ + + + + + + + + + + + + + + + + + + + + + + + + +
{% trans "Name" %}{{ assooptions.name }}{% trans "SIRET number" %}{{ assooptions.siret }}
{% trans "Address" %}{{ assooptions.adresse1 }}
+ {{ assooptions.adresse2 }} +
{% trans "Contact email address" %}{{ assooptions.contact }}
{% trans "Telephone number" %}{{ assooptions.telephone }}{% trans "Usual name" %}{{ assooptions.pseudo }}
{% trans "User object of the organisation" %}{{ assooptions.utilisateur_asso }}{% trans "Description of the organisation" %}{{ assooptions.description|safe }}
+

{% trans "Custom email message" %}

+ + + {% trans "Edit" %} + +

+

+ + + + + + + + + +
{% trans "Welcome email (in French)" %}{{ mailmessageoptions.welcome_mail_fr|safe }}
{% trans "Welcome email (in English)" %}{{ mailmessageoptions.welcome_mail_en|safe }}
+

{% trans "List of services and homepage preferences" %}

+ {% can_create preferences.Service%} + {% trans " Add a service" %} + {% acl_end %} + {% trans " Delete one or several services" %} + {% include "preferences/aff_service.html" with service_list=service_list %} + + + {% trans "Edit" %} + +

{% trans "List of contact email addresses" %}

+ {% can_create preferences.MailContact %} + {% trans "Add an address" %} + {% acl_end %} + {% trans "Delete one or several addresses" %} + {% include "preferences/aff_mailcontact.html" with mailcontact_list=mailcontact_list %} +

+

+ + + + + + + + + + + +
{% trans "Twitter account URL" %}{{ homeoptions.twitter_url }}{% trans "Twitter account name" %}{{ homeoptions.twitter_account_name }}
{% trans "Facebook account URL" %}{{ homeoptions.facebook_url }}
{% endblock %} + diff --git a/preferences/templates/preferences/edit_preferences.html b/preferences/templates/preferences/edit_preferences.html index 055ac7e8..356f2362 100644 --- a/preferences/templates/preferences/edit_preferences.html +++ b/preferences/templates/preferences/edit_preferences.html @@ -25,20 +25,23 @@ with this program; if not, write to the Free Software Foundation, Inc., {% load bootstrap3 %} {% load massive_bootstrap_form %} +{% load i18n %} -{% block title %}Création et modification des préférences{% endblock %} +{% block title %}{% trans "Preferences" %}{% endblock %} {% block content %} {% bootstrap_form_errors options %} -

Edition des préférences

+

{% trans "Editing of preferences" %}

-{% csrf_token %} -{% massive_bootstrap_form options 'utilisateur_asso' %} -{% bootstrap_button "Modifier" button_type="submit" icon="star" %} + {% csrf_token %} + {% massive_bootstrap_form options 'utilisateur_asso' %} + {% trans "Edit" as tr_edit %} + {% bootstrap_button tr_edit button_type="submit" icon="star" %}
-
-
-
+
+
+
{% endblock %} + diff --git a/preferences/templates/preferences/preferences.html b/preferences/templates/preferences/preferences.html index e8972d8d..e4ad4ba2 100644 --- a/preferences/templates/preferences/preferences.html +++ b/preferences/templates/preferences/preferences.html @@ -24,8 +24,9 @@ with this program; if not, write to the Free Software Foundation, Inc., {% endcomment %} {% load bootstrap3 %} +{% load i18n %} -{% block title %}Création et modification des preferences{% endblock %} +{% block title %}{% trans "Preferences" %}{% endblock %} {% block content %} {% if preferenceform %} @@ -44,3 +45,4 @@ with this program; if not, write to the Free Software Foundation, Inc.,

{% endblock %} + diff --git a/preferences/views.py b/preferences/views.py index 3c0c4879..559cdfef 100644 --- a/preferences/views.py +++ b/preferences/views.py @@ -95,14 +95,14 @@ def edit_options(request, section): model = getattr(models, section, None) form_instance = getattr(forms, 'Edit' + section + 'Form', None) if not (model or form_instance): - messages.error(request, "Objet inconnu") + messages.error(request, _("Unknown object")) return redirect(reverse('preferences:display-options')) options_instance, _created = model.objects.get_or_create() can, msg = options_instance.can_edit(request.user) if not can: - messages.error(request, msg or "Vous ne pouvez pas éditer cette\ - option.") + messages.error(request, msg or _("You don't have the right to edit" + " this option.")) return redirect(reverse('index')) options = form_instance( request.POST or None, @@ -114,11 +114,11 @@ def edit_options(request, section): options.save() reversion.set_user(request.user) reversion.set_comment( - "Champs modifié(s) : %s" % ', '.join( + "Field(s) edited: %s" % ', '.join( field for field in options.changed_data ) ) - messages.success(request, "Préférences modifiées") + messages.success(request, _("The preferences were edited.")) return redirect(reverse('preferences:display-options')) return form( {'options': options}, @@ -136,11 +136,11 @@ def add_service(request): with transaction.atomic(), reversion.create_revision(): service.save() reversion.set_user(request.user) - reversion.set_comment("Création") - messages.success(request, "Ce service a été ajouté") + reversion.set_comment("Creation") + messages.success(request, _("The service was added.")) return redirect(reverse('preferences:display-options')) return form( - {'preferenceform': service, 'action_name': 'Ajouter'}, + {'preferenceform': service, 'action_name': _("Add a service")}, 'preferences/preferences.html', request ) @@ -160,14 +160,14 @@ def edit_service(request, service_instance, **_kwargs): service.save() reversion.set_user(request.user) reversion.set_comment( - "Champs modifié(s) : %s" % ', '.join( + "Field(s) edited: %s" % ', '.join( field for field in service.changed_data ) ) - messages.success(request, "Service modifié") + messages.success(request, _("The service was edited.")) return redirect(reverse('preferences:display-options')) return form( - {'preferenceform': service, 'action_name': 'Editer'}, + {'preferenceform': service, 'action_name': _("Edit")}, 'preferences/preferences.html', request ) @@ -185,13 +185,13 @@ def del_service(request, instances): with transaction.atomic(), reversion.create_revision(): services_del.delete() reversion.set_user(request.user) - messages.success(request, "Le service a été supprimé") + messages.success(request, _("The service was deleted.")) except ProtectedError: - messages.error(request, "Erreur le service\ - suivant %s ne peut être supprimé" % services_del) + messages.error(request, _("Error: the service %s can't be" + " deleted.") % services_del) return redirect(reverse('preferences:display-options')) return form( - {'preferenceform': services, 'action_name': 'Supprimer'}, + {'preferenceform': services, 'action_name': _("Delete")}, 'preferences/preferences.html', request ) @@ -207,10 +207,11 @@ def add_mailcontact(request): ) if mailcontact.is_valid(): mailcontact.save() - messages.success(request, _("The adress was created.")) + messages.success(request, _("The contact email address was created.")) return redirect(reverse('preferences:display-options')) return form( - {'preferenceform': mailcontact, 'action_name': 'Ajouter'}, + {'preferenceform': mailcontact, + 'action_name': _("Add a contact email address")}, 'preferences/preferences.html', request ) @@ -227,10 +228,10 @@ def edit_mailcontact(request, mailcontact_instance, **_kwargs): ) if mailcontact.is_valid(): mailcontact.save() - messages.success(request, _("Email adress updated.")) + messages.success(request, _("The contact email address was edited.")) return redirect(reverse('preferences:display-options')) return form( - {'preferenceform': mailcontact, 'action_name': _('Edit')}, + {'preferenceform': mailcontact, 'action_name': _("Edit")}, 'preferences/preferences.html', request ) @@ -248,10 +249,12 @@ def del_mailcontact(request, instances): mailcontacts_dels = mailcontacts.cleaned_data['mailcontacts'] for mailcontacts_del in mailcontacts_dels: mailcontacts_del.delete() - messages.success(request, _("The email adress was deleted.")) + messages.success(request, + _("The contact email adress was deleted.")) return redirect(reverse('preferences:display-options')) return form( - {'preferenceform': mailcontacts, 'action_name': _('Delete')}, + {'preferenceform': mailcontacts, 'action_name': _("Delete")}, 'preferences/preferences.html', request ) +