diff --git a/users/acl.py b/users/acl.py index 993870a7..d66b3d2c 100644 --- a/users/acl.py +++ b/users/acl.py @@ -41,6 +41,6 @@ def can_view(user): can = user.has_module_perms("users") return ( can, - None if can else _("You don't have the right to view this" " application."), + None if can else _("You don't have the right to view this application."), ("users",), ) diff --git a/users/forms.py b/users/forms.py index 782e5aa1..cef1e43a 100644 --- a/users/forms.py +++ b/users/forms.py @@ -150,7 +150,7 @@ class UserCreationForm(FormRevMixin, forms.ModelForm): return self.cleaned_data.get("email").lower() else: raise forms.ValidationError( - _("You can't use an internal address" " as your external address.") + _("You can't use an internal address as your external address.") ) class Meta: @@ -293,7 +293,7 @@ class MassArchiveForm(forms.Form): date = forms.DateTimeField(help_text="%d/%m/%y") full_archive = forms.BooleanField( label=_( - "Make a full archive operation ? (WARNING : CRITICAL OPERATION IF TRUE)" + "Fully archive users? WARNING: CRITICAL OPERATION IF TRUE" ), initial=False, required=False, @@ -384,15 +384,14 @@ class AdherentCreationForm(AdherentForm): # Champ permettant d'éviter au maxium les doublons d'utilisateurs former_user_check_info = _( - "If you already have an account, please use it. " - + "If your lost access to it, please consider " - + "using the forgotten password button on the " - + "login page or contacting support." + "If you already have an account, please use it. If your lost access to" + " it, please consider using the forgotten password button on the" + " login page or contacting support." ) former_user_check = forms.BooleanField( required=True, help_text=former_user_check_info ) - former_user_check.label = _("I certify that I have not had an account before") + former_user_check.label = _("I certify that I have not had an account before.") # Checkbox for GTU gtu_check = forms.BooleanField(required=True) @@ -657,7 +656,7 @@ class NewListRightForm(ListRightForm): def __init__(self, *args, **kwargs): super(NewListRightForm, self).__init__(*args, **kwargs) self.fields["gid"].label = _( - "GID. Warning: this field must not be" " edited after creation." + "GID. Warning: this field must not be edited after creation." ) @@ -734,7 +733,7 @@ class EMailAddressForm(FormRevMixin, ModelForm): 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 address") - self.fields["local_part"].help_text = _("Can't contain @") + self.fields["local_part"].help_text = _("Can't contain @.") def clean_local_part(self): return self.cleaned_data.get("local_part").lower() diff --git a/users/models.py b/users/models.py index 225c4a9f..ba15354b 100755 --- a/users/models.py +++ b/users/models.py @@ -102,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( - _("The username '%(label)s' contains forbidden characters."), + _("The username \"%(label)s\" contains forbidden characters."), params={"label": login}, ) @@ -181,7 +181,7 @@ class User( (1, _("Disabled")), (2, _("Archived")), (3, _("Not yet active")), - (4, _("Full Archived")), + (4, _("Fully archived")), ) surname = models.CharField(max_length=255) @@ -213,7 +213,7 @@ class User( "ListShell", on_delete=models.PROTECT, null=True, blank=True ) comment = models.CharField( - help_text=_("Comment, school year"), max_length=255, blank=True + help_text=_("Comment, school year."), max_length=255, blank=True ) pwd_ntlm = models.CharField(max_length=255) state = models.IntegerField(choices=STATES, default=STATE_NOT_YET_ACTIVE) @@ -222,7 +222,7 @@ class User( uid_number = models.PositiveIntegerField(default=get_fresh_user_uid, unique=True) rezo_rez_uid = models.PositiveIntegerField(unique=True, blank=True, null=True) shortcuts_enabled = models.BooleanField( - verbose_name=_("Enable shortcuts on Re2o website"), default=True + verbose_name=_("enable shortcuts on Re2o website"), default=True ) USERNAME_FIELD = "pseudo" @@ -238,9 +238,9 @@ class User( ("change_user_shell", _("Can edit the shell of a user")), ( "change_user_groups", - _("Can edit the groups of rights of a user (critical" " permission)"), + _("Can edit the groups of rights of a user (critical permission)"), ), - ("change_all_users", _("Can edit all users, including those with rights.")), + ("change_all_users", _("Can edit all users, including those with rights")), ("view_user", _("Can view a user object")), ) verbose_name = _("user (member or club)") @@ -548,21 +548,21 @@ class User( interfaces = self.user_interfaces() with transaction.atomic(), reversion.create_revision(): Interface.mass_assign_ipv4(interfaces) - reversion.set_comment(_("IPv4 assigning")) + reversion.set_comment("IPv4 assignment") def unassign_ips(self): """ Désassigne les ipv4 aux machines de l'user""" interfaces = self.user_interfaces() with transaction.atomic(), reversion.create_revision(): Interface.mass_unassign_ipv4(interfaces) - reversion.set_comment(_("IPv4 unassigning")) + reversion.set_comment("IPv4 unassignment") @classmethod def mass_unassign_ips(cls, users_list): interfaces = cls.users_interfaces(users_list) with transaction.atomic(), reversion.create_revision(): Interface.mass_unassign_ipv4(interfaces) - reversion.set_comment(_("IPv4 assigning")) + reversion.set_comment("IPv4 assignment") @classmethod def mass_disable_email(cls, queryset_users): @@ -761,11 +761,10 @@ class User( "url": request.build_absolute_uri( reverse("users:process", kwargs={"token": req.token}) ), - "expire_in": str(GeneralOption.get_cached_value("req_expire_hrs")) - + " hours", + "expire_in": str(GeneralOption.get_cached_value("req_expire_hrs")), } send_mail( - "Changement de mot de passe du %(name)s / Password renewal for " + "Changement de mot de passe de %(name)s / Password change for " "%(name)s" % {"name": AssoOption.get_cached_value("name")}, template.render(context), GeneralOption.get_cached_value("email_from"), @@ -902,7 +901,7 @@ class User( if self.groups.filter(listright__critical=True): return ( False, - _("User with critical rights, can't be edited. "), + _("User with critical rights, can't be edited."), ("users.change_all_users",), ) elif self == AssoOption.get_cached_value("utilisateur_asso"): @@ -910,7 +909,7 @@ class User( False, _( "Impossible to edit the organisation's" - " user without the 'change_all_users' right." + " user without the \"change_all_users\" right." ), ("users.change_all_users",), ) @@ -985,7 +984,7 @@ class User( ): return ( False, - _("Permission required to change the room."), + _("You don't have the right to change the room."), ("users.change_user",), ) else: @@ -1002,7 +1001,7 @@ class User( can = user_request.has_perm("users.change_user_state") return ( can, - _("Permission required to change the state.") if not can else None, + _("You don't have the right to change the state.") if not can else None, ("users.change_user_state",), ) @@ -1022,7 +1021,7 @@ class User( ): return ( False, - _("Permission required to change the shell."), + _("You don't have the right to change the shell."), ("users.change_user_shell",), ) else: @@ -1069,7 +1068,7 @@ class User( can = user_request.has_perm("users.change_user_force") return ( can, - _("Permission required to force the move.") if not can else None, + _("You don't have the right to force the move.") if not can else None, ("users.change_user_force",), ) @@ -1084,7 +1083,7 @@ class User( can = user_request.has_perm("users.change_user_grou") return ( can, - _("Permission required to edit the user's groups of rights.") + _("You don't have the right to edit the user's groups of rights.") if not can else None, ("users.change_user_groups"), @@ -1100,7 +1099,7 @@ class User( can = user_request.is_superuser return ( can, - _("'superuser' right required to edit the superuser flag.") + _("\"superuser\" right required to edit the superuser flag.") if not can else None, [], @@ -1241,7 +1240,7 @@ class Adherent(User): gpg_fingerprint = self.gpg_fingerprint.replace(" ", "").upper() if not re.match("^[0-9A-F]{40}$", gpg_fingerprint): raise ValidationError( - _("A GPG fingerprint must contain 40 hexadecimal characters") + _("A GPG fingerprint must contain 40 hexadecimal characters.") ) self.gpg_fingerprint = gpg_fingerprint @@ -1265,7 +1264,7 @@ class Adherent(User): if not user_request.is_authenticated and not OptionalUser.get_cached_value( "self_adhesion" ): - return False, _("Self adhesion is disabled."), None + return False, _("Self registration is disabled."), None else: if OptionalUser.get_cached_value( "all_can_create_adherent" @@ -1418,7 +1417,7 @@ class ServiceUser(RevMixin, AclMixin, AbstractBaseUser): validators=[linux_user_validator], ) access_group = models.CharField(choices=ACCESS, default=readonly, max_length=32) - comment = models.CharField(help_text=_("Comment"), max_length=255, blank=True) + comment = models.CharField(help_text=_("Comment."), max_length=255, blank=True) USERNAME_FIELD = "pseudo" objects = UserManager() @@ -1518,13 +1517,13 @@ class ListRight(RevMixin, AclMixin, Group): validators=[ RegexValidator( "^[a-z]+$", - message=(_("UNIX groups can only contain lower case letters.")), + message=(_("UNIX group names can only contain lower case letters.")), ) ], ) gid = models.PositiveIntegerField(unique=True, null=True) critical = models.BooleanField(default=False) - details = models.CharField(help_text=_("Description"), max_length=255, blank=True) + details = models.CharField(help_text=_("Description."), max_length=255, blank=True) class Meta: permissions = (("view_listright", _("Can view a group of rights object")),) @@ -1643,7 +1642,7 @@ class Ban(RevMixin, AclMixin, models.Model): if not user_request.has_perm("users.view_ban") and self.user != user_request: return ( False, - _("You don't have the right to view bans other than yours."), + _("You don't have the right to view other bans than yours."), ("users.view_ban",), ) else: @@ -1713,7 +1712,7 @@ class Whitelist(RevMixin, AclMixin, models.Model): ): return ( False, - _("You don't have the right to view whitelists other than yours."), + _("You don't have the right to view other whitelists than yours."), ("users.view_whitelist",), ) else: @@ -1910,10 +1909,10 @@ class EMailAddress(RevMixin, AclMixin, models.Model): """ user = models.ForeignKey( - User, on_delete=models.CASCADE, help_text=_("User of the local email account") + User, on_delete=models.CASCADE, 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") + unique=True, max_length=128, help_text=_("Local part of the email address.") ) class Meta: @@ -1990,7 +1989,7 @@ class EMailAddress(RevMixin, AclMixin, models.Model): return ( False, _( - "You don't have the right to edit another user's local" + "You don't have the right to view another user's local" " email account." ), ("users.view_emailaddress",), @@ -2025,7 +2024,7 @@ class EMailAddress(RevMixin, AclMixin, models.Model): False, _( "You don't have the right to delete another user's" - " local email account" + " local email account." ), ("users.delete_emailaddress",), ) diff --git a/users/templates/users/aff_listright.html b/users/templates/users/aff_listright.html index 2a829e7e..489a713a 100644 --- a/users/templates/users/aff_listright.html +++ b/users/templates/users/aff_listright.html @@ -37,7 +37,7 @@ with this program; if not, write to the Free Software Foundation, Inc., {% trans "Superuser" %} - {% trans "Django's specific pre-defined right that supersed any other rights." %} + {% trans "Django's specific pre-defined right that supersedes any other rights." %}
diff --git a/users/templates/users/aff_serviceusers.html b/users/templates/users/aff_serviceusers.html index 6d0c7dc8..68de1d99 100644 --- a/users/templates/users/aff_serviceusers.html +++ b/users/templates/users/aff_serviceusers.html @@ -30,7 +30,7 @@ with this program; if not, write to the Free Software Foundation, Inc., {% trans "Name" %} - {% trans "Role" %} + {% trans "Access group" %} {% trans "Comment" %} diff --git a/users/templates/users/index_listright.html b/users/templates/users/index_listright.html index cb5b86d6..32b18134 100644 --- a/users/templates/users/index_listright.html +++ b/users/templates/users/index_listright.html @@ -32,9 +32,9 @@ with this program; if not, write to the Free Software Foundation, Inc., {% block content %}

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

{% can_create ListRight %} - {% trans " Add a group of rights" %} + {% trans "Add a group of rights" %} {% acl_end %} - {% trans " Delete one or several groups of rights" %} + {% trans "Delete one or several groups of rights" %}

{% include 'users/aff_listright.html' %} diff --git a/users/templates/users/index_schools.html b/users/templates/users/index_schools.html index 4d86ce67..6e98465b 100644 --- a/users/templates/users/index_schools.html +++ b/users/templates/users/index_schools.html @@ -31,11 +31,11 @@ with this program; if not, write to the Free Software Foundation, Inc., {% block content %}

{% trans "List of schools" %}

-
{% trans "List of schools for created users" %}
+
{% trans "List of schools for registered users" %}
{% can_create School %} - {% trans " Add a school" %} + {% trans "Add a school" %} {% acl_end %} - {% trans " Delete one or several schools" %} + {% 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 c7684488..0ab7db9b 100644 --- a/users/templates/users/index_serviceusers.html +++ b/users/templates/users/index_serviceusers.html @@ -33,7 +33,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,

{% 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 %} - {% trans " Add a 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 d476f9d2..e029b107 100644 --- a/users/templates/users/index_shell.html +++ b/users/templates/users/index_shell.html @@ -32,7 +32,7 @@ with this program; if not, write to the Free Software Foundation, Inc., {% block content %}

{% trans "List of shells" %}

{% can_create ListShell %} - {% trans " Add a shell" %} + {% trans "Add a shell" %} {% acl_end %} {% include 'users/aff_shell.html' with shell_list=shell_list %}
diff --git a/users/templates/users/mass_archive.html b/users/templates/users/mass_archive.html index c3f67a34..5b44f6ec 100644 --- a/users/templates/users/mass_archive.html +++ b/users/templates/users/mass_archive.html @@ -36,7 +36,7 @@ with this program; if not, write to the Free Software Foundation, Inc., -

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

+

{% blocktrans %}The following users will be archived:{% 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 bf3fd9e5..0bd25f75 100644 --- a/users/templates/users/profil.html +++ b/users/templates/users/profil.html @@ -43,7 +43,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
{% if users.is_ban%}
-
{% trans "Your account has been banned" %}
+
{% trans "Your account has been banned." %}
{% blocktrans with end_ban_date=users.end_ban|date:"SHORT_DATE_FORMAT" %}End of the ban: {{ end_ban_date }}{% endblocktrans %}
@@ -57,7 +57,7 @@ with this program; if not, write to the Free Software Foundation, Inc., {% trans "Pay for a connection" %} {% acl_else %} - {% trans "Ask for someone with the appropriate rights to pay for a connection." %} + {% trans "Ask someone with the appropriate rights to pay for a connection." %} {% acl_end %}
@@ -94,11 +94,11 @@ with this program; if not, write to the Free Software Foundation, Inc.,
- {% trans " Machines" %} {{ nb_machines }} + {% trans "Machines" %} {{ nb_machines }}
@@ -110,7 +110,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
- {% trans " Add a machine" %} + {% trans "Add a machine" %}
@@ -125,7 +125,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,

- {% trans " Detailed information" %} + {% trans "Detailed information" %}

@@ -225,7 +225,7 @@ with this program; if not, write to the Free Software Foundation, Inc., {% if users.end_adhesion != None %}
{{ users.end_adhesion }}
{% else %} -
{% trans "not a member" %}
+
{% trans "Not a member" %}
{% endif %}
@@ -256,9 +256,9 @@ with this program; if not, write to the Free Software Foundation, Inc., {% elif users.state == 2 %}
{% trans "Archived" %}
{% elif users.state == 3 %} -
{% trans "Not yet member" %}
+
{% trans "Not yet active" %}
{% elif users.state == 4 %} -
{% trans "Full Archived" %}
+
{% trans "Fully archived" %}
{% endif %} @@ -320,7 +320,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,

- {% trans " Manage the club" %} + {% trans "Manage the club" %}

@@ -484,14 +484,14 @@ with this program; if not, write to the Free Software Foundation, Inc.,

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

@@ -510,12 +510,12 @@ with this program; if not, write to the Free Software Foundation, Inc., {{ users.local_email_redirect | tick }} -

{% 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." %}

+

{% trans "The contact email address is the email address to which 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 %} - {% trans " Add an email address" %} + {% trans "Add an email address" %} {% acl_end %} {% if emailaddress_list %} diff --git a/users/templates/users/user_autocapture.html b/users/templates/users/user_autocapture.html index 79a4b3c2..469e2ec3 100644 --- a/users/templates/users/user_autocapture.html +++ b/users/templates/users/user_autocapture.html @@ -32,7 +32,7 @@ with this program; if not, write to the Free Software Foundation, Inc., {% block content %} {% bootstrap_form_errors userform %} -

{% blocktrans %}Device and room register form{% endblocktrans %}

+

{% trans "Device and room register form" %}

{% csrf_token %} @@ -61,7 +61,8 @@ with this program; if not, write to the Free Software Foundation, Inc.,
-
{% bootstrap_button _("OK") button_type="submit" icon='ok' button_class='btn-success' %}
+{% trans "OK" as tr_ok %} +
{% bootstrap_button tr_ok button_type="submit" icon='ok' button_class='btn-success' %}
diff --git a/users/views.py b/users/views.py index abc7025e..3fb4d472 100644 --- a/users/views.py +++ b/users/views.py @@ -124,7 +124,7 @@ def new_user(request): user.reset_passwd_mail(request) messages.success( request, - _("The user %s was created, an email to set" " the password was sent.") + _("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)})) @@ -153,7 +153,7 @@ def new_club(request): club.reset_passwd_mail(request) messages.success( request, - _("The club %s was created, an email to set" " the password was sent.") + _("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)})) @@ -181,7 +181,7 @@ def edit_club_admin_members(request, club_instance, **_kwargs): { "userform": club, "showCGU": False, - "action_name": _("Edit the admins and members"), + "action_name": _("Edit"), }, "users/user.html", request, @@ -208,7 +208,7 @@ def edit_info(request, user, userid): messages.success(request, _("The user was edited.")) return redirect(reverse("users:profil", kwargs={"userid": str(userid)})) return form( - {"userform": user_form, "action_name": _("Edit the user")}, + {"userform": user_form, "action_name": _("Edit")}, "users/user.html", request, ) @@ -225,7 +225,7 @@ def state(request, user, userid): messages.success(request, _("The state was edited.")) return redirect(reverse("users:profil", kwargs={"userid": str(userid)})) return form( - {"userform": state_form, "action_name": _("Edit the state")}, + {"userform": state_form, "action_name": _("Edit")}, "users/user.html", request, ) @@ -242,7 +242,7 @@ def groups(request, user, userid): messages.success(request, _("The groups were edited.")) return redirect(reverse("users:profil", kwargs={"userid": str(userid)})) return form( - {"userform": group_form, "action_name": _("Edit the groups")}, + {"userform": group_form, "action_name": _("Edit")}, "users/user.html", request, ) @@ -297,7 +297,7 @@ def new_serviceuser(request): messages.success(request, _("The service user was created.")) return redirect(reverse("users:index-serviceusers")) return form( - {"userform": user, "action_name": _("Create a service user")}, + {"userform": user, "action_name": _("Add")}, "users/user.html", request, ) @@ -314,7 +314,7 @@ def edit_serviceuser(request, serviceuser, **_kwargs): messages.success(request, _("The service user was edited.")) return redirect(reverse("users:index-serviceusers")) return form( - {"userform": serviceuser, "action_name": _("Edit a service user")}, + {"userform": serviceuser, "action_name": _("Edit")}, "users/user.html", request, ) @@ -329,7 +329,7 @@ def del_serviceuser(request, serviceuser, **_kwargs): messages.success(request, _("The service user was deleted.")) return redirect(reverse("users:index-serviceusers")) return form( - {"objet": serviceuser, "objet_name": "service user"}, + {"objet": serviceuser, "objet_name": _("service user")}, "users/delete.html", request, ) @@ -351,7 +351,7 @@ def add_ban(request, user, userid): if user.is_ban(): messages.error(request, _("Warning: this user already has an active ban.")) return form( - {"userform": ban, "action_name": _("Add a ban")}, "users/user.html", request + {"userform": ban, "action_name": _("Add")}, "users/user.html", request ) @@ -368,7 +368,7 @@ def edit_ban(request, ban_instance, **_kwargs): messages.success(request, _("The ban was edited.")) return redirect(reverse("users:index")) return form( - {"userform": ban, "action_name": _("Edit a ban")}, "users/user.html", request + {"userform": ban, "action_name": _("Edit")}, "users/user.html", request ) @@ -380,7 +380,7 @@ def del_ban(request, ban, **_kwargs): ban.delete() messages.success(request, _("The ban was deleted.")) return redirect(reverse("users:profil", kwargs={"userid": str(ban.user.id)})) - return form({"objet": ban, "objet_name": "ban"}, "users/delete.html", request) + return form({"objet": ban, "objet_name": _("ban")}, "users/delete.html", request) @login_required @@ -402,7 +402,7 @@ def add_whitelist(request, user, userid): request, _("Warning: this user already has an active whitelist.") ) return form( - {"userform": whitelist, "action_name": _("Add a whitelist")}, + {"userform": whitelist, "action_name": _("Add")}, "users/user.html", request, ) @@ -422,7 +422,7 @@ def edit_whitelist(request, whitelist_instance, **_kwargs): messages.success(request, _("The whitelist was edited.")) return redirect(reverse("users:index")) return form( - {"userform": whitelist, "action_name": _("Edit a whitelist")}, + {"userform": whitelist, "action_name": _("Edit")}, "users/user.html", request, ) @@ -439,7 +439,7 @@ def del_whitelist(request, whitelist, **_kwargs): reverse("users:profil", kwargs={"userid": str(whitelist.user.id)}) ) return form( - {"objet": whitelist, "objet_name": "whitelist"}, "users/delete.html", request + {"objet": whitelist, "objet_name": _("whitelist")}, "users/delete.html", request ) @@ -460,7 +460,7 @@ def add_emailaddress(request, user, userid): { "userform": emailaddress, "showCGU": False, - "action_name": _("Add a local email account"), + "action_name": _("Add"), }, "users/user.html", request, @@ -487,7 +487,7 @@ def edit_emailaddress(request, emailaddress_instance, **_kwargs): { "userform": emailaddress, "showCGU": False, - "action_name": _("Edit a local email account"), + "action_name": _("Edit"), }, "users/user.html", request, @@ -505,7 +505,7 @@ def del_emailaddress(request, emailaddress, **_kwargs): reverse("users:profil", kwargs={"userid": str(emailaddress.user.id)}) ) return form( - {"objet": emailaddress, "objet_name": "emailaddress"}, + {"objet": emailaddress, "objet_name": _("email address")}, "users/delete.html", request, ) @@ -530,7 +530,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"), }, "users/user.html", request, @@ -548,7 +548,7 @@ def add_school(request): messages.success(request, _("The school was added.")) return redirect(reverse("users:index-school")) return form( - {"userform": school, "action_name": _("Add a school")}, + {"userform": school, "action_name": _("Add")}, "users/user.html", request, ) @@ -566,7 +566,7 @@ def edit_school(request, school_instance, **_kwargs): messages.success(request, _("The school was edited.")) return redirect(reverse("users:index-school")) return form( - {"userform": school, "action_name": _("Edit a school")}, + {"userform": school, "action_name": _("Edit")}, "users/user.html", request, ) @@ -597,7 +597,7 @@ def del_school(request, instances): ) return redirect(reverse("users:index-school")) return form( - {"userform": school, "action_name": _("Delete")}, "users/user.html", request + {"userform": school, "action_name": _("Confirm")}, "users/user.html", request ) @@ -611,7 +611,7 @@ def add_shell(request): messages.success(request, _("The shell was added.")) return redirect(reverse("users:index-shell")) return form( - {"userform": shell, "action_name": _("Add a shell")}, "users/user.html", request + {"userform": shell, "action_name": _("Add")}, "users/user.html", request ) @@ -626,7 +626,7 @@ def edit_shell(request, shell_instance, **_kwargs): messages.success(request, _("The shell was edited.")) return redirect(reverse("users:index-shell")) return form( - {"userform": shell, "action_name": _("Edit a shell")}, + {"userform": shell, "action_name": _("Edit")}, "users/user.html", request, ) @@ -640,7 +640,7 @@ def del_shell(request, shell, **_kwargs): shell.delete() messages.success(request, _("The shell was deleted.")) return redirect(reverse("users:index-shell")) - return form({"objet": shell, "objet_name": "shell"}, "users/delete.html", request) + return form({"objet": shell, "objet_name": _("shell")}, "users/delete.html", request) @login_required @@ -654,7 +654,7 @@ def add_listright(request): messages.success(request, _("The group of rights was added.")) return redirect(reverse("users:index-listright")) return form( - {"userform": listright, "action_name": _("Add a group of rights")}, + {"userform": listright, "action_name": _("Add")}, "users/user.html", request, ) @@ -672,7 +672,7 @@ def edit_listright(request, listright_instance, **_kwargs): messages.success(request, _("The group of rights was edited.")) return redirect(reverse("users:index-listright")) return form( - {"userform": listright, "action_name": _("Edit a group of rights")}, + {"userform": listright, "action_name": _("Edit")}, "users/user.html", request, ) @@ -689,7 +689,7 @@ def del_listright(request, instances): for listright_del in listright_dels: try: listright_del.delete() - messages.success(request, _("The group of rights was" " deleted.")) + messages.success(request, _("The group of rights was deleted.")) except ProtectedError: messages.error( request, @@ -701,7 +701,7 @@ def del_listright(request, instances): ) return redirect(reverse("users:index-listright")) return form( - {"userform": listright, "action_name": _("Delete")}, "users/user.html", request + {"userform": listright, "action_name": _("Confirm")}, "users/user.html", request ) @@ -993,7 +993,7 @@ def process_passwd(request, req): if u_form.is_valid(): with transaction.atomic(), reversion.create_revision(): u_form.save() - reversion.set_comment(_("Password reset")) + reversion.set_comment("Password reset") req.delete() messages.success(request, _("The password was changed.")) return redirect(reverse("index"))