diff --git a/users/acl.py b/users/acl.py index 8eca1e63..cb3a16db 100644 --- a/users/acl.py +++ b/users/acl.py @@ -25,7 +25,7 @@ Here are defined some functions to check acl on the application. """ - +from django.utils.translation import ugettext as _ def can_view(user): """Check if an user can view the application. @@ -38,4 +38,6 @@ def can_view(user): viewing is granted and msg is a message (can be None). """ can = user.has_module_perms('users') - 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/users/forms.py b/users/forms.py index dac86d71..f1b50652 100644 --- a/users/forms.py +++ b/users/forms.py @@ -39,6 +39,7 @@ from django.contrib.auth.forms import ReadOnlyPasswordHashField from django.core.validators import MinLengthValidator from django.utils import timezone from django.contrib.auth.models import Group, Permission +from django.utils.translation import ugettext_lazy as _ from preferences.models import OptionalUser from re2o.utils import remove_user_room, get_input_formats_help_text @@ -66,18 +67,18 @@ class PassForm(FormRevMixin, FieldPermissionFormMixin, forms.ModelForm): nouveaux mots de passe renseignés sont identiques et respectent une norme""" selfpasswd = forms.CharField( - label=u'Saisir le mot de passe existant', + label=_("Current password"), max_length=255, widget=forms.PasswordInput ) passwd1 = forms.CharField( - label=u'Nouveau mot de passe', + label=_("New password"), max_length=255, validators=[MinLengthValidator(8)], widget=forms.PasswordInput ) passwd2 = forms.CharField( - label=u'Saisir à nouveau le mot de passe', + label=_("New password confirmation"), max_length=255, validators=[MinLengthValidator(8)], widget=forms.PasswordInput @@ -94,7 +95,7 @@ class PassForm(FormRevMixin, FieldPermissionFormMixin, forms.ModelForm): password2 = self.cleaned_data.get("passwd2") if password1 and password2 and password1 != password2: raise forms.ValidationError( - "Les 2 nouveaux mots de passe sont différents" + _("The new passwords don't match.") ) return password2 @@ -103,7 +104,7 @@ class PassForm(FormRevMixin, FieldPermissionFormMixin, forms.ModelForm): if not self.instance.check_password( self.cleaned_data.get("selfpasswd") ): - raise forms.ValidationError("Le mot de passe actuel est incorrect") + raise forms.ValidationError(_("The current password is incorrect.")) return def save(self, commit=True): @@ -121,18 +122,18 @@ class UserCreationForm(FormRevMixin, forms.ModelForm): l'admin, lors de la creation d'un user par admin. Inclu tous les champs obligatoires""" password1 = forms.CharField( - label='Password', + label=_("Password"), widget=forms.PasswordInput, validators=[MinLengthValidator(8)], max_length=255 ) password2 = forms.CharField( - label='Password confirmation', + label=_("Password confirmation"), widget=forms.PasswordInput, validators=[MinLengthValidator(8)], max_length=255 ) - is_admin = forms.BooleanField(label='is admin') + is_admin = forms.BooleanField(label=_("Is admin")) def __init__(self, *args, **kwargs): prefix = kwargs.pop('prefix', self.Meta.model.__name__) @@ -142,7 +143,8 @@ class UserCreationForm(FormRevMixin, forms.ModelForm): if not OptionalUser.objects.first().local_email_domain in self.cleaned_data.get('email'): return self.cleaned_data.get('email').lower() else: - raise forms.ValidationError("You can't use an internal address as your external address.") + raise forms.ValidationError(_("You can't use an internal address" + " as your external address.")) class Meta: model = Adherent @@ -154,7 +156,7 @@ class UserCreationForm(FormRevMixin, forms.ModelForm): password1 = self.cleaned_data.get("password1") password2 = self.cleaned_data.get("password2") if password1 and password2 and password1 != password2: - raise forms.ValidationError("Passwords don't match") + raise forms.ValidationError(_("The passwords don't match.")) return password2 def save(self, commit=True): @@ -173,13 +175,13 @@ class ServiceUserCreationForm(FormRevMixin, forms.ModelForm): Formulaire pour la creation de nouveaux serviceusers. Requiert seulement un mot de passe; et un pseudo""" password1 = forms.CharField( - label='Password', + label=_("Password"), widget=forms.PasswordInput, min_length=8, max_length=255 ) password2 = forms.CharField( - label='Password confirmation', + label=_("Password confirmation"), widget=forms.PasswordInput, min_length=8, max_length=255 @@ -203,7 +205,7 @@ class ServiceUserCreationForm(FormRevMixin, forms.ModelForm): password1 = self.cleaned_data.get("password1") password2 = self.cleaned_data.get("password2") if password1 and password2 and password1 != password2: - raise forms.ValidationError("Passwords don't match") + raise forms.ValidationError(_("The passwords don't match.")) return password2 def save(self, commit=True): @@ -222,7 +224,7 @@ class UserChangeForm(FormRevMixin, forms.ModelForm): Formulaire pour la modification d'un user coté admin """ password = ReadOnlyPasswordHashField() - is_admin = forms.BooleanField(label='is admin', required=False) + is_admin = forms.BooleanField(label=_("Is admin"), required=False) class Meta: model = Adherent @@ -231,7 +233,7 @@ class UserChangeForm(FormRevMixin, forms.ModelForm): def __init__(self, *args, **kwargs): prefix = kwargs.pop('prefix', self.Meta.model.__name__) super(UserChangeForm, self).__init__(*args, prefix=prefix, **kwargs) - print("User is admin : %s" % kwargs['instance'].is_admin) + print(_("User is admin: %s") % kwargs['instance'].is_admin) self.initial['is_admin'] = kwargs['instance'].is_admin def clean_password(self): @@ -279,7 +281,7 @@ class ServiceUserChangeForm(FormRevMixin, forms.ModelForm): class ResetPasswordForm(forms.Form): """Formulaire de demande de reinitialisation de mot de passe, mdp oublié""" - pseudo = forms.CharField(label=u'Pseudo', max_length=255) + pseudo = forms.CharField(label=_("Username"), max_length=255) email = forms.EmailField(max_length=255) @@ -294,8 +296,9 @@ class MassArchiveForm(forms.Form): date = cleaned_data.get("date") if date: if date > timezone.now(): - raise forms.ValidationError("Impossible d'archiver des\ - utilisateurs dont la fin d'accès se situe dans le futur !") + raise forms.ValidationError(_("Impossible to archive users" + " whose end access date is in" + " the future.")) class AdherentForm(FormRevMixin, FieldPermissionFormMixin, ModelForm): @@ -305,20 +308,22 @@ class AdherentForm(FormRevMixin, FieldPermissionFormMixin, ModelForm): def __init__(self, *args, **kwargs): prefix = kwargs.pop('prefix', self.Meta.model.__name__) super(AdherentForm, self).__init__(*args, prefix=prefix, **kwargs) - self.fields['name'].label = 'Prénom' - self.fields['surname'].label = 'Nom' - self.fields['email'].label = 'Adresse mail' - self.fields['school'].label = 'Établissement' - self.fields['comment'].label = 'Commentaire' - self.fields['room'].label = 'Chambre' - self.fields['room'].empty_label = "Pas de chambre" - self.fields['school'].empty_label = "Séléctionner un établissement" + self.fields['name'].label = _("First name") + self.fields['surname'].label = _("Surname") + self.fields['email'].label = _("Email address") + self.fields['school'].label = _("School") + self.fields['comment'].label = _("Comment") + self.fields['room'].label = _("Room") + self.fields['room'].empty_label = _("No room") + self.fields['school'].empty_label = _("Select a school") def clean_email(self): if not OptionalUser.objects.first().local_email_domain in self.cleaned_data.get('email'): return self.cleaned_data.get('email').lower() else: - raise forms.ValidationError("Vous ne pouvez pas utiliser une addresse {}".format(OptionalUser.objects.first().local_email_domain)) + raise forms.ValidationError( + _("You can't use a {} address.").format( + OptionalUser.objects.first().local_email_domain)) class Meta: model = Adherent @@ -342,7 +347,7 @@ class AdherentForm(FormRevMixin, FieldPermissionFormMixin, ModelForm): telephone = self.cleaned_data['telephone'] if not telephone and OptionalUser.get_cached_value('is_tel_mandatory'): raise forms.ValidationError( - "Un numéro de téléphone valide est requis" + _("A valid telephone number is required.") ) return telephone @@ -353,7 +358,7 @@ class AdherentForm(FormRevMixin, FieldPermissionFormMixin, ModelForm): return gpg_fingerprint.replace(' ', '').upper() force = forms.BooleanField( - label="Forcer le déménagement ?", + label=_("Force the move?"), initial=False, required=False ) @@ -373,13 +378,13 @@ class ClubForm(FormRevMixin, FieldPermissionFormMixin, ModelForm): def __init__(self, *args, **kwargs): prefix = kwargs.pop('prefix', self.Meta.model.__name__) super(ClubForm, self).__init__(*args, prefix=prefix, **kwargs) - self.fields['surname'].label = 'Nom' - self.fields['school'].label = 'Établissement' - self.fields['comment'].label = 'Commentaire' - self.fields['room'].label = 'Local' - self.fields['room'].empty_label = "Pas de chambre" - self.fields['school'].empty_label = "Séléctionner un établissement" - self.fields['mailing'].label = 'Utiliser une mailing' + self.fields['surname'].label = _("Name") + self.fields['school'].label = _("School") + self.fields['comment'].label = _("Comment") + self.fields['room'].label = _("Room") + self.fields['room'].empty_label = _("No room") + self.fields['school'].empty_label = _("Select a school") + self.fields['mailing'].label = _("Use a mailing list") class Meta: model = Club @@ -400,7 +405,7 @@ class ClubForm(FormRevMixin, FieldPermissionFormMixin, ModelForm): telephone = self.cleaned_data['telephone'] if not telephone and OptionalUser.get_cached_value('is_tel_mandatory'): raise forms.ValidationError( - "Un numéro de téléphone valide est requis" + _("A valid telephone number is required.") ) return telephone @@ -436,7 +441,7 @@ class PasswordForm(FormRevMixin, ModelForm): class ServiceUserForm(FormRevMixin, ModelForm): """ Modification d'un service user""" password = forms.CharField( - label=u'Nouveau mot de passe', + label=_("New password"), max_length=255, validators=[MinLengthValidator(8)], widget=forms.PasswordInput, @@ -493,7 +498,7 @@ class GroupForm(FieldPermissionFormMixin, FormRevMixin, ModelForm): prefix = kwargs.pop('prefix', self.Meta.model.__name__) super(GroupForm, self).__init__(*args, prefix=prefix, **kwargs) if 'is_superuser' in self.fields: - self.fields['is_superuser'].label = "Superuser" + self.fields['is_superuser'].label = _("Superuser") class SchoolForm(FormRevMixin, ModelForm): @@ -505,7 +510,7 @@ class SchoolForm(FormRevMixin, ModelForm): def __init__(self, *args, **kwargs): prefix = kwargs.pop('prefix', self.Meta.model.__name__) super(SchoolForm, self).__init__(*args, prefix=prefix, **kwargs) - self.fields['name'].label = 'Établissement' + self.fields['name'].label = _("School") class ShellForm(FormRevMixin, ModelForm): @@ -517,7 +522,7 @@ class ShellForm(FormRevMixin, ModelForm): def __init__(self, *args, **kwargs): prefix = kwargs.pop('prefix', self.Meta.model.__name__) super(ShellForm, self).__init__(*args, prefix=prefix, **kwargs) - self.fields['shell'].label = 'Nom du shell' + self.fields['shell'].label = _("Shell name") class ListRightForm(FormRevMixin, ModelForm): @@ -536,7 +541,7 @@ class ListRightForm(FormRevMixin, ModelForm): def __init__(self, *args, **kwargs): prefix = kwargs.pop('prefix', self.Meta.model.__name__) super(ListRightForm, self).__init__(*args, prefix=prefix, **kwargs) - self.fields['unix_name'].label = 'Nom UNIX du groupe' + self.fields['unix_name'].label = _("Name of the group of rights") class NewListRightForm(ListRightForm): @@ -547,15 +552,15 @@ class NewListRightForm(ListRightForm): def __init__(self, *args, **kwargs): super(NewListRightForm, self).__init__(*args, **kwargs) - self.fields['gid'].label = ("Gid, attention, cet attribut ne doit " - "pas être modifié après création") + self.fields['gid'].label = _("GID. Warning: this field must not be" + " edited after creation.") class DelListRightForm(Form): """Suppression d'un ou plusieurs groupes""" listrights = forms.ModelMultipleChoiceField( queryset=ListRight.objects.none(), - label="Droits actuels", + label=_("Current groups of rights"), widget=forms.CheckboxSelectMultiple ) @@ -572,7 +577,7 @@ class DelSchoolForm(Form): """Suppression d'une ou plusieurs écoles""" schools = forms.ModelMultipleChoiceField( queryset=School.objects.none(), - label="Etablissements actuels", + label=_("Current schools"), widget=forms.CheckboxSelectMultiple ) @@ -590,7 +595,7 @@ class BanForm(FormRevMixin, ModelForm): def __init__(self, *args, **kwargs): prefix = kwargs.pop('prefix', self.Meta.model.__name__) super(BanForm, self).__init__(*args, prefix=prefix, **kwargs) - self.fields['date_end'].label = 'Date de fin' + self.fields['date_end'].label = _("End date") self.fields['date_end'].localize = False class Meta: @@ -604,7 +609,7 @@ class WhitelistForm(FormRevMixin, ModelForm): def __init__(self, *args, **kwargs): prefix = kwargs.pop('prefix', self.Meta.model.__name__) super(WhitelistForm, self).__init__(*args, prefix=prefix, **kwargs) - self.fields['date_end'].label = 'Date de fin' + self.fields['date_end'].label = _("End date") self.fields['date_end'].localize = False class Meta: @@ -618,8 +623,8 @@ class EMailAddressForm(FormRevMixin, ModelForm): def __init__(self, *args, **kwargs): prefix = kwargs.pop('prefix', self.Meta.model.__name__) super(EMailAddressForm, self).__init__(*args, prefix=prefix, **kwargs) - self.fields['local_part'].label = "Local part of the email" - self.fields['local_part'].help_text = "Can't contain @" + self.fields['local_part'].label = _("Local part of the email address") + self.fields['local_part'].help_text = _("Can't contain @") def clean_local_part(self): return self.cleaned_data.get('local_part').lower() @@ -634,18 +639,21 @@ class EmailSettingsForm(FormRevMixin, FieldPermissionFormMixin, ModelForm): def __init__(self, *args, **kwargs): prefix = kwargs.pop('prefix', self.Meta.model.__name__) super(EmailSettingsForm, self).__init__(*args, prefix=prefix, **kwargs) - self.fields['email'].label = "Main email address" + self.fields['email'].label = _("Main email address") if 'local_email_redirect' in self.fields: - self.fields['local_email_redirect'].label = "Redirect local emails" + self.fields['local_email_redirect'].label = _("Redirect local emails") if 'local_email_enabled' in self.fields: - self.fields['local_email_enabled'].label = "Use local emails" + self.fields['local_email_enabled'].label = _("Use local emails") def clean_email(self): if not OptionalUser.objects.first().local_email_domain in self.cleaned_data.get('email'): return self.cleaned_data.get('email').lower() else: - raise forms.ValidationError("Vous ne pouvez pas utiliser une addresse {}".format(OptionalUser.objects.first().local_email_domain)) + raise forms.ValidationError( + _("You can't use a {} address.").format( + OptionalUser.objects.first().local_email_domain)) class Meta: model = User fields = ['email','local_email_enabled', 'local_email_redirect'] + diff --git a/users/locale/fr/LC_MESSAGES/django.mo b/users/locale/fr/LC_MESSAGES/django.mo index 9808ced6..ef4052ce 100644 Binary files a/users/locale/fr/LC_MESSAGES/django.mo and b/users/locale/fr/LC_MESSAGES/django.mo differ diff --git a/users/locale/fr/LC_MESSAGES/django.po b/users/locale/fr/LC_MESSAGES/django.po index 2814cb83..6c637db9 100644 --- a/users/locale/fr/LC_MESSAGES/django.po +++ b/users/locale/fr/LC_MESSAGES/django.po @@ -21,9 +21,9 @@ msgid "" msgstr "" "Project-Id-Version: 2.5\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2018-06-28 00:06+0200\n" +"POT-Creation-Date: 2018-08-18 13:36+0200\n" "PO-Revision-Date: 2018-06-27 23:35+0200\n" -"Last-Translator: Maël Kervella \n" +"Last-Translator: Laouen Fernet \n" "Language-Team: \n" "Language: fr_FR\n" "MIME-Version: 1.0\n" @@ -31,93 +31,1343 @@ msgstr "" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=(n > 1);\n" -#: templates/users/aff_listright.html:37 -msgid "Superuser" -msgstr "Superuser" +#: acl.py:41 +msgid "You don't have the right to view this application." +msgstr "Vous n'avez pas le droit de voir cette application." -#: templates/users/aff_listright.html:39 +#: forms.py:70 +msgid "Current password" +msgstr "Mot de passe actuel" + +#: forms.py:75 forms.py:444 +msgid "New password" +msgstr "Nouveau mot de passe" + +#: forms.py:81 +msgid "New password confirmation" +msgstr "Confirmation du nouveau mot de passe" + +#: forms.py:98 +msgid "The new passwords don't match." +msgstr "Les nouveaux mots de passe ne correspondent pas." + +#: forms.py:107 +msgid "The current password is incorrect." +msgstr "Le mot de passe actuel est incorrect." + +#: forms.py:125 forms.py:178 models.py:1578 +msgid "Password" +msgstr "Mot de passe" + +#: forms.py:131 forms.py:184 +msgid "Password confirmation" +msgstr "Confirmation du mot de passe" + +#: forms.py:136 forms.py:227 +msgid "Is admin" +msgstr "Est admin" + +#: forms.py:146 +msgid "You can't use an internal address as your external address." +msgstr "" +"Vous ne pouvez pas utiliser une adresse interne pour votre adresse externe." + +#: forms.py:159 forms.py:208 +msgid "The passwords don't match." +msgstr "Les mots de passe ne correspondent pas." + +#: forms.py:236 +#, python-format +msgid "User is admin: %s" +msgstr "L'utilisateur est admin : %s" + +#: forms.py:284 templates/users/aff_clubs.html:38 +#: templates/users/aff_listright.html:63 templates/users/aff_listright.html:168 +#: templates/users/aff_users.html:39 templates/users/profil.html:165 +#: templates/users/profil.html:279 templates/users/profil.html:298 +msgid "Username" +msgstr "Pseudo" + +#: forms.py:299 +msgid "Impossible to archive users whose end access date is in the future." +msgstr "" +"Impossible d'archiver des utilisateurs dont la date de fin de connexion est " +"dans le futur." + +#: forms.py:311 templates/users/profil.html:278 templates/users/profil.html:297 +msgid "First name" +msgstr "Prénom" + +#: forms.py:312 templates/users/aff_users.html:37 +#: templates/users/profil.html:161 templates/users/profil.html:277 +#: templates/users/profil.html:296 +msgid "Surname" +msgstr "Nom" + +#: forms.py:313 models.py:1579 templates/users/aff_emailaddress.html:36 +#: templates/users/profil.html:167 +msgid "Email address" +msgstr "Adresse mail" + +#: forms.py:314 forms.py:382 forms.py:513 templates/users/aff_schools.html:37 +#: templates/users/profil.html:177 +msgid "School" +msgstr "Établissement" + +#: forms.py:315 forms.py:383 models.py:1232 +#: templates/users/aff_serviceusers.html:34 templates/users/profil.html:179 +msgid "Comment" +msgstr "Commentaire" + +#: forms.py:316 forms.py:384 templates/users/aff_clubs.html:40 +#: templates/users/aff_users.html:41 templates/users/profil.html:171 +msgid "Room" +msgstr "Chambre" + +#: forms.py:317 forms.py:385 +msgid "No room" +msgstr "Pas de chambre" + +#: forms.py:318 forms.py:386 +msgid "Select a school" +msgstr "Sélectionnez un établissement" + +#: forms.py:325 forms.py:653 +msgid "You can't use a {} address." +msgstr "Vous ne pouvez pas utiliser une adresse {}." + +#: forms.py:350 forms.py:408 +msgid "A valid telephone number is required." +msgstr "Un numéro de téléphone valide est requis." + +#: forms.py:361 +msgid "Force the move?" +msgstr "Forcer le déménagement ?" + +#: forms.py:381 templates/users/aff_clubs.html:36 +#: templates/users/aff_serviceusers.html:32 +msgid "Name" +msgstr "Nom" + +#: forms.py:387 +msgid "Use a mailing list" +msgstr "Utiliser une liste de diffusion" + +#: forms.py:501 templates/users/aff_listright.html:38 +msgid "Superuser" +msgstr "Superutilisateur" + +#: forms.py:525 +msgid "Shell name" +msgstr "Nom de l'interface système" + +#: forms.py:544 +msgid "Name of the group of rights" +msgstr "Nom du groupe de droits" + +#: forms.py:555 +msgid "GID. Warning: this field must not be edited after creation." +msgstr "GID. Attention : ce champ ne doit pas être modifié après création." + +#: forms.py:563 +msgid "Current groups of rights" +msgstr "Groupes de droits actuels" + +#: forms.py:580 +msgid "Current schools" +msgstr "Établissements actuels" + +#: forms.py:598 forms.py:612 templates/users/aff_bans.html:41 +#: templates/users/aff_whitelists.html:41 +msgid "End date" +msgstr "Date de fin" + +#: forms.py:626 models.py:1776 +msgid "Local part of the email address" +msgstr "Partie locale de l'adresse mail" + +#: forms.py:627 +msgid "Can't contain @" +msgstr "Ne peut pas contenir @" + +#: forms.py:642 +msgid "Main email address" +msgstr "Adresse mail principale" + +#: forms.py:644 +msgid "Redirect local emails" +msgstr "Rediriger les mails locaux" + +#: forms.py:646 +msgid "Use local emails" +msgstr "Utiliser les mails locaux" + +#: models.py:105 +#, python-format +msgid "The username '%(label)s' contains forbidden characters." +msgstr "Le pseudo '%(label)s' contient des caractères interdits." + +#: models.py:147 +msgid "Users must have an username." +msgstr "Les utilisateurs doivent avoir un pseudo." + +#: models.py:150 +msgid "Username should only contain [a-z0-9-]." +msgstr "Le pseudo devrait seulement contenir [a-z0-9-]" + +#: models.py:199 models.py:1223 +msgid "Must only contain letters, numerals or dashes." +msgstr "Doit seulement contenir des lettres, chiffres ou tirets." + +#: models.py:205 +msgid "External email address allowing us to contact you." +msgstr "Adresse mail externe nous permettant de vous contacter." + +#: models.py:209 +msgid "" +"Enable redirection of the local email messages to the main email address." +msgstr "" +"Activer la redirection des mails locaux vers l'adresse mail principale." + +#: models.py:214 +msgid "Enable the local email account." +msgstr "Activer le compte mail local" + +#: models.py:229 +msgid "Comment, school year" +msgstr "Commentaire, promotion" + +#: models.py:255 models.py:1033 models.py:1106 +msgid "Can change the password of a user" +msgstr "Peut changer le mot de passe d'un utilisateur" + +#: models.py:256 models.py:1034 models.py:1107 +msgid "Can edit the state of a user" +msgstr "Peut changer l'état d'un utilisateur" + +#: models.py:257 models.py:1035 models.py:1108 +msgid "Can force the move" +msgstr "Peut forcer le déménagement" + +#: models.py:258 models.py:1036 models.py:1109 +msgid "Can edit the shell of a user" +msgstr "Peut modifier l'interface système d'un utilisateur" + +#: models.py:260 models.py:1038 models.py:1111 +msgid "Can edit the groups of rights of a user (critical permission)" +msgstr "" +"Peut modifier les groupes de droits d'un utilisateur (permission critique)" + +#: models.py:263 models.py:1041 models.py:1114 +msgid "Can edit all users, including those with rights." +msgstr "" +"Peut modifier tous les utilisateurs, y compris ceux possédant des droits." + +#: models.py:265 models.py:1043 models.py:1116 +msgid "Can view a user object" +msgstr "Peut voir un objet utilisateur" + +#: models.py:267 +msgid "user (member or club)" +msgstr "utilisateur (adhérent ou club)" + +#: models.py:268 +msgid "users (members or clubs)" +msgstr "utilisateurs (adhérents ou clubs)" + +#: models.py:286 models.py:310 +msgid "Unknown type." +msgstr "Type inconnu." + +#: models.py:306 templates/users/aff_listright.html:75 +#: templates/users/aff_listright.html:180 +msgid "Member" +msgstr "Adhérent" + +#: models.py:308 +msgid "Club" +msgstr "Club" + +#: models.py:521 +msgid "IPv4 assigning" +msgstr "Attribution de l'IPv4" + +#: models.py:530 +msgid "IPv4 unassigning" +msgstr "Désattribution de l'IPv4" + +#: models.py:677 +msgid "Maximum number of registered machines reached." +msgstr "Nombre maximum de machines enregistrées atteint." + +#: models.py:679 +msgid "Re2o doesn't know wich machine type to assign." +msgstr "Re2o ne sait pas quel type de machine attribuer." + +#: models.py:775 models.py:812 +msgid "You don't have the right to edit this club." +msgstr "Vous n'avez pas le droit de modifier ce club." + +#: models.py:783 +msgid "User with critical rights, can't be edited." +msgstr "Utilisateur avec des droits critiques, ne peut être modifié." + +#: models.py:786 +msgid "" +"Impossible to edit the organisation's user without the 'change_all_users' " +"right." +msgstr "" +"Impossible de modifier l'utilisateur de l'association sans le droit " +"'change_all_users'." + +#: models.py:794 models.py:823 +msgid "You don't have the right to edit another user." +msgstr "Vous n'avez pas le droit de modifier un autre utilisateur." + +#: models.py:842 +msgid "Permission required to change the state." +msgstr "Permission requise pour changer l'état." + +#: models.py:854 +msgid "Permission required to change the shell." +msgstr "Permission requise pour changer l'interface système." + +#: models.py:868 models.py:881 +msgid "Local email accounts must be enabled." +msgstr "Les comptes mail locaux doivent être activés." + +#: models.py:894 +msgid "Permission required to force the move." +msgstr "Permission requise pour forcer le déménagement." + +#: models.py:907 +msgid "Permission required to edit the user's groups of rights." +msgstr "" +"Permission requise pour modifier les groupes de droits de l'utilisateur." + +#: models.py:919 +msgid "'superuser' right required to edit the superuser flag." +msgstr "Droit 'superuser' requis pour modifier le signalement superuser." + +#: models.py:937 +msgid "You don't have the right to view this club." +msgstr "Vous n'avez pas le droit de voir ce club." + +#: models.py:943 +msgid "You don't have the right to view another user." +msgstr "Vous n'avez pas le droit de voir un autre utilisateur." + +#: models.py:956 models.py:1155 +msgid "You don't have the right to view the list of users." +msgstr "Vous n'avez pas le droit de voir la liste des utilisateurs." + +#: models.py:969 +msgid "You don't have the right to delete this user." +msgstr "Vous n'avez pas le droit de supprimer cet utilisateur." + +#: models.py:993 +msgid "" +"There is neither a local email address nor an external email address for " +"this user." +msgstr "" +"Il n'y a pas d'adresse mail locale ni d'adresse mail externe pour cet " +"utilisateur." + +#: models.py:1000 +msgid "" +"You can't redirect your local emails if no external email address has been " +"set." +msgstr "" +"Vous ne pouvez pas rediriger vos mails locaux si aucune adresse mail externe " +"n'a été définie." + +#: models.py:1025 +msgid "A GPG fingerprint must contain 40 hexadecimal characters." +msgstr "Une empreinte GPG doit contenir 40 caractères hexadécimaux." + +#: models.py:1045 +msgid "member" +msgstr "adhérent" + +#: models.py:1046 +msgid "members" +msgstr "adhérents" + +#: models.py:1075 +msgid "You don't have the right to create a user." +msgstr "Vous n'avez pas le droit de créer un utilisateur." + +#: models.py:1118 +msgid "club" +msgstr "club" + +#: models.py:1119 +msgid "clubs" +msgstr "clubs" + +#: models.py:1137 +msgid "You don't have the right to create a club." +msgstr "Vous n'avez pas le droit de créer un club." + +#: models.py:1242 +msgid "Can view a service user object" +msgstr "Peut voir un objet utilisateur service" + +#: models.py:1244 +msgid "service user" +msgstr "utilisateur service" + +#: models.py:1245 +msgid "service users" +msgstr "utilisateurs service" + +#: models.py:1249 +#, python-brace-format +msgid "Service user <{name}>" +msgstr "Utilisateur service <{name}>" + +#: models.py:1311 +msgid "Can view a school object" +msgstr "Peut voir un objet établissement" + +#: models.py:1313 +msgid "school" +msgstr "établissement" + +#: models.py:1314 +msgid "schools" +msgstr "établissements" + +#: models.py:1332 +msgid "UNIX groups can only contain lower case letters." +msgstr "Les groupes UNIX peuvent seulement contenir des lettres minuscules." + +#: models.py:1338 +msgid "Description" +msgstr "Description" + +#: models.py:1345 +msgid "Can view a group of rights object" +msgstr "Peut voir un objet groupe de droits" + +#: models.py:1347 +msgid "group of rights" +msgstr "groupe de droits" + +#: models.py:1348 +msgid "groups of rights" +msgstr "groupes de droits" + +#: models.py:1395 +msgid "Can view a shell object" +msgstr "Peut voir un objet interface système" + +#: models.py:1397 +msgid "shell" +msgstr "interface système" + +#: models.py:1398 +msgid "shells" +msgstr "interfaces système" + +#: models.py:1417 +msgid "HARD (no access)" +msgstr "HARD (pas d'accès)" + +#: models.py:1418 +msgid "SOFT (local access only)" +msgstr "SOFT (accès local uniquement)" + +#: models.py:1419 +msgid "RESTRICTED (speed limitation)" +msgstr "RESTRICTED (limitation de vitesse)" + +#: models.py:1430 +msgid "Can view a ban object" +msgstr "Peut voir un objet bannissement" + +#: models.py:1432 +msgid "ban" +msgstr "bannissement" + +#: models.py:1433 +msgid "bans" +msgstr "bannissements" + +#: models.py:1467 +msgid "You don't have the right to view bans other than yours." +msgstr "" +"Vous n'avez pas le droit de voir des bannissements autres que les vôtres." + +#: models.py:1515 +msgid "Can view a whitelist object" +msgstr "Peut voir un objet accès gracieux" + +#: models.py:1517 +msgid "whitelist (free of charge access)" +msgstr "Accès gracieux" + +#: models.py:1518 +msgid "whitelists (free of charge access)" +msgstr "Accès gracieux" + +#: models.py:1534 +msgid "You don't have the right to view whitelists other than yours." +msgstr "" +"Vous n'avez pas le droit de voir des accès gracieux autres que les vôtres." + +#: models.py:1771 +msgid "User of the local email account" +msgstr "Utilisateur du compte mail local" + +#: models.py:1781 +msgid "Can view a local email account object" +msgstr "Peut voir un objet compte mail local" + +#: models.py:1783 +msgid "local email account" +msgstr "compte mail local" + +#: models.py:1784 +msgid "local email accounts" +msgstr "comptes mail locaux" + +#: models.py:1808 models.py:1831 models.py:1853 models.py:1875 +msgid "The local email accounts are not enabled." +msgstr "Les comptes mail locaux ne sont pas activés." + +#: models.py:1810 +msgid "You don't have the right to add a local email account to another user." +msgstr "" +"Vous n'avez pas le droit d'ajouter un compte mail local à un autre " +"utilisateur." + +#: models.py:1813 +msgid "You reached the limit of {} local email accounts." +msgstr "Vous avez atteint la limite de {] comptes mail locaux." + +#: models.py:1834 models.py:1878 +msgid "You don't have the right to edit another user's local email account." +msgstr "" +"Vous n'avez pas le droit de modifier le compte mail local d'un autre " +"utilisateur." + +#: models.py:1848 +msgid "" +"You can't delete a local email account whose local part is the same as the " +"username." +msgstr "" +"Vous ne pouvez pas supprimer un compte mail local dont la partie locale est " +"la même que le pseudo." + +#: models.py:1856 +msgid "You don't have the right to delete another user's local email account" +msgstr "" +"Vous n'avez pas le droit de supprimer le compte mail local d'un autre " +"utilisateur." + +#: models.py:1870 +msgid "" +"You can't edit a local email account whose local part is the same as the " +"username." +msgstr "" +"Vous ne pouvez pas modifier un compte mail local dont la partie locale est " +"la même que le pseudo." + +#: models.py:1884 +msgid "The local part must not contain @." +msgstr "La partie locale ne doit pas contenir @." + +#: templates/users/aff_bans.html:36 templates/users/aff_whitelists.html:36 +msgid "User" +msgstr "Utilisateur" + +#: templates/users/aff_bans.html:38 templates/users/aff_whitelists.html:38 +msgid "Reason" +msgstr "Raison" + +#: templates/users/aff_bans.html:39 templates/users/aff_whitelists.html:39 +msgid "Start date" +msgstr "Date de début" + +#: templates/users/aff_clubs.html:42 templates/users/aff_users.html:43 +msgid "End of subscription on" +msgstr "Fin de cotisation le" + +#: templates/users/aff_clubs.html:43 templates/users/aff_users.html:44 +#: templates/users/profil.html:218 +msgid "Internet access" +msgstr "Accès Internet" + +#: templates/users/aff_clubs.html:44 templates/users/aff_users.html:45 +#: templates/users/profil.html:32 +msgid "Profile" +msgstr "Profil" + +#: templates/users/aff_clubs.html:53 templates/users/aff_users.html:54 +#: templates/users/profil.html:193 +msgid "Not a member" +msgstr "Non adhérent" + +#: templates/users/aff_clubs.html:55 templates/users/aff_users.html:57 +#: templates/users/profil.html:210 +msgid "Active" +msgstr "Actif" + +#: templates/users/aff_clubs.html:57 templates/users/aff_users.html:59 +#: templates/users/profil.html:212 templates/users/profil.html:222 +msgid "Disabled" +msgstr "Désactivé" + +#: templates/users/aff_listright.html:40 msgid "Django's specific pre-defined right that supersed any other rights." msgstr "" "Droit prédéfini spécifique à Django qui outrepasse tous les autres droits." -#: templates/users/aff_listright.html:43 +#: templates/users/aff_listright.html:44 msgid "Total: All permissions" msgstr "Total: Toutes les permissions" -#: templates/users/aff_listright.html:55 +#: templates/users/aff_listright.html:56 msgid "Users in Superuser" msgstr "Utilisateurs dans Superuser" -#: templates/users/aff_listright.html:62 templates/users/aff_listright.html:167 -msgid "Username" -msgstr "Pseudo" - -#: templates/users/aff_listright.html:63 templates/users/aff_listright.html:168 +#: templates/users/aff_listright.html:64 templates/users/aff_listright.html:169 msgid "Membership" msgstr "Adhésion" -#: templates/users/aff_listright.html:64 templates/users/aff_listright.html:169 +#: templates/users/aff_listright.html:65 templates/users/aff_listright.html:170 msgid "Last seen" msgstr "Dernière connexion" -#: templates/users/aff_listright.html:65 templates/users/aff_listright.html:170 +#: templates/users/aff_listright.html:66 templates/users/aff_listright.html:171 msgid "Actions" msgstr "Actions" -#: templates/users/aff_listright.html:66 templates/users/aff_listright.html:171 +#: templates/users/aff_listright.html:67 templates/users/aff_listright.html:172 msgid "Last action" msgstr "Dernière action" -#: templates/users/aff_listright.html:74 templates/users/aff_listright.html:179 -msgid "Member" -msgstr "Adhérent" - -#: templates/users/aff_listright.html:76 templates/users/aff_listright.html:181 +#: templates/users/aff_listright.html:77 templates/users/aff_listright.html:182 msgid "No membership records" msgstr "Aucune adhésion" -#: templates/users/aff_listright.html:79 templates/users/aff_listright.html:184 +#: templates/users/aff_listright.html:80 templates/users/aff_listright.html:185 #, python-format msgid "Not since %(end_date)s" msgstr "Plus depuis %(end_date)s" -#: templates/users/aff_listright.html:87 templates/users/aff_listright.html:192 +#: templates/users/aff_listright.html:88 templates/users/aff_listright.html:193 msgid "Never" msgstr "Jamais" -#: templates/users/aff_listright.html:122 +#: templates/users/aff_listright.html:123 #, python-format msgid "%(right_name)s (gid: %(right_gid)s)" msgstr "%(right_name)s (gid: %(right_gid)s)" -#: templates/users/aff_listright.html:131 +#: templates/users/aff_listright.html:132 #, python-format msgid "Total: %(perm_count)s permission" msgid_plural "Total: %(perm_count)s permissions" msgstr[0] "Total: %(perm_count)s permission" msgstr[1] "Total: %(perm_count)s permissions" -#: templates/users/aff_listright.html:157 +#: templates/users/aff_listright.html:158 #, python-format msgid "Users in %(right_name)s" msgstr "Utilisateurs dans %(right_name)s" +#: templates/users/aff_serviceusers.html:33 +msgid "Role" +msgstr "Rôle" + +#: templates/users/aff_shell.html:32 templates/users/profil.html:248 +msgid "Shell" +msgstr "Interface système" + +#: templates/users/aff_users.html:35 templates/users/profil.html:158 +msgid "Firt name" +msgstr "Prénom" + +#: templates/users/delete.html:29 +msgid "Deletion of objects" +msgstr "Suppression d'objets" + +#: templates/users/delete.html:35 +#, python-format +msgid "" +"Warning: are you sure you want to delete this %(objet_name)s object " +"( %(objet)s )?" +msgstr "" +"Attention : voulez-vous vraiment supprimer cet objet %(objet_name)s " +"( %(objet)s ) ?" + +#: templates/users/delete.html:36 templates/users/mass_archive.html:36 +msgid "Confirm" +msgstr "Confirmer" + +#: templates/users/index.html:29 templates/users/index.html:32 +#: templates/users/index_ban.html:29 templates/users/index_clubs.html:29 +#: templates/users/index_emailaddress.html:29 +#: templates/users/index_listright.html:30 templates/users/index_rights.html:29 +#: templates/users/index_schools.html:30 +#: templates/users/index_serviceusers.html:30 +#: templates/users/index_shell.html:30 templates/users/index_whitelist.html:29 +#: templates/users/sidebar.html:52 templates/users/user.html:30 +msgid "Users" +msgstr "Utilisateurs" + +#: templates/users/index_ban.html:32 templates/users/profil.html:373 +#: templates/users/sidebar.html:58 +msgid "Bans" +msgstr "Bannissements" + +#: templates/users/index_clubs.html:32 +msgid "Clubs" +msgstr "Clubs" + +#: templates/users/index_emailaddress.html:32 +msgid "Local email accounts" +msgstr "Comptes mail locaux" + +#: templates/users/index_listright.html:33 +msgid "List of groups of rights" +msgstr "Liste des groupes de droits" + +#: templates/users/index_listright.html:35 +msgid " Add a group of rights" +msgstr " Ajouter un groupe de droits" + +#: templates/users/index_listright.html:37 +msgid " Delete one or several groups of rights" +msgstr " Supprimer un ou plusieurs groupes de droits" + +#: templates/users/index_rights.html:32 +msgid "Rights" +msgstr "Droits" + +#: templates/users/index_schools.html:33 +msgid "List of schools" +msgstr "Liste des établissements" + +#: templates/users/index_schools.html:34 +msgid "List of schools for created users." +msgstr "Liste des établissement pour les utilisateurs créés." + +#: templates/users/index_schools.html:36 +msgid " Add a school" +msgstr " Ajouter un établissement" + +#: templates/users/index_schools.html:38 +msgid " Delete one or several schools" +msgstr " Supprimer un ou plusieurs établissements" + +#: templates/users/index_serviceusers.html:33 +msgid "List of LDAP service users" +msgstr "Liste des utilisateurs service LDAP" + +#: templates/users/index_serviceusers.html:34 +msgid "" +"The LDAP service users are special users having access only to the LDAP for " +"authentication operations. It is recommended to create a service user with a " +"login and a password for any concerned service." +msgstr "" +"Les utilisateurs service sont des utilisateurs spéciaux ayant accès " +"seulement au LDAP pour des opérations d'authentification. Il est recommandé " +"de créer un service utilisateur avec un indentifiant et un mot de passe." + +#: templates/users/index_serviceusers.html:36 +msgid " Add a service user" +msgstr " Ajouter un utilisateur" + +#: templates/users/index_shell.html:33 +msgid "List of shells" +msgstr "Liste des interaces système" + +#: templates/users/index_shell.html:35 +msgid " Add a shell" +msgstr " Ajouter une interface système" + +#: templates/users/index_whitelist.html:32 templates/users/profil.html:398 +#: templates/users/sidebar.html:64 +msgid "Whitelists" +msgstr "Accès gracieux" + +#: templates/users/mass_archive.html:29 +msgid "Users to archive" +msgstr "Utilisateurs à archiver" + +#: templates/users/mass_archive.html:35 +msgid "Search" +msgstr "Rechercher" + +#: templates/users/mass_archive.html:39 +#, python-format +msgid "The following users will be archived (%(to_archive_list|length)s):" +msgstr "" +"Les utilisateus suivants vont être archivés (%(to_archive_list|length)s :" + +#: templates/users/profil.html:37 +#, python-format +msgid "Welcome %(name)s %(surname)s" +msgstr "Bienvenue %(name)s %(surname)s" + +#: templates/users/profil.html:39 +#, python-format +msgid "Profile of %(name)s %(surname)s" +msgstr "Profil de %(name)s %(surname)s" + +#: templates/users/profil.html:47 +msgid "Your account has been banned" +msgstr "Votre compte a été banni" + +#: templates/users/profil.html:49 +#, python-format +msgid "End of the ban: %(end_ban)s" +msgstr "Fin du bannissement : %(end_ban)s" + +#: templates/users/profil.html:54 +msgid "No connection" +msgstr "Pas de connexion" + +#: templates/users/profil.html:58 +msgid "Pay for a connection" +msgstr "Payer une connexion" + +#: templates/users/profil.html:61 +msgid "Ask for someone with the appropriate rights to pay for a connection." +msgstr "" +"Demandez à quelqu'un ayant les droits appropriés de payer une connexion." + +#: templates/users/profil.html:67 +msgid "Connection" +msgstr "Connexion" + +#: templates/users/profil.html:69 +#, python-format +msgid "End of connection: %(end_connection)s" +msgstr "Fin de connexion : %(end_connection)s" + +#: templates/users/profil.html:82 +msgid "Refill the balance" +msgstr "Recharger le solde" + +#: templates/users/profil.html:92 +msgid " Machines" +msgstr " Machines" + +#: templates/users/profil.html:96 templates/users/profil.html:105 +msgid " Add a machine" +msgstr " Ajouter une machine" + +#: templates/users/profil.html:102 templates/users/profil.html:333 +msgid "No machine" +msgstr "Pas de machine" + +#: templates/users/profil.html:118 +msgid " Detailed information" +msgstr " Informations détaillées" + +#: templates/users/profil.html:125 +msgid "Edit" +msgstr "Modifier" + +#: templates/users/profil.html:129 views.py:282 views.py:1079 +msgid "Change the password" +msgstr "Changer le mot de passe" + +#: templates/users/profil.html:134 +msgid "Change the state" +msgstr "Changer l'état" + +#: templates/users/profil.html:140 views.py:260 +msgid "Edit the groups" +msgstr "Modifier les groupes" + +#: templates/users/profil.html:151 +msgid "Mailing" +msgstr "Envoi de mails" + +#: templates/users/profil.html:155 +msgid "Mailing disabled" +msgstr "Envoi de mails désactivé" + +#: templates/users/profil.html:173 +msgid "Telephone number" +msgstr "Numéro de téléphone" + +#: templates/users/profil.html:183 +msgid "Registration date" +msgstr "Date d'inscription" + +#: templates/users/profil.html:185 +msgid "Last login" +msgstr "Dernière connexion" + +#: templates/users/profil.html:189 +msgid "End of membership" +msgstr "Fin d'adhésion" + +#: templates/users/profil.html:195 +msgid "Whitelist" +msgstr "Accès gracieux" + +#: templates/users/profil.html:199 templates/users/profil.html:228 +msgid "None" +msgstr "Aucun" + +#: templates/users/profil.html:202 +msgid "Ban" +msgstr "Bannissement" + +#: templates/users/profil.html:206 +msgid "Not banned" +msgstr "Non banni" + +#: templates/users/profil.html:208 +msgid "State" +msgstr "État" + +#: templates/users/profil.html:214 +msgid "Archived" +msgstr "Archivé" + +#: templates/users/profil.html:220 +#, python-format +msgid "Active (until %(end_access)s)" +msgstr "Actif (jusqu'au %(end_access)s)" + +#: templates/users/profil.html:224 templates/users/sidebar.html:82 +msgid "Groups of rights" +msgstr "Groupes de droits" + +#: templates/users/profil.html:232 +msgid "Balance" +msgstr "Solde" + +#: templates/users/profil.html:237 +msgid "Refill" +msgstr "Rechager" + +#: templates/users/profil.html:242 +msgid "GPG fingerprint" +msgstr "Empreinte GPG" + +#: templates/users/profil.html:261 +msgid " Manage the club" +msgstr " Gérer le club" + +#: templates/users/profil.html:268 +msgid "Manage the admins and members" +msgstr "Gérer les admins et les membres" + +#: templates/users/profil.html:272 +msgid "Club admins" +msgstr "Admins du clubs" + +#: templates/users/profil.html:291 +msgid "Members" +msgstr "Adhérents" + +#: templates/users/profil.html:318 +msgid "Machines" +msgstr "Machines" + +#: templates/users/profil.html:326 +msgid "Add a machine" +msgstr "Ajouter une machine" + +#: templates/users/profil.html:342 +msgid "Subscriptions" +msgstr "Cotisations" + +#: templates/users/profil.html:350 +msgid "Add as subscription" +msgstr "Ajouter une cotisation" + +#: templates/users/profil.html:355 +msgid "Edit the balance" +msgstr "Modifier le solde" + +#: templates/users/profil.html:364 +msgid "No invoice" +msgstr "Pas de facture" + +#: templates/users/profil.html:381 views.py:384 +msgid "Add a ban" +msgstr "Ajouter un bannissement" + +#: templates/users/profil.html:389 +msgid "No ban" +msgstr "Pas de bannissement" + +#: templates/users/profil.html:406 +msgid "Grant a whitelist" +msgstr "Donner un accès gracieux" + +#: templates/users/profil.html:414 +msgid "No whitelist" +msgstr "Pas d'accès gracieux" + +#: templates/users/profil.html:422 +msgid " Email settings" +msgstr " Paramètres mail" + +#: templates/users/profil.html:429 +msgid " Edit email settings" +msgstr " Modifier les paramètres mail" + +#: templates/users/profil.html:438 templates/users/profil.html:464 +msgid "Contact email address" +msgstr "Adresse mail de contact" + +#: templates/users/profil.html:442 +msgid "Enable the local email account" +msgstr "Activer le compte mail local" + +#: templates/users/profil.html:444 +msgid "Enable the local email redirection" +msgstr "Activer la redirection mail locale" + +#: templates/users/profil.html:448 +msgid "" +"The contact email address is the email address where we send emails to " +"contact you. If you would like to use your external email address for that, " +"you can either disable your local email address or enable the local email " +"redirection." +msgstr "" +"L'adresse mail de contact est l'adresse mail où nous envoyons des mails pour " +"vous contacter. Si vous voulez utiliser votre adresse mail externe pour " +"cela, vous pouvez soit désactiver votre adresse mail locale soit activer la " +"redirection des mails locaux." + +#: templates/users/profil.html:453 +msgid " Add an email address" +msgstr " Ajouter une adresse mail" + +#: templates/users/sidebar.html:33 +msgid "Create a club or organisation" +msgstr "Créer un club ou une association" + +#: templates/users/sidebar.html:39 views.py:134 +msgid "Create a user" +msgstr "Créer un utilisateur" + +#: templates/users/sidebar.html:46 +msgid "Clubs and organisations" +msgstr "Clubs et associations" + +#: templates/users/sidebar.html:70 +msgid "Schools" +msgstr "Établissements" + +#: templates/users/sidebar.html:76 +msgid "Shells" +msgstr "Interfaces système" + +#: templates/users/sidebar.html:88 +msgid "Service users" +msgstr "Utilisateurs service" + +#: templates/users/sidebar.html:94 +msgid "Massively archive" +msgstr "Archiver en masse" + +#: templates/users/user.html:45 +msgid "By clicking 'Create or edit', the user commits to respect the " +msgstr "" +"En cliquant sur 'Créer ou modifier', l 'utilisateur s'engage à respecter les" + +#: templates/users/user.html:45 +msgid "General Terms of Use" +msgstr "Conditions Générales d'Utilisation" + +#: templates/users/user.html:46 +msgid "Summary of the General Terms of Use" +msgstr "Résumé des Conditions Générales d'Utilisation" + +#: views.py:122 +#, python-format +msgid "The user %s was created, an email to set the password was sent." +msgstr "" +"L'utilisateur %s a été créé, un mail pour initialiser le mot de passe a été " +"envoyé." + +#: views.py:151 +#, python-format +msgid "The club %s was created, an email to set the password was sent." +msgstr "" +"Le club %s a été créé, un mail pour initialiser le mot de passe a été envoyé." + +#: views.py:158 +msgid "Create a club" +msgstr "Créer un club" + +#: views.py:176 +msgid "The club was edited." +msgstr "Le club a été modifié." + +#: views.py:185 +msgid "Edit the admins and members" +msgstr "Modifier les admins et les membres" + +#: views.py:213 +msgid "The user was edited." +msgstr "L'utilisateur a été modifié." + +#: views.py:219 +msgid "Edit the user" +msgstr "Modifier l'utilisateur" + +#: views.py:233 +msgid "The state was edited." +msgstr "L'état a été modifié." + +#: views.py:239 +msgid "Edit the state" +msgstr "Modifier l'état" + +#: views.py:254 +msgid "The groups were edited." +msgstr "Les groupes ont été modifiés." + +#: views.py:276 views.py:1076 +msgid "The password was changed." +msgstr "Le mot de passe a été changé." + +#: views.py:294 +#, python-format +msgid "%s was removed from the group." +msgstr "%s a été retiré du groupe." + +#: views.py:304 +#, python-format +msgid "%s is no longer superuser." +msgstr "%s n'est plus superutilisateur." + +#: views.py:317 +msgid "The service user was created." +msgstr "L'utilisateur service a été créé." + +#: views.py:321 +msgid "Create a service user" +msgstr "Créer un utilisateur service" + +#: views.py:338 +msgid "The service user was edited." +msgstr "L'utilisateur service a été modifié." + +#: views.py:341 +msgid "Edit a service user" +msgstr "Modifier un utilisateur service" + +#: views.py:353 +msgid "The service user was deleted." +msgstr "L'utilisateur service a été supprimé." + +#: views.py:373 +msgid "The ban was added." +msgstr "Le bannissement a été ajouté." + +#: views.py:381 +msgid "Warning: this user already has an active ban." +msgstr "Attention : cet utilisateur a déjà un bannissement actif." + +#: views.py:400 +msgid "The ban was edited." +msgstr "Le bannissement a été modifié." + +#: views.py:403 +msgid "Edit a ban" +msgstr "Modifier un bannissement" + +#: views.py:415 +msgid "The ban was deleted." +msgstr "Le bannissement a été supprimé." + +#: views.py:442 +msgid "The whitelist was added." +msgstr "L'accès gracieux a été ajouté." + +#: views.py:450 +msgid "Warning: this user already has an active whitelist." +msgstr "Attention : cet utilisateur a déjà un accès gracieux actif." + +#: views.py:453 +msgid "Add a whitelist" +msgstr "Ajouter un accès gracieux" + +#: views.py:473 +msgid "The whitelist was edited." +msgstr "L'accès gracieux a été ajouté." + +#: views.py:476 +msgid "Edit a whitelist" +msgstr "Modifier un accès gracieux" + +#: views.py:488 +msgid "The whitelist was deleted." +msgstr "L'accès gracieux a été supprimé." + +#: views.py:512 +msgid "The local email account was created." +msgstr "Le compte mail local a été créé." + +#: views.py:520 +msgid "Add a local email account" +msgstr "Ajouter un compte mail local" + +#: views.py:537 +msgid "The local email account was edited." +msgstr "Le compte mail local a été modifié." + +#: views.py:545 +msgid "Edit a local email account" +msgstr "Modifier un compte mail local" + +#: views.py:557 +msgid "The local email account was deleted." +msgstr "Le compte mail local a été supprimé." + +#: views.py:581 +msgid "The email settings were edited." +msgstr "Les paramètres mail ont été modifiés." + +#: views.py:590 +msgid "Edit the email settings" +msgstr "Modifier les paramètres mail" + +#: views.py:604 +msgid "The school was added." +msgstr "L'établissement a été ajouté." + +#: views.py:607 +msgid "Add a school" +msgstr "Ajouter un établissement" + +#: views.py:622 +msgid "The school was edited." +msgstr "L'établissement a été modifié." + +#: views.py:625 +msgid "Edit a school" +msgstr "Modifier un établissement" + +#: views.py:644 +msgid "The school was deleted." +msgstr "L'établissement a été supprimé." + +#: views.py:648 +#, python-format +msgid "" +"The school %s is assigned to at least one user, impossible to delete it." +msgstr "" +"L'établissement %s est affecté à au moins un utilisateur, impossible de le " +"supprimer." + +#: views.py:652 views.py:764 +msgid "Delete" +msgstr "Supprimer" + +#: views.py:665 +msgid "The shell was added." +msgstr "L'interface système a été ajoutée." + +#: views.py:668 +msgid "Add a shell" +msgstr "Ajouter une interface système" + +#: views.py:682 +msgid "The shell was edited." +msgstr "L'interface système a été modifiée." + +#: views.py:685 +msgid "Edit a shell" +msgstr "Modifier une interface système" + +#: views.py:697 +msgid "The shell was deleted." +msgstr "L'interface système a été supprimée." + +#: views.py:714 +msgid "The group of rights was added." +msgstr "Le groupe de droits a été ajouté." + +#: views.py:717 +msgid "Add a group of rights" +msgstr "Ajouter un groupe de droits" + +#: views.py:735 +msgid "The group of rights was edited." +msgstr "Le groupe de droits a été modifié." + +#: views.py:738 +msgid "Edit a group of rights" +msgstr "Modifier un groupe de droits" + +#: views.py:755 +msgid "The group of rights was deleted." +msgstr "Le groupe de droits a été supprimé." + +#: views.py:760 +#, python-format +msgid "" +"The group of rights %s is assigned to at least one user, impossible to " +"delete it." +msgstr "" +"Le groupe de droits %s est affecté à au moins un utilisateur, impossible de " +"le supprimer." + +#: views.py:788 +msgid "Archiving" +msgstr "Archivage" + +#: views.py:789 +#, python-format +msgid "%s users were archived." +msgstr "%s utilisateurs ont été archivés." + +#: views.py:1038 +msgid "The user doesn't exist." +msgstr "L'utilisateur n'existe pas." + +#: views.py:1040 views.py:1048 +msgid "Reset" +msgstr "Réinitialiser" + +#: views.py:1045 +msgid "An email to reset the password was sent." +msgstr "Un mail pour réinitialiser le mot de passe a été envoyé." + +#: views.py:1062 +msgid "Error: please contact an admin." +msgstr "Erreur : veuillez contacter un admin." + +#: views.py:1074 +msgid "Password reset" +msgstr "Réinitialisation du mot de passe" + +#: views.py:1114 views.py:1138 views.py:1153 +msgid "The mailing list doesn't exist." +msgstr "La liste de diffusion n'existe pas." + #: widgets.py:35 msgid "Close" -msgstr "" +msgstr "Fermer" #: widgets.py:36 msgid "Today" -msgstr "" +msgstr "Aujourd'hui" #: widgets.py:44 msgid "Next" -msgstr "" +msgstr "Suivant" #: widgets.py:45 msgid "Previous" -msgstr "" +msgstr "Précédent" #: widgets.py:46 msgid "Wk" -msgstr "" +msgstr "Wk" diff --git a/users/migrations/0076_auto_20180818_1321.py b/users/migrations/0076_auto_20180818_1321.py new file mode 100644 index 00000000..45fd1a62 --- /dev/null +++ b/users/migrations/0076_auto_20180818_1321.py @@ -0,0 +1,109 @@ +# -*- coding: utf-8 -*- +# Generated by Django 1.10.7 on 2018-08-18 11:21 +from __future__ import unicode_literals + +from django.conf import settings +import django.core.validators +from django.db import migrations, models +import django.db.models.deletion +import users.models + + +class Migration(migrations.Migration): + + dependencies = [ + ('users', '0075_merge_20180815_2202'), + ] + + operations = [ + migrations.AlterModelOptions( + name='adherent', + options={'permissions': (('change_user_password', 'Can change the password of a user'), ('change_user_state', 'Can edit the state of a user'), ('change_user_force', 'Can force the move'), ('change_user_shell', 'Can edit the shell of a user'), ('change_user_groups', 'Can edit the groups of rights of a user (critical permission)'), ('change_all_users', 'Can edit all users, including those with rights.'), ('view_user', 'Can view a user object')), 'verbose_name': 'member', 'verbose_name_plural': 'members'}, + ), + migrations.AlterModelOptions( + name='ban', + options={'permissions': (('view_ban', 'Can view a ban object'),), 'verbose_name': 'ban', 'verbose_name_plural': 'bans'}, + ), + migrations.AlterModelOptions( + name='club', + options={'permissions': (('change_user_password', 'Can change the password of a user'), ('change_user_state', 'Can edit the state of a user'), ('change_user_force', 'Can force the move'), ('change_user_shell', 'Can edit the shell of a user'), ('change_user_groups', 'Can edit the groups of rights of a user (critical permission)'), ('change_all_users', 'Can edit all users, including those with rights.'), ('view_user', 'Can view a user object')), 'verbose_name': 'club', 'verbose_name_plural': 'clubs'}, + ), + migrations.AlterModelOptions( + name='emailaddress', + options={'permissions': (('view_emailaddress', 'Can view a local email account object'),), 'verbose_name': 'local email account', 'verbose_name_plural': 'local email accounts'}, + ), + migrations.AlterModelOptions( + name='listright', + options={'permissions': (('view_listright', 'Can view a group of rights object'),), 'verbose_name': 'group of rights', 'verbose_name_plural': 'groups of rights'}, + ), + migrations.AlterModelOptions( + name='listshell', + options={'permissions': (('view_listshell', 'Can view a shell object'),), 'verbose_name': 'shell', 'verbose_name_plural': 'shells'}, + ), + migrations.AlterModelOptions( + name='school', + options={'permissions': (('view_school', 'Can view a school object'),), 'verbose_name': 'school', 'verbose_name_plural': 'schools'}, + ), + migrations.AlterModelOptions( + name='serviceuser', + options={'permissions': (('view_serviceuser', 'Can view a service user object'),), 'verbose_name': 'service user', 'verbose_name_plural': 'service users'}, + ), + migrations.AlterModelOptions( + name='user', + options={'permissions': (('change_user_password', 'Can change the password of a user'), ('change_user_state', 'Can edit the state of a user'), ('change_user_force', 'Can force the move'), ('change_user_shell', 'Can edit the shell of a user'), ('change_user_groups', 'Can edit the groups of rights of a user (critical permission)'), ('change_all_users', 'Can edit all users, including those with rights.'), ('view_user', 'Can view a user object')), 'verbose_name': 'user (member or club)', 'verbose_name_plural': 'users (members or clubs)'}, + ), + migrations.AlterModelOptions( + name='whitelist', + options={'permissions': (('view_whitelist', 'Can view a whitelist object'),), 'verbose_name': 'whitelist (free of charge access)', 'verbose_name_plural': 'whitelists (free of charge access)'}, + ), + migrations.AlterField( + model_name='adherent', + name='gpg_fingerprint', + field=models.CharField(blank=True, max_length=40, null=True, validators=[django.core.validators.RegexValidator('^[0-9A-F]{40}$', message='A GPG fingerprint must contain 40 hexadecimal characters.')]), + ), + migrations.AlterField( + model_name='ban', + name='state', + field=models.IntegerField(choices=[(0, 'HARD (no access)'), (1, 'SOFT (local access only)'), (2, 'RESTRICTED (speed limitation)')], default=0), + ), + migrations.AlterField( + model_name='emailaddress', + name='user', + field=models.ForeignKey(help_text='User of the local email account', on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL), + ), + migrations.AlterField( + model_name='listright', + name='unix_name', + field=models.CharField(max_length=255, unique=True, validators=[django.core.validators.RegexValidator('^[a-z]+$', message='UNIX groups can only contain lower case letters.')]), + ), + migrations.AlterField( + model_name='request', + name='type', + field=models.CharField(choices=[('PW', 'Password'), ('EM', 'Email address')], max_length=2), + ), + migrations.AlterField( + model_name='serviceuser', + name='comment', + field=models.CharField(blank=True, help_text='Comment', max_length=255), + ), + migrations.AlterField( + model_name='serviceuser', + name='pseudo', + field=models.CharField(help_text='Must only contain letters, numerals or dashes.', max_length=32, unique=True, validators=[users.models.linux_user_validator]), + ), + migrations.AlterField( + model_name='user', + name='comment', + field=models.CharField(blank=True, help_text='Comment, school year', max_length=255), + ), + migrations.AlterField( + model_name='user', + name='local_email_redirect', + field=models.BooleanField(default=False, help_text='Enable redirection of the local email messages to the main email address.'), + ), + migrations.AlterField( + model_name='user', + name='pseudo', + field=models.CharField(help_text='Must only contain letters, numerals or dashes.', max_length=32, unique=True, validators=[users.models.linux_user_validator]), + ), + ] diff --git a/users/models.py b/users/models.py index f3e786c0..b5874512 100755 --- a/users/models.py +++ b/users/models.py @@ -70,6 +70,8 @@ from django.contrib.auth.models import ( ) from django.core.validators import RegexValidator import traceback +from django.utils.translation import ugettext_lazy as _ + from reversion import revisions as reversion import ldapdb.models @@ -100,7 +102,7 @@ def linux_user_validator(login): pas les contraintes unix (maj, min, chiffres ou tiret)""" if not linux_user_check(login): raise forms.ValidationError( - ", ce pseudo ('%(label)s') contient des carractères interdits", + _("The username '%(label)s' contains forbidden characters."), params={'label': login}, ) @@ -142,10 +144,10 @@ class UserManager(BaseUserManager): su=False ): if not pseudo: - raise ValueError('Users must have an username') + raise ValueError(_("Users must have an username.")) if not linux_user_check(pseudo): - raise ValueError('Username shall only contain [a-z0-9-]') + raise ValueError(_("Username should only contain [a-z0-9-].")) user = Adherent( pseudo=pseudo, @@ -180,7 +182,7 @@ class User(RevMixin, FieldPermissionModelMixin, AbstractBaseUser, """ Definition de l'utilisateur de base. Champs principaux : name, surnname, pseudo, email, room, password Herite du django BaseUser et du système d'auth django""" - PRETTY_NAME = "Utilisateurs (clubs et adhérents)" + STATE_ACTIVE = 0 STATE_DISABLED = 1 STATE_ARCHIVE = 2 @@ -194,21 +196,22 @@ class User(RevMixin, FieldPermissionModelMixin, AbstractBaseUser, pseudo = models.CharField( max_length=32, unique=True, - help_text="Doit contenir uniquement des lettres, chiffres, ou tirets", + help_text=_("Must only contain letters, numerals or dashes."), validators=[linux_user_validator] ) email = models.EmailField( blank=True, null=True, - help_text="External email address allowing us to contact you." + help_text=_("External email address allowing us to contact you.") ) local_email_redirect = models.BooleanField( default=False, - help_text="Enable redirection of the local email messages to the main email." + help_text=_("Enable redirection of the local email messages to the" + " main email address.") ) local_email_enabled = models.BooleanField( default=False, - help_text="Enable the local email account." + help_text=_("Enable the local email account.") ) school = models.ForeignKey( 'School', @@ -223,7 +226,7 @@ class User(RevMixin, FieldPermissionModelMixin, AbstractBaseUser, blank=True ) comment = models.CharField( - help_text="Commentaire, promo", + help_text=_("Comment, school year"), max_length=255, blank=True ) @@ -249,18 +252,20 @@ class User(RevMixin, FieldPermissionModelMixin, AbstractBaseUser, class Meta: permissions = ( ("change_user_password", - "Peut changer le mot de passe d'un user"), - ("change_user_state", "Peut éditer l'etat d'un user"), - ("change_user_force", "Peut forcer un déménagement"), - ("change_user_shell", "Peut éditer le shell d'un user"), + _("Can change the password of a user")), + ("change_user_state", _("Can edit the state of a user")), + ("change_user_force", _("Can force the move")), + ("change_user_shell", _("Can edit the shell of a user")), ("change_user_groups", - "Peut éditer les groupes d'un user ! Permission critique"), + _("Can edit the groups of rights of a user (critical" + " permission)")), ("change_all_users", - "Peut éditer tous les users, y compris ceux dotés de droits. " - "Superdroit"), + _("Can edit all users, including those with rights.")), ("view_user", - "Peut voir un objet user quelquonque"), + _("Can view a user object")), ) + verbose_name = _("user (member or club)") + verbose_name_plural = _("users (members or clubs)") @cached_property def name(self): @@ -278,7 +283,7 @@ class User(RevMixin, FieldPermissionModelMixin, AbstractBaseUser, elif self.is_class_club: return self.club.room else: - raise NotImplementedError("Type inconnu") + raise NotImplementedError(_("Unknown type.")) @cached_property def get_mail_addresses(self): @@ -298,11 +303,11 @@ class User(RevMixin, FieldPermissionModelMixin, AbstractBaseUser, def class_name(self): """Renvoie si il s'agit d'un adhérent ou d'un club""" if hasattr(self, 'adherent'): - return "Adherent" + return _("Member") elif hasattr(self, 'club'): - return "Club" + return _("Club") else: - raise NotImplementedError("Type inconnu") + raise NotImplementedError(_("Unknown type.")) @cached_property def gid_number(self): @@ -513,7 +518,7 @@ class User(RevMixin, FieldPermissionModelMixin, AbstractBaseUser, if not interface.ipv4: with transaction.atomic(), reversion.create_revision(): interface.assign_ipv4() - reversion.set_comment("Assignation ipv4") + reversion.set_comment(_("IPv4 assigning")) interface.save() def unassign_ips(self): @@ -522,7 +527,7 @@ class User(RevMixin, FieldPermissionModelMixin, AbstractBaseUser, for interface in interfaces: with transaction.atomic(), reversion.create_revision(): interface.unassign_ipv4() - reversion.set_comment("Désassignation ipv4") + reversion.set_comment(_("IPv4 unassigning")) interface.save() def archive(self): @@ -669,10 +674,9 @@ class User(RevMixin, FieldPermissionModelMixin, AbstractBaseUser, if all_interfaces.count() > OptionalMachine.get_cached_value( 'max_lambdauser_interfaces' ): - return False, "Maximum de machines enregistrees atteinte" + return False, _("Maximum number of registered machines reached.") if not nas_type: - return False, "Re2o ne sait pas à quel machinetype affecter cette\ - machine" + return False, _("Re2o doesn't know wich machine type to assign.") machine_type_cible = nas_type.machine_type try: machine_parent = Machine() @@ -768,7 +772,7 @@ class User(RevMixin, FieldPermissionModelMixin, AbstractBaseUser, user_request.adherent in self.club.administrators.all()): return True, None else: - return False, u"Vous n'avez pas le droit d'éditer ce club" + return False, _("You don't have the right to edit this club.") else: if self == user_request: return True, None @@ -776,18 +780,19 @@ class User(RevMixin, FieldPermissionModelMixin, AbstractBaseUser, return True, None elif user_request.has_perm('users.change_user'): if self.groups.filter(listright__critical=True): - return False, (u"Utilisateurs avec droits critiques, ne " - "peut etre édité") + return False, (_("User with critical rights, can't be" + " edited.")) elif self == AssoOption.get_cached_value('utilisateur_asso'): - return False, (u"Impossible d'éditer l'utilisateur asso " - "sans droit change_all_users") + return False, (_("Impossible to edit the organisation's" + " user without the 'change_all_users'" + " right.")) else: return True, None elif user_request.has_perm('users.change_all_users'): return True, None else: - return False, (u"Vous ne pouvez éditer un autre utilisateur " - "que vous même") + return False, (_("You don't have the right to edit another" + " user.")) def can_change_password(self, user_request, *_args, **_kwargs): """Check if a user can change a user's password @@ -804,7 +809,7 @@ class User(RevMixin, FieldPermissionModelMixin, AbstractBaseUser, user_request.adherent in self.club.administrators.all()): return True, None else: - return False, u"Vous n'avez pas le droit d'éditer ce club" + return False, _("You don't have the right to edit this club.") else: if (self == user_request or user_request.has_perm('users.change_user_groups')): @@ -815,8 +820,8 @@ class User(RevMixin, FieldPermissionModelMixin, AbstractBaseUser, not self.groups.all()): return True, None else: - return False, (u"Vous ne pouvez éditer un autre utilisateur " - "que vous même") + return False, (_("You don't have the right to edit another" + " user.")) def check_selfpasswd(self, user_request, *_args, **_kwargs): """ Returns (True, None) if user_request is self, else returns @@ -834,7 +839,7 @@ class User(RevMixin, FieldPermissionModelMixin, AbstractBaseUser, """ return ( user_request.has_perm('users.change_user_state'), - "Droit requis pour changer l'état" + _("Permission required to change the state.") ) def can_change_shell(self, user_request, *_args, **_kwargs): @@ -846,7 +851,7 @@ class User(RevMixin, FieldPermissionModelMixin, AbstractBaseUser, """ if not ((self.pk == user_request.pk and OptionalUser.get_cached_value('self_change_shell')) or user_request.has_perm('users.change_user_shell')): - return False, u"Droit requis pour changer le shell" + return False, _("Permission required to change the shell.") else: return True, None @@ -860,12 +865,12 @@ class User(RevMixin, FieldPermissionModelMixin, AbstractBaseUser, """ return ( OptionalUser.get_cached_value('local_email_accounts_enabled'), - "La gestion des comptes mails doit être activée" + _("Local email accounts must be enabled.") ) @staticmethod def can_change_local_email_enabled(user_request, *_args, **_kwargs): - """ Check if a user can change internal address . + """ Check if a user can change internal address. :param user_request: The user who request :returns: a message and a boolean which is True if the user has @@ -873,7 +878,7 @@ class User(RevMixin, FieldPermissionModelMixin, AbstractBaseUser, """ return ( OptionalUser.get_cached_value('local_email_accounts_enabled'), - "La gestion des comptes mails doit être activée" + _("Local email accounts must be enabled.") ) @staticmethod @@ -886,7 +891,7 @@ class User(RevMixin, FieldPermissionModelMixin, AbstractBaseUser, """ return ( user_request.has_perm('users.change_user_force'), - "Droit requis pour forcer le déménagement" + _("Permission required to force the move.") ) @staticmethod @@ -899,7 +904,7 @@ class User(RevMixin, FieldPermissionModelMixin, AbstractBaseUser, """ return ( user_request.has_perm('users.change_user_groups'), - "Droit requis pour éditer les groupes de l'user" + _("Permission required to edit the user's groups of rights.") ) @staticmethod @@ -911,7 +916,7 @@ class User(RevMixin, FieldPermissionModelMixin, AbstractBaseUser, """ return ( user_request.is_superuser, - "Droit superuser requis pour éditer le flag superuser" + _("'superuser' right required to edit the superuser flag.") ) def can_view(self, user_request, *_args, **_kwargs): @@ -929,14 +934,14 @@ class User(RevMixin, FieldPermissionModelMixin, AbstractBaseUser, user_request.adherent in self.club.members.all()): return True, None else: - return False, u"Vous n'avez pas le droit de voir ce club" + return False, _("You don't have the right to view this club.") else: if (self == user_request or user_request.has_perm('users.view_user')): return True, None else: - return False, (u"Vous ne pouvez voir un autre utilisateur " - "que vous même") + return False, (_("You don't have the right to view another" + " user.")) @staticmethod def can_view_all(user_request, *_args, **_kwargs): @@ -948,7 +953,7 @@ class User(RevMixin, FieldPermissionModelMixin, AbstractBaseUser, """ return ( user_request.has_perm('users.view_user'), - u"Vous n'avez pas accès à la liste des utilisateurs." + _("You don't have the right to view the list of users.") ) def can_delete(self, user_request, *_args, **_kwargs): @@ -961,7 +966,7 @@ class User(RevMixin, FieldPermissionModelMixin, AbstractBaseUser, """ return ( user_request.has_perm('users.delete_user'), - u"Vous ne pouvez pas supprimer cet utilisateur." + _("You don't have the right to delete this user.") ) def __init__(self, *args, **kwargs): @@ -985,15 +990,15 @@ class User(RevMixin, FieldPermissionModelMixin, AbstractBaseUser, if not self.local_email_enabled and not self.email: raise ValidationError( {'email': ( - 'There is neither a local email address nor an external' - ' email address for this user.' + _("There is neither a local email address nor an external" + " email address for this user.") ), } ) if self.local_email_redirect and not self.email: raise ValidationError( {'local_email_redirect': ( - 'You cannot redirect your local email if no external email ' - 'has been set.'), } + _("You can't redirect your local emails if no external email" + " address has been set.")), } ) def __str__(self): @@ -1003,7 +1008,7 @@ class User(RevMixin, FieldPermissionModelMixin, AbstractBaseUser, class Adherent(User): """ A class representing a member (it's a user with special informations) """ - PRETTY_NAME = "Adhérents" + name = models.CharField(max_length=255) room = models.OneToOneField( 'topologie.Room', @@ -1017,11 +1022,29 @@ class Adherent(User): null=True, validators=[RegexValidator( '^[0-9A-F]{40}$', - message="Une fingerprint GPG doit contenir 40 " - "caractères hexadécimaux" + message=_("A GPG fingerprint must contain 40 hexadecimal" + " characters.") )] ) + class Meta: + permissions = ( + ("change_user_password", + _("Can change the password of a user")), + ("change_user_state", _("Can edit the state of a user")), + ("change_user_force", _("Can force the move")), + ("change_user_shell", _("Can edit the shell of a user")), + ("change_user_groups", + _("Can edit the groups of rights of a user (critical" + " permission)")), + ("change_all_users", + _("Can edit all users, including those with rights.")), + ("view_user", + _("Can view a user object")), + ) + verbose_name = _("member") + verbose_name_plural = _("members") + @classmethod def get_instance(cls, adherentid, *_args, **_kwargs): """Try to find an instance of `Adherent` with the given id. @@ -1049,14 +1072,14 @@ class Adherent(User): else: return ( user_request.has_perm('users.add_user'), - u"Vous n'avez pas le droit de créer un utilisateur" + _("You don't have the right to create a user.") ) class Club(User): """ A class representing a club (it is considered as a user with special informations) """ - PRETTY_NAME = "Clubs" + room = models.ForeignKey( 'topologie.Room', on_delete=models.PROTECT, @@ -1077,6 +1100,24 @@ class Club(User): default=False ) + class Meta: + permissions = ( + ("change_user_password", + _("Can change the password of a user")), + ("change_user_state", _("Can edit the state of a user")), + ("change_user_force", _("Can force the move")), + ("change_user_shell", _("Can edit the shell of a user")), + ("change_user_groups", + _("Can edit the groups of rights of a user (critical" + " permission)")), + ("change_all_users", + _("Can edit all users, including those with rights.")), + ("view_user", + _("Can view a user object")), + ) + verbose_name = _("club") + verbose_name_plural = _("clubs") + @staticmethod def can_create(user_request, *_args, **_kwargs): """Check if an user can create an user object. @@ -1093,7 +1134,7 @@ class Club(User): else: return ( user_request.has_perm('users.add_user'), - u"Vous n'avez pas le droit de créer un club" + _("You don't have the right to create a club.") ) @staticmethod @@ -1111,7 +1152,7 @@ class Club(User): if (user_request.adherent.club_administrator.all() or user_request.adherent.club_members.all()): return True, None - return False, u"Vous n'avez pas accès à la liste des utilisateurs." + return False, _("You don't have the right to view the list of users.") @classmethod def get_instance(cls, clubid, *_args, **_kwargs): @@ -1176,12 +1217,10 @@ class ServiceUser(RevMixin, AclMixin, AbstractBaseUser): ('usermgmt', 'usermgmt'), ) - PRETTY_NAME = "Utilisateurs de service" - pseudo = models.CharField( max_length=32, unique=True, - help_text="Doit contenir uniquement des lettres, chiffres, ou tirets", + help_text=_("Must only contain letters, numerals or dashes."), validators=[linux_user_validator] ) access_group = models.CharField( @@ -1190,7 +1229,7 @@ class ServiceUser(RevMixin, AclMixin, AbstractBaseUser): max_length=32 ) comment = models.CharField( - help_text="Commentaire", + help_text=_("Comment"), max_length=255, blank=True ) @@ -1200,12 +1239,14 @@ class ServiceUser(RevMixin, AclMixin, AbstractBaseUser): class Meta: permissions = ( - ("view_serviceuser", "Peut voir un objet serviceuser"), + ("view_serviceuser", _("Can view a service user object")), ) + verbose_name = _("service user") + verbose_name_plural = _("service users") def get_full_name(self): """ Renvoie le nom complet du serviceUser formaté nom/prénom""" - return "ServiceUser <{name}>".format(name=self.pseudo) + return _("Service user <{name}>").format(name=self.pseudo) def get_short_name(self): """ Renvoie seulement le nom""" @@ -1262,14 +1303,15 @@ def service_user_post_delete(**kwargs): class School(RevMixin, AclMixin, models.Model): """ Etablissement d'enseignement""" - PRETTY_NAME = "Établissements enregistrés" name = models.CharField(max_length=255) class Meta: permissions = ( - ("view_school", "Peut voir un objet school"), + ("view_school", _("Can view a school object")), ) + verbose_name = _("school") + verbose_name_plural = _("schools") def __str__(self): return self.name @@ -1281,29 +1323,29 @@ class ListRight(RevMixin, AclMixin, Group): Permet de gérer facilement les accès serveurs et autres La clef de recherche est le gid, pour cette raison là il n'est plus modifiable après creation""" - PRETTY_NAME = "Liste des droits existants" unix_name = models.CharField( max_length=255, unique=True, validators=[RegexValidator( '^[a-z]+$', - message=("Les groupes unix ne peuvent contenir que des lettres " - "minuscules") + message=(_("UNIX groups can only contain lower case letters.")) )] ) gid = models.PositiveIntegerField(unique=True, null=True) critical = models.BooleanField(default=False) details = models.CharField( - help_text="Description", + help_text=_("Description"), max_length=255, blank=True ) class Meta: permissions = ( - ("view_listright", "Peut voir un objet Group/ListRight"), + ("view_listright", _("Can view a group of rights object")), ) + verbose_name = _("group of rights") + verbose_name_plural = _("groups of rights") def __str__(self): return self.name @@ -1345,14 +1387,16 @@ def listright_post_delete(**kwargs): class ListShell(RevMixin, AclMixin, models.Model): """Un shell possible. Pas de check si ce shell existe, les admin sont des grands""" - PRETTY_NAME = "Liste des shells disponibles" shell = models.CharField(max_length=255, unique=True) class Meta: permissions = ( - ("view_listshell", "Peut voir un objet shell quelqu'il soit"), + ("view_listshell", _("Can view a shell object")), ) + verbose_name = _("shell") + verbose_name_plural = _("shells") + def get_pretty_name(self): """Return the canonical name of the shell""" @@ -1365,15 +1409,14 @@ class ListShell(RevMixin, AclMixin, models.Model): class Ban(RevMixin, AclMixin, models.Model): """ Bannissement. Actuellement a un effet tout ou rien. Gagnerait à être granulaire""" - PRETTY_NAME = "Liste des bannissements" STATE_HARD = 0 STATE_SOFT = 1 STATE_BRIDAGE = 2 STATES = ( - (0, 'HARD (aucun accès)'), - (1, 'SOFT (accès local seulement)'), - (2, 'BRIDAGE (bridage du débit)'), + (0, _("HARD (no access)")), + (1, _("SOFT (local access only)")), + (2, _("RESTRICTED (speed limitation)")), ) user = models.ForeignKey('User', on_delete=models.PROTECT) @@ -1384,8 +1427,10 @@ class Ban(RevMixin, AclMixin, models.Model): class Meta: permissions = ( - ("view_ban", "Peut voir un objet ban quelqu'il soit"), + ("view_ban", _("Can view a ban object")), ) + verbose_name = _("ban") + verbose_name_plural = _("bans") def notif_ban(self): """ Prend en argument un objet ban, envoie un mail de notification """ @@ -1419,8 +1464,8 @@ class Ban(RevMixin, AclMixin, models.Model): """ if (not user_request.has_perm('users.view_ban') and self.user != user_request): - return False, (u"Vous n'avez pas le droit de voir les " - "bannissements autre que les vôtres") + return False, (_("You don't have the right to view bans other" + " than yours.")) else: return True, None @@ -1459,7 +1504,6 @@ class Whitelist(RevMixin, AclMixin, models.Model): """Accès à titre gracieux. L'utilisateur ne paye pas; se voit accorder un accès internet pour une durée défini. Moins fort qu'un ban quel qu'il soit""" - PRETTY_NAME = "Liste des accès gracieux" user = models.ForeignKey('User', on_delete=models.PROTECT) raison = models.CharField(max_length=255) @@ -1468,8 +1512,10 @@ class Whitelist(RevMixin, AclMixin, models.Model): class Meta: permissions = ( - ("view_whitelist", "Peut voir un objet whitelist"), + ("view_whitelist", _("Can view a whitelist object")), ) + verbose_name = _("whitelist (free of charge access)") + verbose_name_plural = _("whitelists (free of charge access)") def is_active(self): """ Is this whitelisting active ? """ @@ -1485,8 +1531,8 @@ class Whitelist(RevMixin, AclMixin, models.Model): """ if (not user_request.has_perm('users.view_whitelist') and self.user != user_request): - return False, (u"Vous n'avez pas le droit de voir les accès " - "gracieux autre que les vôtres") + return False, (_("You don't have the right to view whitelists" + " other than yours.")) else: return True, None @@ -1529,8 +1575,8 @@ class Request(models.Model): PASSWD = 'PW' EMAIL = 'EM' TYPE_CHOICES = ( - (PASSWD, 'Mot de passe'), - (EMAIL, 'Email'), + (PASSWD, _("Password")), + (EMAIL, _("Email address")), ) type = models.CharField(max_length=2, choices=TYPE_CHOICES) token = models.CharField(max_length=32) @@ -1722,20 +1768,20 @@ class EMailAddress(RevMixin, AclMixin, models.Model): user = models.ForeignKey( User, on_delete=models.CASCADE, - help_text="User of the local email", + help_text=_("User of the local email account") ) local_part = models.CharField( unique=True, max_length=128, - help_text="Local part of the email address" + help_text=_("Local part of the email address") ) class Meta: permissions = ( - ("view_emailaddress", "Can see a local email account object"), + ("view_emailaddress", _("Can view a local email account object")), ) - verbose_name = "Local email account" - verbose_name_plural = "Local email accounts" + verbose_name = _("local email account") + verbose_name_plural = _("local email accounts") def __str__(self): return str(self.local_part) + OptionalUser.get_cached_value('local_email_domain') @@ -1759,11 +1805,12 @@ class EMailAddress(RevMixin, AclMixin, models.Model): if user_request.has_perm('users.add_emailaddress'): return True, None if not OptionalUser.get_cached_value('local_email_accounts_enabled'): - return False, "The local email accounts are not enabled." + return False, _("The local email accounts are not enabled.") if int(user_request.id) != int(userid): - return False, "You don't have the right to add a local email account to another user." + return False, _("You don't have the right to add a local email" + " account to another user.") elif user_request.email_address.count() >= OptionalUser.get_cached_value('max_email_address'): - return False, "You have reached the limit of {} local email account.".format( + return False, _("You reached the limit of {} local email accounts.").format( OptionalUser.get_cached_value('max_email_address') ) return True, None @@ -1781,10 +1828,11 @@ class EMailAddress(RevMixin, AclMixin, models.Model): if user_request.has_perm('users.view_emailaddress'): return True, None if not OptionalUser.get_cached_value('local_email_accounts_enabled'): - return False, "The local email accounts are not enabled." + return False, _("The local email accounts are not enabled.") if user_request == self.user: return True, None - return False, "You don't have the right to edit someone else's local email account." + return False, _("You don't have the right to edit another user's local" + " email account.") def can_delete(self, user_request, *_args, **_kwargs): """Check if a user can delete the alias @@ -1797,16 +1845,16 @@ class EMailAddress(RevMixin, AclMixin, models.Model): the local email account. """ if self.local_part == self.user.pseudo.lower(): - return False, ("You cannot delete a local email account whose " - "local part is the same as the username.") - if user_request.has_perm('users.delete_emailaddress'): + return False, _("You can't delete a local email account whose" + " local part is the same as the username.") + if user_request.has_perm('users.delete_emailaddress'): return True, None if not OptionalUser.get_cached_value('local_email_accounts_enabled'): - return False, "The local email accounts are not enabled." + return False, _("The local email accounts are not enabled.") if user_request == self.user: return True, None - return False, ("You don't have the right to delete someone else's " - "local email account") + return False, _("You don't have the right to delete another user's" + " local email account") def can_edit(self, user_request, *_args, **_kwargs): """Check if a user can edit the alias @@ -1819,19 +1867,20 @@ class EMailAddress(RevMixin, AclMixin, models.Model): the local email account. """ if self.local_part == self.user.pseudo.lower(): - return False, ("You cannot edit a local email account whose " - "local part is the same as the username.") + return False, _("You can't edit a local email account whose local" + " part is the same as the username.") if user_request.has_perm('users.change_emailaddress'): return True, None if not OptionalUser.get_cached_value('local_email_accounts_enabled'): - return False, "The local email accounts are not enabled." + return False, _("The local email accounts are not enabled.") if user_request == self.user: return True, None - return False, ("You don't have the right to edit someone else's " - "local email account") + return False, _("You don't have the right to edit another user's local" + " email account.") def clean(self, *args, **kwargs): self.local_part = self.local_part.lower() if "@" in self.local_part: - raise ValidationError("The local part cannot contain a @") + raise ValidationError(_("The local part must not contain @.")) super(EMailAddress, self).clean(*args, **kwargs) + diff --git a/users/templates/users/aff_bans.html b/users/templates/users/aff_bans.html index ebcbdeee..1284bea8 100644 --- a/users/templates/users/aff_bans.html +++ b/users/templates/users/aff_bans.html @@ -21,8 +21,11 @@ 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. {% endcomment %} + {% load acl %} {% load logs_extra %} +{% load i18n %} + {% if ban_list.paginator %} {% include "pagination.html" with list=ban_list %} {% endif %} @@ -30,36 +33,40 @@ with this program; if not, write to the Free Software Foundation, Inc., - - - - + {% trans "User" as tr_user %} + + + {% trans "Start date" as tr_start %} + + {% trans "End date" as tr_end %} + {% for ban in ban_list %} - {% if ban.is_active %} - + {% if ban.is_active %} + {% else %} - {% endif %} + {% endif %} - {% endfor %} + {% endfor %}
{% include "buttons/sort.html" with prefix='ban' col="user" text="Utilisateur" %}Raison{% include "buttons/sort.html" with prefix='ban' col="start" text="Date de début" %}{% include "buttons/sort.html" with prefix='ban' col="end" text="Date de fin" %}{% include "buttons/sort.html" with prefix='ban' col="user" text=tr_user %}{% trans "Reason" %}{% include "buttons/sort.html" with prefix='ban' col="start" text=tr_start %}{% include "buttons/sort.html" with prefix='ban' col="end" text=tr_end %}
{{ ban.user }} {{ ban.raison }} {{ ban.date_start }} {{ ban.date_end }} - {% can_delete ban %} - {% include 'buttons/suppr.html' with href='users:del-ban' id=ban.id %} - {% acl_end %} {% can_edit ban %} {% include 'buttons/edit.html' with href='users:edit-ban' id=ban.id %} {% acl_end %} {% history_button ban %} + {% can_delete ban %} + {% include 'buttons/suppr.html' with href='users:del-ban' id=ban.id %} + {% acl_end %}
{% if ban_list.paginator %} {% include "pagination.html" with list=ban_list %} {% endif %} + diff --git a/users/templates/users/aff_clubs.html b/users/templates/users/aff_clubs.html index dfb82e10..1903a445 100644 --- a/users/templates/users/aff_clubs.html +++ b/users/templates/users/aff_clubs.html @@ -22,6 +22,8 @@ with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. {% endcomment %} +{% load i18n %} + {% if clubs_list.paginator %} {% include "pagination.html" with list=clubs_list %} {% endif %} @@ -31,29 +33,35 @@ with this program; if not, write to the Free Software Foundation, Inc., - - - - - - + {% trans "Name" as tr_name %} + + {% trans "Username" as tr_username %} + + {% trans "Room" as tr_room %} + + + + {% for club in clubs_list %} {% can_view club %} - - - - - - - + + + + + + + {% acl_end %} {% endfor %} @@ -62,3 +70,4 @@ with this program; if not, write to the Free Software Foundation, Inc., {% if clubs_list.paginator %} {% include "pagination.html" with list=clubs_list %} {% endif %} + diff --git a/users/templates/users/aff_emailaddress.html b/users/templates/users/aff_emailaddress.html index 14156ac9..25048d6c 100644 --- a/users/templates/users/aff_emailaddress.html +++ b/users/templates/users/aff_emailaddress.html @@ -23,6 +23,7 @@ with this program; if not, write to the Free Software Foundation, Inc., {% endcomment %} {% load acl %} +{% load i18n %} {% load logs_extra %} {% if emailaddress_list.paginator %} @@ -32,20 +33,20 @@ with this program; if not, write to the Free Software Foundation, Inc.,
{% include "buttons/sort.html" with prefix='club' col="surname" text="Nom" %}{% include "buttons/sort.html" with prefix='club' col="pseudo" text="Pseudo" %}{% include "buttons/sort.html" with prefix='club' col="room" text="Chambre" %}Fin de cotisation leConnexionProfil{% include "buttons/sort.html" with prefix='club' col="surname" text=tr_name %}{% include "buttons/sort.html" with prefix='club' col="pseudo" text=tr_username %}{% include "buttons/sort.html" with prefix='club' col="room" text=tr_room %}{% trans "End of subscription on" %}{% trans "Internet access" %}{% trans "Profile" %}
{{ club.surname }}{{ club.pseudo }}{{ club.room }}{% if club.is_adherent %}{{ club.end_adhesion }}{% else %}Non adhérent{% endif %}{% if club.has_access == True %} - Active - {% else %} - Désactivée - {% endif %} - -
{{ club.surname }}{{ club.pseudo }}{{ club.room }}{% if club.is_adherent %}{{ club.end_adhesion }}{% else %}{% trans "Not a member" %}{% endif %}{% if club.has_access == True %} + {% trans "Active" %} + {% else %} + {% trans "Disabled" %} + {% endif %} + + + + +
- + {% for emailaddress in emailaddress_list %} - - + {% endfor %} @@ -54,3 +55,4 @@ with this program; if not, write to the Free Software Foundation, Inc., {% if emailaddress_list.paginator %} {% include "pagination.html" with list=emailaddress_list %} {% endif %} + diff --git a/users/templates/users/aff_rights.html b/users/templates/users/aff_rights.html index 26ed3c5d..710c1f14 100644 --- a/users/templates/users/aff_rights.html +++ b/users/templates/users/aff_rights.html @@ -33,9 +33,8 @@ with this program; if not, write to the Free Software Foundation, Inc., {% for user_right in user_right_list %} - + {% endfor %}
Email address{% trans "Email address" %}
{{ emailaddress.complete_email_address }} - {% can_delete emailaddress %} - {% include 'buttons/suppr.html' with href='users:del-emailaddress' id=emailaddress.id %} - {% acl_end %} - {% can_edit emailaddress %} - {% include 'buttons/edit.html' with href='users:edit-emailaddress' id=emailaddress.id %} - {% acl_end %} - {% history_button emailaddress %} + {{ emailaddress.complete_email_address }} + {% can_delete emailaddress %} + {% include 'buttons/suppr.html' with href='users:del-emailaddress' id=emailaddress.id %} + {% acl_end %} + {% history_button emailaddress %} + {% can_edit emailaddress %} + {% include 'buttons/edit.html' with href='users:edit-emailaddress' id=emailaddress.id %} + {% acl_end %}
{{ user_right }}{{ user_right }}
- diff --git a/users/templates/users/aff_schools.html b/users/templates/users/aff_schools.html index 1d32a6eb..2c1e41dd 100644 --- a/users/templates/users/aff_schools.html +++ b/users/templates/users/aff_schools.html @@ -21,20 +21,21 @@ 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. {% endcomment %} + +{% load i18n %} {% load acl %} {% load logs_extra %}
- {% if school_list.paginator %} {% include "pagination.html" with list=school_list %} {% endif %} - - + {% trans "School" as tr_school %} + diff --git a/users/templates/users/aff_serviceusers.html b/users/templates/users/aff_serviceusers.html index 5f43b0d7..b5e0ae62 100644 --- a/users/templates/users/aff_serviceusers.html +++ b/users/templates/users/aff_serviceusers.html @@ -21,32 +21,35 @@ 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. {% endcomment %} + +{% load i18n %} {% load acl %} {% load logs_extra %} -
{% include "buttons/sort.html" with prefix='school' col='name' text='Etablissement' %}{% include "buttons/sort.html" with prefix='school' col='name' text=tr_school %}
- - - - - - - - - {% for serviceuser in serviceusers_list %} - - - - - - - {% endfor %} + +
NomRôleCommentaire
{{ serviceuser.pseudo }}{{ serviceuser.access_group }}{{ serviceuser.comment }} - {% can_delete serviceuser %} - {% include 'buttons/suppr.html' with href='users:del-serviceuser' id=serviceuser.id %} - {% acl_end %} - {% can_edit serviceuser %} - {% include 'buttons/edit.html' with href='users:edit-serviceuser' id=serviceuser.id %} - {% acl_end %} - {% history_button serviceuser %} -
+ + + + + + + + + {% for serviceuser in serviceusers_list %} + + + + + + + {% endfor %}
{% trans "Name" %}{% trans "Role" %}{% trans "Comment" %}
{{ serviceuser.pseudo }}{{ serviceuser.access_group }}{{ serviceuser.comment }} + {% can_delete serviceuser %} + {% include 'buttons/suppr.html' with href='users:del-serviceuser' id=serviceuser.id %} + {% acl_end %} + {% history_button serviceuser %} + {% can_edit serviceuser %} + {% include 'buttons/edit.html' with href='users:edit-serviceuser' id=serviceuser.id %} + {% acl_end %} +
diff --git a/users/templates/users/aff_shell.html b/users/templates/users/aff_shell.html index a968a312..b422ab52 100644 --- a/users/templates/users/aff_shell.html +++ b/users/templates/users/aff_shell.html @@ -21,28 +21,31 @@ 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. {% endcomment %} + +{% load i18n %} {% load acl %} {% load logs_extra %} + - + {% for shell in shell_list %} - - - - + + + + {% endfor %}
Shell{% trans "Shell" %}
{{ shell.shell }} - {% can_delete shell %} - {% include 'buttons/suppr.html' with href='users:del-shell' id=shell.id %} - {% acl_end %} - {% can_edit shell %} - {% include 'buttons/edit.html' with href='users:edit-shell' id=shell.id %} - {% acl_end %} - {% history_button shell %} -
{{ shell.shell }} + {% can_delete shell %} + {% include 'buttons/suppr.html' with href='users:del-shell' id=shell.id %} + {% acl_end %} + {% history_button shell %} + {% can_edit shell %} + {% include 'buttons/edit.html' with href='users:edit-shell' id=shell.id %} + {% acl_end %} +
diff --git a/users/templates/users/aff_users.html b/users/templates/users/aff_users.html index 42dc07d6..f405e2c0 100644 --- a/users/templates/users/aff_users.html +++ b/users/templates/users/aff_users.html @@ -21,6 +21,9 @@ 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. {% endcomment %} + +{% load i18n %} +
{% if users_list.paginator %} {% include "pagination.html" with list=users_list %} @@ -29,31 +32,39 @@ with this program; if not, write to the Free Software Foundation, Inc., - - - - - - - + {% trans "Firt name" as tr_name %} + + {% trans "Surname" as tr_surname %} + + {% trans "Username" as tr_username %} + + {% trans "Room" as tr_room %} + + + + {% for user in users_list %} - - - - - - - - - + + + + + + + + + {% endfor %}
{% include "buttons/sort.html" with prefix='user' col="name" text="Prénom" %}{% include "buttons/sort.html" with prefix='user' col="surname" text="Nom" %}{% include "buttons/sort.html" with prefix='user' col="pseudo" text="Pseudo" %}{% include "buttons/sort.html" with prefix='user' col="room" text="Chambre" %}Fin de cotisation leConnexionProfil{% include "buttons/sort.html" with prefix='user' col="name" text=tr_name %}{% include "buttons/sort.html" with prefix='user' col="surname" text=tr_surname %}{% include "buttons/sort.html" with prefix='user' col="pseudo" text=tr_username %}{% include "buttons/sort.html" with prefix='user' col="room" text=tr_room %}{% trans "End of subscription on" %}{% trans "Internet access" %}{% trans "Profile" %}
{{ user.name }}{{ user.surname }}{{ user.pseudo }}{{ user.room }}{% if user.is_adherent %}{{ user.end_adhesion }}{% else %}Non adhérent{% endif %}{% if user.has_access == True %} - Active - {% else %} - Désactivée - {% endif %} - -
{{ user.name }}{{ user.surname }}{{ user.pseudo }}{{ user.room }}{% if user.is_adherent %}{{ user.end_adhesion }}{% else %}{% trans "Not a member" %}{% endif %} + {% if user.has_access == True %} + {% trans "Active" %} + {% else %} + {% trans "Disabled" %} + {% endif %} + + + + +
@@ -61,3 +72,4 @@ with this program; if not, write to the Free Software Foundation, Inc., {% include "pagination.html" with list=users_list %} {% endif %}
+ diff --git a/users/templates/users/aff_whitelists.html b/users/templates/users/aff_whitelists.html index 653e31e0..b170c43e 100644 --- a/users/templates/users/aff_whitelists.html +++ b/users/templates/users/aff_whitelists.html @@ -22,27 +22,33 @@ with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. {% endcomment %} +{% load i18n %} + {% if white_list.paginator %} {% include "pagination.html" with list=white_list %} {% endif %} {% load acl %} {% load logs_extra %} + - - - - + {% trans "User" as tr_user %} + + + {% trans "Start date" as tr_start %} + + {% trans "End date" as tr_end %} + {% for whitelist in white_list %} {% if whitelist.is_active %} - - {% else %} + + {% else %} - {% endif %} + {% endif %} @@ -51,10 +57,10 @@ with this program; if not, write to the Free Software Foundation, Inc., {% can_delete whitelist %} {% include 'buttons/suppr.html' with href='users:del-whitelist' id=whitelist.id %} {% acl_end %} + {% history_button whitelist %} {% can_edit whitelist %} {% include 'buttons/edit.html' with href='users:edit-whitelist' id=whitelist.id %} {% acl_end %} - {% history_button whitelist %} {% endfor %} @@ -63,3 +69,4 @@ with this program; if not, write to the Free Software Foundation, Inc., {% if white_list.paginator %} {% include "pagination.html" with list=white_list %} {% endif %} + diff --git a/users/templates/users/delete.html b/users/templates/users/delete.html index 928c0001..3f71d0d1 100644 --- a/users/templates/users/delete.html +++ b/users/templates/users/delete.html @@ -24,17 +24,20 @@ with this program; if not, write to the Free Software Foundation, Inc., {% endcomment %} {% load bootstrap3 %} +{% load i18n %} -{% block title %}Destruction d'objets{% endblock %} +{% block title %}{% trans "Deletion of objects" %}{% endblock %} {% block content %} {% csrf_token %} -

Attention, voulez-vous vraiment supprimer cet objet {{ objet_name }} ( {{ objet }} ) ?

- {% bootstrap_button "Confirmer" button_type="submit" icon="trash" %} +

{% blocktrans %}Warning: are you sure you want to delete this {{ objet_name }} object ( {{ objet }} )?{% endblocktrans %}

+ {% trans "Confirm" as tr_confirm %} + {% bootstrap_button tr_confirm button_type="submit" icon="trash" %}


{% endblock %} + diff --git a/users/templates/users/index.html b/users/templates/users/index.html index 57a66e56..c53eb768 100644 --- a/users/templates/users/index.html +++ b/users/templates/users/index.html @@ -24,11 +24,12 @@ with this program; if not, write to the Free Software Foundation, Inc., {% endcomment %} {% load bootstrap3 %} +{% load i18n %} -{% block title %}Utilisateurs{% endblock %} +{% block title %}{% trans "Users" %}{% endblock %} {% block content %} -

Adhérents

+

{% trans "Users" %}

{% include "users/aff_users.html" with users_list=users_list %}

diff --git a/users/templates/users/index_ban.html b/users/templates/users/index_ban.html index d7f7184f..3b84947d 100644 --- a/users/templates/users/index_ban.html +++ b/users/templates/users/index_ban.html @@ -24,11 +24,12 @@ with this program; if not, write to the Free Software Foundation, Inc., {% endcomment %} {% load bootstrap3 %} +{% load i18n %} -{% block title %}Utilisateurs{% endblock %} +{% block title %}{% trans "Users" %}{% endblock %} {% block content %} -

Bannissements

+

{% trans "Bans" %}

{% include "users/aff_bans.html" with ban_list=ban_list %}

diff --git a/users/templates/users/index_clubs.html b/users/templates/users/index_clubs.html index 4c3dd609..31e48b5d 100644 --- a/users/templates/users/index_clubs.html +++ b/users/templates/users/index_clubs.html @@ -24,11 +24,12 @@ with this program; if not, write to the Free Software Foundation, Inc., {% endcomment %} {% load bootstrap3 %} +{% load i18n %} -{% block title %}Utilisateurs{% endblock %} +{% block title %}{% trans "Users" %}{% endblock %} {% block content %} -

Clubs

+

{% trans "Clubs" %}

{% include "users/aff_clubs.html" with clubs_list=clubs_list %}

diff --git a/users/templates/users/index_emailaddress.html b/users/templates/users/index_emailaddress.html index 6976e168..33b1c4f3 100644 --- a/users/templates/users/index_emailaddress.html +++ b/users/templates/users/index_emailaddress.html @@ -24,11 +24,12 @@ with this program; if not, write to the Free Software Foundation, Inc., {% endcomment %} {% load bootstrap3 %} +{% load i18n %} -{% block title %}Local email accounts{% endblock %} +{% block title %}{% trans "Users" %}{% endblock %} {% block content %} -

Local email accounts

- {% include "users/aff_emailaddress.html" with emailaddress_list=emailaddress_list %} +

{% trans "Local email accounts" %}

+ {% include "users/aff_emailaddress.html" with emailaddress_list=emailaddress_list %} {% endblock %} diff --git a/users/templates/users/index_listright.html b/users/templates/users/index_listright.html index 3b8b3e60..4aaa172c 100644 --- a/users/templates/users/index_listright.html +++ b/users/templates/users/index_listright.html @@ -25,15 +25,16 @@ with this program; if not, write to the Free Software Foundation, Inc., {% load bootstrap3 %} {% load acl %} +{% load i18n %} -{% block title %}Utilisateurs{% endblock %} +{% block title %}{% trans "Users" %}{% endblock %} {% block content %} -

Liste des droits

+

{% trans "List of groups of rights" %}

{% can_create ListRight %} - Ajouter un droit ou groupe + {% trans " Add a group of rights" %} {% acl_end %} - Supprimer un ou plusieurs droits/groupes + {% trans " Delete one or several groups of rights" %}

{% include "users/aff_listright.html" %} diff --git a/users/templates/users/index_rights.html b/users/templates/users/index_rights.html index a3096f7f..4bfcbd1c 100644 --- a/users/templates/users/index_rights.html +++ b/users/templates/users/index_rights.html @@ -24,11 +24,12 @@ with this program; if not, write to the Free Software Foundation, Inc., {% endcomment %} {% load bootstrap3 %} +{% load i18n %} -{% block title %}Utilisateurs{% endblock %} +{% block title %}{% trans "Users" %}{% endblock %} {% block content %} -

Droits

+

{% trans "Rights" %}

{% include "users/aff_rights.html" %}

diff --git a/users/templates/users/index_schools.html b/users/templates/users/index_schools.html index 0912ffd5..42f6a588 100644 --- a/users/templates/users/index_schools.html +++ b/users/templates/users/index_schools.html @@ -25,16 +25,17 @@ with this program; if not, write to the Free Software Foundation, Inc., {% load bootstrap3 %} {% load acl %} +{% load i18n %} -{% block title %}Utilisateurs{% endblock %} +{% block title %}{% trans "Users" %}{% endblock %} {% block content %} -

Liste des Établissements

-
Ensemble des établissements d'enseignement ou d'activité des utilisateurs crées
+

{% trans "List of schools" %}

+
{% trans "List of schools for created users." %}
{% can_create School %} - Ajouter un établissement + {% trans " Add a school" %} {% acl_end %} - Supprimer un ou plusieurs établissements + {% trans " Delete one or several schools" %}
{% include "users/aff_schools.html" with school_list=school_list %}
diff --git a/users/templates/users/index_serviceusers.html b/users/templates/users/index_serviceusers.html index 497445b0..9d6ae67d 100644 --- a/users/templates/users/index_serviceusers.html +++ b/users/templates/users/index_serviceusers.html @@ -25,15 +25,15 @@ with this program; if not, write to the Free Software Foundation, Inc., {% load bootstrap3 %} {% load acl %} +{% load i18n %} -{% block title %}Utilisateurs{% endblock %} +{% block title %}{% trans "Users" %}{% endblock %} {% block content %} -

Liste des service users LDAP

-
Les service users LDAP sont des utilisateurs spéciaux qui disposent d'un accès uniquement sur le ldap pour effectuer des opération d'authentification. - Il est recommandé de créer un service-user doté d'un login/mdp par service concerné
+

{% trans "List of LDAP service users" %}

+
{% trans "The LDAP service users are special users having access only to the LDAP for authentication operations. It is recommended to create a service user with a login and a password for any concerned service." %}
{% can_create ServiceUser %} - Ajouter un service user + {% trans " Add a service user" %} {% acl_end %} {% include "users/aff_serviceusers.html" with serviceusers_list=serviceusers_list %}
diff --git a/users/templates/users/index_shell.html b/users/templates/users/index_shell.html index 51fbb551..0f797be0 100644 --- a/users/templates/users/index_shell.html +++ b/users/templates/users/index_shell.html @@ -25,13 +25,14 @@ with this program; if not, write to the Free Software Foundation, Inc., {% load bootstrap3 %} {% load acl %} +{% load i18n %} -{% block title %}Utilisateurs{% endblock %} +{% block title %}{% trans "Users" %}{% endblock %} {% block content %} -

Liste des Shells

+

{% trans "List of shells" %}

{% can_create ListShell %} - Ajouter un shell + {% trans " Add a shell" %} {% acl_end %} {% include "users/aff_shell.html" with shell_list=shell_list %}
diff --git a/users/templates/users/index_whitelist.html b/users/templates/users/index_whitelist.html index da03122b..7cab8830 100644 --- a/users/templates/users/index_whitelist.html +++ b/users/templates/users/index_whitelist.html @@ -24,11 +24,12 @@ with this program; if not, write to the Free Software Foundation, Inc., {% endcomment %} {% load bootstrap3 %} +{% load i18n %} -{% block title %}Utilisateurs{% endblock %} +{% block title %}{% trans "Users" %}{% endblock %} {% block content %} -

Accès à titre gracieux

+

{% trans "Whitelists" %}

{% include "users/aff_whitelists.html" with white_list=white_list %}

diff --git a/users/templates/users/mass_archive.html b/users/templates/users/mass_archive.html index 2626ae4e..84d9f72d 100644 --- a/users/templates/users/mass_archive.html +++ b/users/templates/users/mass_archive.html @@ -24,18 +24,19 @@ with this program; if not, write to the Free Software Foundation, Inc., {% endcomment %} {% load bootstrap3 %} +{% load i18n %} -{% block title %} Utilisateurs à archiver{% endblock %} +{% block title %}{% trans "Users to archive" %}{% endblock %} {% block content %} {% csrf_token %} {% bootstrap_form userform %} - - + + -

Les utilisateurs suivant seront archivés ({{ to_archive_list|length }}):

+

{% blocktrans %}The following users will be archived ({{ to_archive_list|length }}):{% endblocktrans %}

{% include "users/aff_users.html" with users_list=to_archive_list %}

diff --git a/users/templates/users/profil.html b/users/templates/users/profil.html index f573941b..0d391551 100644 --- a/users/templates/users/profil.html +++ b/users/templates/users/profil.html @@ -29,14 +29,14 @@ with this program; if not, write to the Free Software Foundation, Inc., {% load design %} {% load i18n %} -{% block title %}Profil{% endblock %} +{% block title %}{% trans "Profile" %}{% endblock %} {% block content %}
{% if user == users %} -

Welcome {{ users.name }} {{ users.surname }}

+

{% blocktrans with name=users.name surname=users.surname %}Welcome {{ name }} {{ surname }}{% endblocktrans %}

{% else %} -

Profil de {{ users.name }} {{ users.surname }}

+

{% blocktrans with name=users.name surname=users.surname %}Profile of {{ name }} {{ surname }}{% endblocktrans %}

{% endif %}
@@ -44,29 +44,29 @@ with this program; if not, write to the Free Software Foundation, Inc.,
{% if users.is_ban%}
-
Your account has been banned
+
{% trans "Your account has been banned" %}
- End of the ban: {{ users.end_ban | date:"SHORT_DATE_FORMAT" }} + {% blocktrans with end_ban=users.end_ban|date:"SHORT_DATE_FORMAT" %}End of the ban: {{ end_ban }}{% endblocktrans %}
{% elif not users.is_adherent %}
-
Not connected
-
+
{% trans "No connection" %}
+
{% can_create Facture %} - Pay for a connexion + {% trans "Pay for a connection" %} {% acl_else %} - Ask for someone with the correct rights to pay for a connexion + {% trans "Ask for someone with the appropriate rights to pay for a connection." %} {% acl_end %}
{% else %}
-
Connected
+
{% trans "Connection" %}
- End of connexion: {{ users.end_adhesion | date:"SHORT_DATE_FORMAT"}} + {% blocktrans with end_connection=user.end_adhesion|date:"SHORT_DATE_FORMAT" %}End of connection: {{ end_connection }}{% endblocktrans %}
{% endif %} @@ -79,7 +79,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
@@ -89,20 +89,20 @@ with this program; if not, write to the Free Software Foundation, Inc., {% if nb_machines %}
- Machines {{ nb_machines }} + {% trans " Machines" %}{{ nb_machines }}
{% else %}
-
No machines
+
{% trans "No machine" %}
@@ -111,147 +111,145 @@ with this program; if not, write to the Free Software Foundation, Inc.,
- -

- Informations détaillées + {% trans " Detailed information" %}

-
-
- - - Éditer - - - - Changer le mot de passe - - {% can_change User state %} - - - Changer le statut - - {% acl_end %} - {% can_change User groups %} - - - Gérer les groupes - - {% acl_end %} - {% history_button users text=True %} +
+
+ + + {% trans "Edit" %} + + + + {% trans "Change the password" %} + + {% can_change User state %} + + + {% trans "Change the state" %} + + {% acl_end %} + {% can_change User groups %} + + + {% trans "Edit the groups" %} + + {% acl_end %} + {% history_button users text=True %}
-
{% include "buttons/sort.html" with prefix='white' col="user" text="Utilisateur" %}Raison{% include "buttons/sort.html" with prefix='white' col="start" text="Date de début" %}{% include "buttons/sort.html" with prefix='white' col="end" text="Date de fin" %}{% include "buttons/sort.html" with prefix='white' col="user" text=tr_user %}{% trans "Reason" %}{% include "buttons/sort.html" with prefix='white' col="start" text=tr_start %}{% include "buttons/sort.html" with prefix='white' col="end" text=tr_end %}
{{ whitelist.user }} {{ whitelist.raison }} {{ whitelist.date_start }}
- - {% if users.is_class_club %} - - {% if users.club.mailing %} - - {% else %} - - {% endif %} - {% else %} - - - {% endif %} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {% if users.end_adhesion != None %} - - {% else %} - - {% endif %} - - {% if users.end_whitelist != None %} - - {% else %} - - {% endif %} - - - {% if users.end_ban != None %} - - {% else %} - - {% endif %} - - {% if users.state == 0 %} - - {% elif users.state == 1 %} - - {% else %} - - {% endif %} - - - - {% if users.has_access == True %} - - {% else %} - - {% endif %} - - {% if users.groups.all %} - - {% else %} - - {% endif %} - - - - - {% if users.adherent.gpg_fingerprint %} - - - {% endif %} - - - {% if users.shell %} - - - {% endif %} - -
Mailing{{ users.pseudo }}(-admin)Mailing désactivéePrénom{{ users.name }}Nom{{ users.surname }}
Pseudo{{ users.pseudo }}E-mail{{ users.email }}
Chambre{{ users.room }}Téléphone{{ users.telephone }}
École{{ users.school }}Commentaire{{ users.comment }}
Date d'inscription{{ users.registered }}Dernière connexion{{ users.last_login }}
Fin d'adhésion{{ users.end_adhesion }}Non adhérentAccès gracieux{{ users.end_whitelist }}Aucun
Bannissement{{ users.end_ban }}Non banniStatutActifDésactivéArchivé
Accès internetActif (jusqu'au {{ users.end_access }})DésactivéGroupes{{ users.groups.all|join:", "}}Aucun
Solde{{ users.solde }} € - {% if user_solde %} - - - Recharger - - {% endif %} - Empreinte GPG{{ users.adherent.gpg_fingerprint }}
Shell{{ users.shell }}
+ + + {% if users.is_class_club %} + + {% if users.club.mailing %} + + {% else %} + + {% endif %} + {% else %} + + + {% endif %} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + {% if users.end_adhesion != None %} + + {% else %} + + {% endif %} + + {% if users.end_whitelist != None %} + + {% else %} + + {% endif %} + + + {% if users.end_ban != None %} + + {% else %} + + {% endif %} + + {% if users.state == 0 %} + + {% elif users.state == 1 %} + + {% else %} + + {% endif %} + + + + {% if users.has_access == True %} + + {% else %} + + {% endif %} + + {% if users.groups.all %} + + {% else %} + + {% endif %} + + + + + {% if users.adherent.gpg_fingerprint %} + + + {% endif %} + + + {% if users.shell %} + + + {% endif %} + +
{% trans "Mailing" %}{{ users.pseudo }}(-admin){% trans "Mailing disabled" %}{% trans "Firt name" %}{{ users.name }}{% trans "Surname" %}{{ users.surname }}
{% trans "Username" %}{{ users.pseudo }}{% trans "Email address" %}{{ users.email }}
{% trans "Room" %}{{ users.room }}{% trans "Telephone number" %}{{ users.telephone }}
{% trans "School" %}{{ users.school }}{% trans "Comment" %}{{ users.comment }}
{% trans "Registration date" %}{{ users.registered }}{% trans "Last login" %}{{ users.last_login }}
{% trans "End of membership" %}{{ users.end_adhesion }}{% trans "Not a member" %}{% trans "Whitelist" %}{{ users.end_whitelist }}{% trans "None" %}
{% trans "Ban" %}{{ users.end_ban }}{% trans "Not banned" %}{% trans "State" %}{% trans "Active" %}{% trans "Disabled" %}{% trans "Archived" %}
{% trans "Internet access" %}{% blocktrans with end_access=users.end_access %}Active (until {{ end_access }}){% endblocktrans %}{% trans "Disabled" %}{% trans "Groups of rights" %}{{ users.groups.all|join:", "}}{% trans "None" %}
{% trans "Balance" %}{{ users.solde }} € + {% if user_solde %} + + + {% trans "Refill" %} + + {% endif %} + {% trans "GPG fingerprint" %}{{ users.adherent.gpg_fingerprint }}
{% trans "Shell" %}{{ users.shell }}
@@ -260,25 +258,25 @@ with this program; if not, write to the Free Software Foundation, Inc.,

- Gérer le club + {% trans " Manage the club" %}

- Gérer admin et membres - + {% trans "Manage the admins and members" %} +
-
-

Administrateurs du club

+
+

{% trans "Club admins" %}

- - - + + + {% for admin in users.club.administrators.all %} @@ -290,14 +288,14 @@ with this program; if not, write to the Free Software Foundation, Inc., {% endfor %}
NomPrenomPseudo{% trans "Surname" %}{% trans "First name" %}{% trans "Username" %}
-

Membres

+

{% trans "Members" %}

- - - + + + {% for admin in users.club.members.all %} @@ -317,22 +315,22 @@ with this program; if not, write to the Free Software Foundation, Inc.,

- Machines + {% trans "Machines" %} {{nb_machines}}

{% if machines_list %} {% include "machines/aff_machines.html" with machines_list=machines_list %} {% else %} -

Aucune machine

+

{% trans "No machine" %}

{% endif %}
@@ -341,7 +339,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,

- Cotisations + {% trans "Subscriptions" %}

@@ -349,12 +347,12 @@ with this program; if not, write to the Free Software Foundation, Inc., {% can_create Facture %} - Ajouter une cotisation + {% trans "Add as subscription" %} {% if user_solde %} - Modifier le solde + {% trans "Edit the balance" %} {% endif%} {% acl_end %} @@ -363,7 +361,7 @@ with this program; if not, write to the Free Software Foundation, Inc., {% if facture_list %} {% include "cotisations/aff_cotisations.html" with facture_list=facture_list %} {% else %} -

Aucune facture

+

{% trans "No invoice" %}

{% endif %}
@@ -372,15 +370,15 @@ with this program; if not, write to the Free Software Foundation, Inc.,

- Bannissements + {% trans "Bans" %}

-
- {% can_create Ban %} - - - Ajouter un bannissement + @@ -388,7 +386,7 @@ with this program; if not, write to the Free Software Foundation, Inc., {% if ban_list %} {% include "users/aff_bans.html" with ban_list=ban_list %} {% else %} -

Aucun bannissement

+

{% trans "No ban" %}

{% endif %}
@@ -397,23 +395,23 @@ with this program; if not, write to the Free Software Foundation, Inc.,

- Accès à titre gracieux + {% trans "Whitelists" %}

{% if white_list %} {% include "users/aff_whitelists.html" with white_list=white_list %} {% else %} -

Aucun accès gracieux

+

{% trans "No whitelist" %}

{% endif %}
@@ -421,14 +419,14 @@ with this program; if not, write to the Free Software Foundation, Inc.,

- Email settings + {% trans " Email settings" %}

@@ -437,22 +435,22 @@ with this program; if not, write to the Free Software Foundation, Inc.,
NomPrenomPseudo{% trans "Surname" %}{% trans "First name" %}{% trans "Username" %}
- + - + - +
Contact email address{% trans "Contact email address" %} {{ users.get_mail }}
Enable the local email account{% trans "Enable the local email account" %} {{ users.local_email_enabled | tick }}Enable the local email redirection{% trans "Enable the local email redirection" %} {{ users.local_email_redirect | tick }}
-

{% blocktrans %}The Contact email is the email address where we send email to contact you. If you would like to use your external email address for that, you can either disable your local email address or enable the local email redirection.{% endblocktrans %}

+

{% trans "The contact email address is the email address where we send emails to contact you. If you would like to use your external email address for that, you can either disable your local email address or enable the local email redirection." %}

{% if users.local_email_enabled %} {% can_create EMailAddress users.id %} - Add an email address + {% trans " Add an email address" %} {% acl_end %} {% if emailaddress_list %} @@ -463,7 +461,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
- +
Contact email address{% trans "Contact email address" %} {{ users.get_mail }}
@@ -474,3 +472,4 @@ with this program; if not, write to the Free Software Foundation, Inc.,
{% endblock %} + diff --git a/users/templates/users/sidebar.html b/users/templates/users/sidebar.html index 0b21afa7..ab20365e 100644 --- a/users/templates/users/sidebar.html +++ b/users/templates/users/sidebar.html @@ -23,74 +23,76 @@ with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. {% endcomment %} {% load acl %} +{% load i18n %} {% block sidebar %} {% if request.user.is_authenticated%} {% can_create Club %} - Créer un club/association + {% trans "Create a club or organisation" %} {% acl_end %} {% can_create Adherent %} - Créer un adhérent + {% trans "Create a user" %} {% acl_end %} {% endif %} {% can_view_all Club %} - Clubs et assos + {% trans "Clubs and organisations" %} {% acl_end %} {% can_view_all Adherent %} - Adherents + {% trans "Users" %} {% acl_end %} {% can_view_all Ban %} - Bannissements + {% trans "Bans" %} {% acl_end %} {% can_view_all Whitelist %} - Accès à titre gracieux + {% trans "Whitelists" %} {% acl_end %} {% can_view_all School %} - Établissements + {% trans "Schools" %} {% acl_end %} {% can_view_all ListShell %} - Liste des shells + {% trans "Shells" %} {% acl_end %} {% can_view_all ListRight %} - Groupes de droits + {% trans "Groups of rights" %} {% acl_end %} {% can_view_all ServiceUser %} - Gérer les service users - + {% trans "Service users" %} + {% acl_end %} {% can_change User state %} - Archiver en masse + {% trans "Massively archive" %} {% acl_end %} {% endblock %} + diff --git a/users/templates/users/user.html b/users/templates/users/user.html index 5e4048a3..1ed1a299 100644 --- a/users/templates/users/user.html +++ b/users/templates/users/user.html @@ -26,7 +26,8 @@ with this program; if not, write to the Free Software Foundation, Inc., {% load bootstrap3 %} {% load massive_bootstrap_form %} {% load static %} -{% block title %}Création et modification d'utilisateur{% endblock %} +{% load i18n %} +{% block title %}{% trans "Users" %}{% endblock %} {% block content %} {% bootstrap_form_errors userform %} @@ -41,11 +42,12 @@ with this program; if not, write to the Free Software Foundation, Inc., {% endif %}
{% if showCGU %} -

En cliquant sur Créer ou modifier, l'utilisateur s'engage à respecter les règles d'utilisation du réseau.

-

Résumé des règles d'utilisations

+

{% trans "By clicking 'Create or edit', the user commits to respect the " %}{% trans "General Terms of Use" %}.

+

{% trans "Summary of the General Terms of Use" %}

{{ GTU_sum_up }}

{% endif %}


{% endblock %} + diff --git a/users/views.py b/users/views.py index 5279dbb0..af311ceb 100644 --- a/users/views.py +++ b/users/views.py @@ -46,6 +46,7 @@ from django.db import transaction from django.http import HttpResponse from django.http import HttpResponseRedirect from django.views.decorators.csrf import csrf_exempt +from django.utils.translation import ugettext as _ from rest_framework.renderers import JSONRenderer from reversion import revisions as reversion @@ -118,8 +119,8 @@ def new_user(request): if user.is_valid(): user = user.save() user.reset_passwd_mail(request) - messages.success(request, "L'utilisateur %s a été crée, un mail\ - pour l'initialisation du mot de passe a été envoyé" % user.pseudo) + messages.success(request, _("The user %s was created, an email to set" + " the password was sent.") % user.pseudo) return redirect(reverse( 'users:profil', kwargs={'userid': str(user.id)} @@ -130,7 +131,7 @@ def new_user(request): 'GTU_sum_up': GTU_sum_up, 'GTU': GTU, 'showCGU': True, - 'action_name': 'Créer un utilisateur' + 'action_name': _("Create a user") }, 'users/user.html', request @@ -147,14 +148,14 @@ def new_club(request): club = club.save(commit=False) club.save() club.reset_passwd_mail(request) - messages.success(request, "L'utilisateur %s a été crée, un mail\ - pour l'initialisation du mot de passe a été envoyé" % club.pseudo) + messages.success(request, _("The club %s was created, an email to set" + " the password was sent.") % club.pseudo) return redirect(reverse( 'users:profil', kwargs={'userid': str(club.id)} )) return form( - {'userform': club, 'showCGU': False, 'action_name': 'Créer un club'}, + {'userform': club, 'showCGU': False, 'action_name': _("Create a club")}, 'users/user.html', request ) @@ -172,7 +173,7 @@ def edit_club_admin_members(request, club_instance, **_kwargs): if club.is_valid(): if club.changed_data: club.save() - messages.success(request, "Le club a bien été modifié") + messages.success(request, _("The club was edited.")) return redirect(reverse( 'users:profil', kwargs={'userid': str(club_instance.id)} @@ -181,7 +182,7 @@ def edit_club_admin_members(request, club_instance, **_kwargs): { 'userform': club, 'showCGU': False, - 'action_name': 'Editer les admin et membres' + 'action_name': _("Edit the admins and members") }, 'users/user.html', request @@ -209,13 +210,13 @@ def edit_info(request, user, userid): if user_form.is_valid(): if user_form.changed_data: user_form.save() - messages.success(request, "L'user a bien été modifié") + messages.success(request, _("The user was edited.")) return redirect(reverse( 'users:profil', kwargs={'userid': str(userid)} )) return form( - {'userform': user_form, 'action_name': "Editer l'utilisateur"}, + {'userform': user_form, 'action_name': _("Edit the user")}, 'users/user.html', request ) @@ -229,13 +230,13 @@ def state(request, user, userid): if state_form.is_valid(): if state_form.changed_data: state_form.save() - messages.success(request, "Etat changé avec succès") + messages.success(request, _("The state was edited.")) return redirect(reverse( 'users:profil', kwargs={'userid': str(userid)} )) return form( - {'userform': state_form, 'action_name': "Editer l'état"}, + {'userform': state_form, 'action_name': _("Edit the state")}, 'users/user.html', request ) @@ -250,13 +251,13 @@ def groups(request, user, userid): if group_form.is_valid(): if group_form.changed_data: group_form.save() - messages.success(request, "Groupes changés avec succès") + messages.success(request, _("The groups were edited.")) return redirect(reverse( 'users:profil', kwargs={'userid': str(userid)} )) return form( - {'userform': group_form, 'action_name': 'Editer les groupes'}, + {'userform': group_form, 'action_name': _("Edit the groups")}, 'users/user.html', request ) @@ -272,13 +273,13 @@ def password(request, user, userid): if u_form.is_valid(): if u_form.changed_data: u_form.save() - messages.success(request, "Le mot de passe a changé") + messages.success(request, _("The password was changed.")) return redirect(reverse( 'users:profil', kwargs={'userid': str(userid)} )) return form( - {'userform': u_form, 'action_name': 'Changer le mot de passe'}, + {'userform': u_form, 'action_name': _("Change the password")}, 'users/user.html', request ) @@ -290,7 +291,7 @@ def del_group(request, user, listrightid, **_kwargs): """ View used to delete a group """ user.groups.remove(ListRight.objects.get(id=listrightid)) user.save() - messages.success(request, "Droit supprimé à %s" % user) + messages.success(request, _("%s was removed from the group.") % user) return HttpResponseRedirect(request.META.get('HTTP_REFERER')) @@ -300,7 +301,7 @@ def del_superuser(request, user, **_kwargs): """Remove the superuser right of an user.""" user.is_superuser = False user.save() - messages.success(request, "%s n'est plus superuser" % user) + messages.success(request, _("%s is no longer superuser.") % user) return HttpResponseRedirect(request.META.get('HTTP_REFERER')) @@ -313,11 +314,11 @@ def new_serviceuser(request): user.save() messages.success( request, - "L'utilisateur a été crée" + _("The service user was created.") ) return redirect(reverse('users:index-serviceusers')) return form( - {'userform': user, 'action_name': 'Créer un serviceuser'}, + {'userform': user, 'action_name': _("Create a service user")}, 'users/user.html', request ) @@ -334,10 +335,10 @@ def edit_serviceuser(request, serviceuser, **_kwargs): if serviceuser.is_valid(): if serviceuser.changed_data: serviceuser.save() - messages.success(request, "L'user a bien été modifié") + messages.success(request, _("The service user was edited.")) return redirect(reverse('users:index-serviceusers')) return form( - {'userform': serviceuser, 'action_name': 'Editer un serviceuser'}, + {'userform': serviceuser, 'action_name': _("Edit a service user")}, 'users/user.html', request ) @@ -349,10 +350,10 @@ def del_serviceuser(request, serviceuser, **_kwargs): """Suppression d'un ou plusieurs serviceusers""" if request.method == "POST": serviceuser.delete() - messages.success(request, "L'user a été détruit") + messages.success(request, _("The service user was deleted.")) return redirect(reverse('users:index-serviceusers')) return form( - {'objet': serviceuser, 'objet_name': 'serviceuser'}, + {'objet': serviceuser, 'objet_name': 'service user'}, 'users/delete.html', request ) @@ -369,7 +370,7 @@ def add_ban(request, user, userid): ban = BanForm(request.POST or None, instance=ban_instance) if ban.is_valid(): ban.save() - messages.success(request, "Bannissement ajouté") + messages.success(request, _("The ban was added.")) return redirect(reverse( 'users:profil', kwargs={'userid': str(userid)} @@ -377,10 +378,10 @@ def add_ban(request, user, userid): if user.is_ban(): messages.error( request, - "Attention, cet utilisateur a deja un bannissement actif" + _("Warning: this user already has an active ban.") ) return form( - {'userform': ban, 'action_name': 'Ajouter un ban'}, + {'userform': ban, 'action_name': _("Add a ban")}, 'users/user.html', request ) @@ -396,10 +397,10 @@ def edit_ban(request, ban_instance, **_kwargs): if ban.is_valid(): if ban.changed_data: ban.save() - messages.success(request, "Bannissement modifié") + messages.success(request, _("The ban was edited.")) return redirect(reverse('users:index')) return form( - {'userform': ban, 'action_name': 'Editer un ban'}, + {'userform': ban, 'action_name': _("Edit a ban")}, 'users/user.html', request ) @@ -411,7 +412,7 @@ def del_ban(request, ban, **_kwargs): """ Supprime un banissement""" if request.method == "POST": ban.delete() - messages.success(request, "Le banissement a été supprimé") + messages.success(request, _("The ban was deleted.")) return redirect(reverse( 'users:profil', kwargs={'userid': str(ban.user.id)} @@ -438,7 +439,7 @@ def add_whitelist(request, user, userid): ) if whitelist.is_valid(): whitelist.save() - messages.success(request, "Accès à titre gracieux accordé") + messages.success(request, _("The whitelist was added.")) return redirect(reverse( 'users:profil', kwargs={'userid': str(userid)} @@ -446,10 +447,10 @@ def add_whitelist(request, user, userid): if user.is_whitelisted(): messages.error( request, - "Attention, cet utilisateur a deja un accès gracieux actif" + _("Warning: this user already has an active whitelist.") ) return form( - {'userform': whitelist, 'action_name': 'Ajouter une whitelist'}, + {'userform': whitelist, 'action_name': _("Add a whitelist")}, 'users/user.html', request ) @@ -469,10 +470,10 @@ def edit_whitelist(request, whitelist_instance, **_kwargs): if whitelist.is_valid(): if whitelist.changed_data: whitelist.save() - messages.success(request, "Whitelist modifiée") + messages.success(request, _("The whitelist was edited.")) return redirect(reverse('users:index')) return form( - {'userform': whitelist, 'action_name': 'Editer une whitelist'}, + {'userform': whitelist, 'action_name': _("Edit a whitelist")}, 'users/user.html', request ) @@ -484,7 +485,7 @@ def del_whitelist(request, whitelist, **_kwargs): """ Supprime un acces gracieux""" if request.method == "POST": whitelist.delete() - messages.success(request, "L'accés gracieux a été supprimé") + messages.success(request, _("The whitelist was deleted.")) return redirect(reverse( 'users:profil', kwargs={'userid': str(whitelist.user.id)} @@ -508,7 +509,7 @@ def add_emailaddress(request, user, userid): ) if emailaddress.is_valid(): emailaddress.save() - messages.success(request, "Local email account created") + messages.success(request, _("The local email account was created.")) return redirect(reverse( 'users:profil', kwargs={'userid': str(userid)} @@ -516,7 +517,7 @@ def add_emailaddress(request, user, userid): return form( {'userform': emailaddress, 'showCGU': False, - 'action_name': 'Add a local email account'}, + 'action_name': _("Add a local email account")}, 'users/user.html', request ) @@ -533,7 +534,7 @@ def edit_emailaddress(request, emailaddress_instance, **_kwargs): if emailaddress.is_valid(): if emailaddress.changed_data: emailaddress.save() - messages.success(request, "Local email account modified") + messages.success(request, _("The local email account was edited.")) return redirect(reverse( 'users:profil', kwargs={'userid': str(emailaddress_instance.user.id)} @@ -541,8 +542,7 @@ def edit_emailaddress(request, emailaddress_instance, **_kwargs): return form( {'userform': emailaddress, 'showCGU': False, - 'action_name': 'Edit a local email account', - }, + 'action_name': _("Edit a local email account")}, 'users/user.html', request ) @@ -554,7 +554,7 @@ def del_emailaddress(request, emailaddress, **_kwargs): """Delete a local email account""" if request.method == "POST": emailaddress.delete() - messages.success(request, "Local email account deleted") + messages.success(request, _("The local email account was deleted.")) return redirect(reverse( 'users:profil', kwargs={'userid': str(emailaddress.user.id)} @@ -578,7 +578,7 @@ def edit_email_settings(request, user_instance, **_kwargs): if email_settings.is_valid(): if email_settings.changed_data: email_settings.save() - messages.success(request, "Email settings updated") + messages.success(request, _("The email settings were edited.")) return redirect(reverse( 'users:profil', kwargs={'userid': str(user_instance.id)} @@ -587,7 +587,7 @@ def edit_email_settings(request, user_instance, **_kwargs): {'userform': email_settings, 'showCGU': False, 'load_js_file': '/static/js/email_address.js', - 'action_name': 'Edit the email settings'}, + 'action_name': _("Edit the email settings")}, 'users/user.html', request ) @@ -601,10 +601,10 @@ def add_school(request): school = SchoolForm(request.POST or None) if school.is_valid(): school.save() - messages.success(request, "L'établissement a été ajouté") + messages.success(request, _("The school was added.")) return redirect(reverse('users:index-school')) return form( - {'userform': school, 'action_name': 'Ajouter'}, + {'userform': school, 'action_name': _("Add a school")}, 'users/user.html', request ) @@ -619,10 +619,10 @@ def edit_school(request, school_instance, **_kwargs): if school.is_valid(): if school.changed_data: school.save() - messages.success(request, "Établissement modifié") + messages.success(request, _("The school was edited.")) return redirect(reverse('users:index-school')) return form( - {'userform': school, 'action_name': 'Editer'}, + {'userform': school, 'action_name': _("Edit a school")}, 'users/user.html', request ) @@ -641,15 +641,15 @@ def del_school(request, instances): for school_del in school_dels: try: school_del.delete() - messages.success(request, "L'établissement a été supprimé") + messages.success(request, _("The school was deleted.")) except ProtectedError: messages.error( request, - "L'établissement %s est affecté à au moins un user, \ - vous ne pouvez pas le supprimer" % school_del) + _("The school %s is assigned to at least one user," + " impossible to delete it.") % school_del) return redirect(reverse('users:index-school')) return form( - {'userform': school, 'action_name': 'Supprimer'}, + {'userform': school, 'action_name': _("Delete")}, 'users/user.html', request ) @@ -662,10 +662,10 @@ def add_shell(request): shell = ShellForm(request.POST or None) if shell.is_valid(): shell.save() - messages.success(request, "Le shell a été ajouté") + messages.success(request, _("The shell was added.")) return redirect(reverse('users:index-shell')) return form( - {'userform': shell, 'action_name': 'Ajouter'}, + {'userform': shell, 'action_name': _("Add a shell")}, 'users/user.html', request ) @@ -679,10 +679,10 @@ def edit_shell(request, shell_instance, **_kwargs): if shell.is_valid(): if shell.changed_data: shell.save() - messages.success(request, "Le shell a été modifié") + messages.success(request, _("The shell was edited.")) return redirect(reverse('users:index-shell')) return form( - {'userform': shell, 'action_name': 'Editer'}, + {'userform': shell, 'action_name': _("Edit a shell")}, 'users/user.html', request ) @@ -694,7 +694,7 @@ def del_shell(request, shell, **_kwargs): """Destruction d'un shell""" if request.method == "POST": shell.delete() - messages.success(request, "Le shell a été détruit") + messages.success(request, _("The shell was deleted.")) return redirect(reverse('users:index-shell')) return form( {'objet': shell, 'objet_name': 'shell'}, @@ -711,10 +711,10 @@ def add_listright(request): listright = NewListRightForm(request.POST or None) if listright.is_valid(): listright.save() - messages.success(request, "Le droit/groupe a été ajouté") + messages.success(request, _("The group of rights was added.")) return redirect(reverse('users:index-listright')) return form( - {'userform': listright, 'action_name': 'Ajouter'}, + {'userform': listright, 'action_name': _("Add a group of rights")}, 'users/user.html', request ) @@ -732,10 +732,10 @@ def edit_listright(request, listright_instance, **_kwargs): if listright.is_valid(): if listright.changed_data: listright.save() - messages.success(request, "Droit modifié") + messages.success(request, _("The group of rights was edited.")) return redirect(reverse('users:index-listright')) return form( - {'userform': listright, 'action_name': 'Editer'}, + {'userform': listright, 'action_name': _("Edit a group of rights")}, 'users/user.html', request ) @@ -752,15 +752,16 @@ def del_listright(request, instances): for listright_del in listright_dels: try: listright_del.delete() - messages.success(request, "Le droit/groupe a été supprimé") + messages.success(request, _("The group of rights was" + " deleted.")) except ProtectedError: messages.error( request, - "Le groupe %s est affecté à au moins un user, \ - vous ne pouvez pas le supprimer" % listright_del) + _("The group of rights %s is assigned to at least one" + " user, impossible to delete it.") % listright_del) return redirect(reverse('users:index-listright')) return form( - {'userform': listright, 'action_name': 'Supprimer'}, + {'userform': listright, 'action_name': _("Delete")}, 'users/user.html', request ) @@ -784,8 +785,8 @@ def mass_archive(request): with transaction.atomic(), reversion.create_revision(): user.archive() user.save() - reversion.set_comment("Archivage") - messages.success(request, "%s users ont été archivés" % len( + reversion.set_comment(_("Archiving")) + messages.success(request, _("%s users were archived.") % len( to_archive_list )) return redirect(reverse('users:index')) @@ -1034,18 +1035,17 @@ def reset_password(request): email=userform.cleaned_data['email'] ) except User.DoesNotExist: - messages.error(request, "Cet utilisateur n'existe pas") + messages.error(request, _("The user doesn't exist.")) return form( - {'userform': userform, 'action_name': 'Réinitialiser'}, + {'userform': userform, 'action_name': _("Reset")}, 'users/user.html', request ) user.reset_passwd_mail(request) - messages.success(request, "Un mail pour l'initialisation du mot\ - de passe a été envoyé") + messages.success(request, _("An email to reset the password was sent.")) redirect(reverse('index')) return form( - {'userform': userform, 'action_name': 'Réinitialiser'}, + {'userform': userform, 'action_name': _("Reset")}, 'users/user.html', request ) @@ -1059,7 +1059,7 @@ def process(request, token): if req.type == Request.PASSWD: return process_passwd(request, req) else: - messages.error(request, "Entrée incorrecte, contactez un admin") + messages.error(request, _("Error: please contact an admin.")) redirect(reverse('index')) @@ -1071,12 +1071,12 @@ def process_passwd(request, req): if u_form.is_valid(): with transaction.atomic(), reversion.create_revision(): u_form.save() - reversion.set_comment("Réinitialisation du mot de passe") + reversion.set_comment(_("Password reset")) req.delete() - messages.success(request, "Le mot de passe a changé") + messages.success(request, _("The password was changed.")) return redirect(reverse('index')) return form( - {'userform': u_form, 'action_name': 'Changer le mot de passe'}, + {'userform': u_form, 'action_name': _("Change the password")}, 'users/user.html', request ) @@ -1111,7 +1111,7 @@ def ml_std_members(request, ml_name): members = all_has_access().values('email').distinct() # Unknown mailing else: - messages.error(request, "Cette mailing n'existe pas") + messages.error(request, _("The mailing list doesn't exist.")) return redirect(reverse('index')) seria = MailingMemberSerializer(members, many=True) return JSONResponse(seria.data) @@ -1135,7 +1135,7 @@ def ml_club_admins(request, ml_name): try: club = Club.objects.get(mailing=True, pseudo=ml_name) except Club.DoesNotExist: - messages.error(request, "Cette mailing n'existe pas") + messages.error(request, _("The mailing list doesn't exist.")) return redirect(reverse('index')) members = club.administrators.all().values('email').distinct() seria = MailingMemberSerializer(members, many=True) @@ -1150,7 +1150,7 @@ def ml_club_members(request, ml_name): try: club = Club.objects.get(mailing=True, pseudo=ml_name) except Club.DoesNotExist: - messages.error(request, "Cette mailing n'existe pas") + messages.error(request, _("The mailing list doesn't exist.")) return redirect(reverse('index')) members = ( club.administrators.all().values('email').distinct() | @@ -1158,3 +1158,4 @@ def ml_club_members(request, ml_name): ) seria = MailingMemberSerializer(members, many=True) return JSONResponse(seria.data) +