From 038a11fb7542ada44716f2ac7ccb79337de06af9 Mon Sep 17 00:00:00 2001 From: Laouen Fernet Date: Sat, 16 Nov 2019 14:07:59 +0000 Subject: [PATCH] Mark strings for translation in preferences --- preferences/acl.py | 3 +- preferences/forms.py | 26 +-- preferences/models.py | 165 +++++++++--------- .../templates/preferences/aff_mandate.html | 2 +- .../templates/preferences/aff_radiuskey.html | 2 +- .../preferences/aff_radiusoptions.html | 2 +- .../templates/preferences/aff_service.html | 2 +- .../preferences/aff_switchmanagementcred.html | 2 +- .../preferences/display_preferences.html | 30 ++-- preferences/views.py | 30 ++-- 10 files changed, 133 insertions(+), 131 deletions(-) diff --git a/preferences/acl.py b/preferences/acl.py index 27b209b7..e1b47faf 100644 --- a/preferences/acl.py +++ b/preferences/acl.py @@ -41,6 +41,7 @@ def can_view(user): can = user.has_module_perms("preferences") 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."), ("preferences",), ) diff --git a/preferences/forms.py b/preferences/forms.py index ea1079b4..9ea9fca5 100644 --- a/preferences/forms.py +++ b/preferences/forms.py @@ -81,13 +81,13 @@ class EditOptionalMachineForm(ModelForm): prefix = kwargs.pop("prefix", self.Meta.model.__name__) super(EditOptionalMachineForm, self).__init__(*args, prefix=prefix, **kwargs) self.fields["password_machine"].label = _( - "Possibility to set a" " password per machine" + "Possibility to set a password per machine" ) self.fields["max_lambdauser_interfaces"].label = _( - "Maximum number of" " interfaces" " allowed for a" " standard user" + "Maximum number of interfaces allowed for a standard user" ) self.fields["max_lambdauser_aliases"].label = _( - "Maximum number of DNS" " aliases allowed for" " a standard user" + "Maximum number of DNS aliases allowed for a standard user" ) self.fields["ipv6_mode"].label = _("IPv6 mode") self.fields["create_machine"].label = _("Can create a machine") @@ -136,20 +136,20 @@ class EditGeneralOptionForm(ModelForm): self.fields["general_message_fr"].label = _("General message in French") self.fields["general_message_en"].label = _("General message in English") self.fields["search_display_page"].label = _( - "Number of results" " displayed when" " searching" + "Number of results displayed when searching" ) self.fields["pagination_number"].label = _( - "Number of items per page," " standard size (e.g." " users)" + "Number of items per page, standard size (e.g. users)" ) self.fields["pagination_large_number"].label = _( - "Number of items per" " page, large size" " (e.g. machines)" + "Number of items per page, large size (e.g. machines)" ) self.fields["req_expire_hrs"].label = _( - "Time before expiration of the" " reset password link (in" " hours)" + "Time before expiration of the reset password link (in hours)" ) self.fields["site_name"].label = _("Website name") - self.fields["email_from"].label = _("Email address for automatic" " emailing") - self.fields["GTU_sum_up"].label = _("Summary of the General Terms of" " Use") + self.fields["email_from"].label = _("Email address for automatic emailing") + self.fields["GTU_sum_up"].label = _("Summary of the General Terms of Use") self.fields["GTU"].label = _("General Terms of Use") @@ -171,7 +171,7 @@ class EditAssoOptionForm(ModelForm): self.fields["telephone"].label = _("Telephone number") self.fields["pseudo"].label = _("Usual name") self.fields["utilisateur_asso"].label = _( - "Account used for editing" " from /admin" + "Account used for editing from /admin" ) self.fields["description"].label = _("Description") @@ -187,10 +187,10 @@ class EditMailMessageOptionForm(ModelForm): prefix = kwargs.pop("prefix", self.Meta.model.__name__) super(EditMailMessageOptionForm, self).__init__(*args, prefix=prefix, **kwargs) self.fields["welcome_mail_fr"].label = _( - "Message for the French" " welcome email" + "Message for the French welcome email" ) self.fields["welcome_mail_en"].label = _( - "Message for the English" " welcome email" + "Message for the English welcome email" ) @@ -451,7 +451,7 @@ class DelDocumentTemplateForm(FormRevMixin, Form): document_templates = forms.ModelMultipleChoiceField( queryset=DocumentTemplate.objects.none(), - label=_("Available document templates"), + label=_("Current document templates"), widget=forms.CheckboxSelectMultiple, ) diff --git a/preferences/models.py b/preferences/models.py index 7ef8979b..b8189384 100644 --- a/preferences/models.py +++ b/preferences/models.py @@ -95,16 +95,16 @@ class OptionalUser(AclMixin, PreferencesModel): local_email_domain = models.CharField( max_length=32, default="@example.org", - help_text=_("Domain to use for local email accounts"), + help_text=_("Domain to use for local email accounts."), ) max_email_address = models.IntegerField( default=15, - help_text=_("Maximum number of local email addresses for a standard" " user."), + help_text=_("Maximum number of local email addresses for a standard user."), ) delete_notyetactive = models.IntegerField( default=15, help_text=_( - "Not yet active users will be deleted after this number of" " days." + "Not yet active users will be deleted after this number of days." ), ) self_adhesion = models.BooleanField( @@ -122,15 +122,15 @@ class OptionalUser(AclMixin, PreferencesModel): ) class Meta: - permissions = (("view_optionaluser", _("Can view the user options")),) - verbose_name = _("user options") + permissions = (("view_optionaluser", _("Can view the user preferences")),) + verbose_name = _("user preferences") def clean(self): """Clean model: Check the mail_extension """ if self.local_email_domain[0] != "@": - raise ValidationError(_("Email domain must begin with @")) + raise ValidationError(_("Email domain must begin with @.")) @receiver(post_save, sender=OptionalUser) @@ -148,8 +148,8 @@ class OptionalMachine(AclMixin, PreferencesModel): DHCPV6 = "DHCPV6" DISABLED = "DISABLED" CHOICE_IPV6 = ( - (SLAAC, _("Autoconfiguration by RA")), - (DHCPV6, _("IP addresses assigning by DHCPv6")), + (SLAAC, _("Automatic configuration by RA")), + (DHCPV6, _("IP addresses assignment by DHCPv6")), (DISABLED, _("Disabled")), ) @@ -159,7 +159,7 @@ class OptionalMachine(AclMixin, PreferencesModel): ipv6_mode = models.CharField(max_length=32, choices=CHOICE_IPV6, default="DISABLED") create_machine = models.BooleanField(default=True) default_dns_ttl = models.PositiveIntegerField( - verbose_name=_("Default Time To Live (TTL) for CNAME, A and AAA records."), + verbose_name=_("default Time To Live (TTL) for CNAME, A and AAAA records"), default=172800, # 2 days ) @@ -169,8 +169,8 @@ class OptionalMachine(AclMixin, PreferencesModel): return not self.get_cached_value("ipv6_mode") == "DISABLED" class Meta: - permissions = (("view_optionalmachine", _("Can view the machine options")),) - verbose_name = _("machine options") + permissions = (("view_optionalmachine", _("Can view the machine preferences")),) + verbose_name = _("machine preferences") @receiver(post_save, sender=OptionalMachine) @@ -191,43 +191,43 @@ class OptionalTopologie(AclMixin, PreferencesModel): DEFINED = "DEFINED" CHOICE_RADIUS = ( (MACHINE, _("On the IP range's VLAN of the machine")), - (DEFINED, _("Preset in 'VLAN for machines accepted by RADIUS'")), + (DEFINED, _("Preset in \"VLAN for machines accepted by RADIUS\"")), ) - CHOICE_PROVISION = (("sftp", "sftp"), ("tftp", "tftp")) + CHOICE_PROVISION = (("sftp", "SFTP"), ("tftp", "TFTP")) switchs_web_management = models.BooleanField( default=False, - help_text=_("Web management, activated in case of automatic provision"), + help_text=_("Web management, activated in case of automatic provision."), ) switchs_web_management_ssl = models.BooleanField( default=False, help_text=_( "SSL web management, make sure that a certificate is" - " installed on the switch" + " installed on the switch." ), ) switchs_rest_management = models.BooleanField( default=False, - help_text=_("REST management, activated in case of automatic provision"), + help_text=_("REST management, activated in case of automatic provision."), ) switchs_ip_type = models.OneToOneField( "machines.IpType", on_delete=models.PROTECT, blank=True, null=True, - help_text=_("IP range for the management of switches"), + help_text=_("IP range for the management of switches."), ) switchs_provision = models.CharField( max_length=32, choices=CHOICE_PROVISION, default="tftp", - help_text=_("Provision of configuration mode for switches"), + help_text=_("Provision of configuration mode for switches."), ) sftp_login = models.CharField( - max_length=32, null=True, blank=True, help_text=_("SFTP login for switches") + max_length=32, null=True, blank=True, help_text=_("SFTP login for switches.") ) sftp_pass = AESEncryptedField( - max_length=63, null=True, blank=True, help_text=_("SFTP password") + max_length=63, null=True, blank=True, help_text=_("SFTP password.") ) @cached_property @@ -331,8 +331,8 @@ class OptionalTopologie(AclMixin, PreferencesModel): ) class Meta: - permissions = (("view_optionaltopologie", _("Can view the topology options")),) - verbose_name = _("topology options") + permissions = (("view_optionaltopologie", _("Can view the topology preferences")),) + verbose_name = _("topology preferences") @receiver(post_save, sender=OptionalTopologie) @@ -345,12 +345,12 @@ def optionaltopologie_post_save(**kwargs): class RadiusKey(AclMixin, models.Model): """Class of a radius key""" - radius_key = AESEncryptedField(max_length=255, help_text=_("RADIUS key")) + radius_key = AESEncryptedField(max_length=255, help_text=_("RADIUS key.")) comment = models.CharField( - max_length=255, null=True, blank=True, help_text=_("Comment for this key") + max_length=255, null=True, blank=True, help_text=_("Comment for this key.") ) default_switch = models.BooleanField( - default=False, help_text=_("Default key for switches") + default=False, help_text=_("Default key for switches.") ) class Meta: @@ -363,7 +363,7 @@ class RadiusKey(AclMixin, models.Model): Check default switch is unique """ if RadiusKey.objects.filter(default_switch=True).count() > 1: - raise ValidationError(_("Default radiuskey for switchs already exist")) + raise ValidationError(_("Default RADIUS key for switches already exists.")) def __str__(self): return _("RADIUS key ") + str(self.id) + " " + str(self.comment) @@ -372,17 +372,17 @@ class RadiusKey(AclMixin, models.Model): class SwitchManagementCred(AclMixin, models.Model): """Class of a management creds of a switch, for rest management""" - management_id = models.CharField(max_length=63, help_text=_("Switch login")) - management_pass = AESEncryptedField(max_length=63, help_text=_("Password")) + management_id = models.CharField(max_length=63, help_text=_("Switch login.")) + management_pass = AESEncryptedField(max_length=63, help_text=_("Password.")) default_switch = models.BooleanField( - default=True, unique=True, help_text=_("Default credentials for switches") + default=True, unique=True, help_text=_("Default credentials for switches.") ) class Meta: permissions = ( ( "view_switchmanagementcred", - _("Can view a switch management" " credentials object"), + _("Can view a switch management credentials object"), ), ) verbose_name = _("switch management credentials") @@ -400,13 +400,13 @@ class Reminder(AclMixin, models.Model): days = models.IntegerField( default=7, unique=True, - help_text=_("Delay between the email and the membership's end"), + help_text=_("Delay between the email and the membership's end."), ) message = models.TextField( default="", null=True, blank=True, - help_text=_("Message displayed specifically for this reminder"), + help_text=_("Message displayed specifically for this reminder."), ) class Meta: @@ -434,7 +434,7 @@ class GeneralOption(AclMixin, PreferencesModel): blank=True, help_text=_( "General message displayed on the French version of the" - " website (e.g. in case of maintenance)" + " website (e.g. in case of maintenance)." ), ) general_message_en = models.TextField( @@ -442,7 +442,7 @@ class GeneralOption(AclMixin, PreferencesModel): blank=True, help_text=_( "General message displayed on the English version of the" - " website (e.g. in case of maintenance)" + " website (e.g. in case of maintenance)." ), ) search_display_page = models.IntegerField(default=15) @@ -456,8 +456,8 @@ class GeneralOption(AclMixin, PreferencesModel): GTU = models.FileField(upload_to="", default="", null=True, blank=True) class Meta: - permissions = (("view_generaloption", _("Can view the general options")),) - verbose_name = _("general options") + permissions = (("view_generaloption", _("Can view the general preferences")),) + verbose_name = _("general preferences") @receiver(post_save, sender=GeneralOption) @@ -477,7 +477,7 @@ class Service(AclMixin, models.Model): image = models.ImageField(upload_to="logo", blank=True) class Meta: - permissions = (("view_service", _("Can view the service options")),) + permissions = (("view_service", _("Can view the service preferences")),) verbose_name = _("service") verbose_name_plural = _("services") @@ -489,7 +489,7 @@ class MailContact(AclMixin, models.Model): """Contact email adress with a commentary.""" address = models.EmailField( - default="contact@example.org", help_text=_("Contact email address") + default="contact@example.org", help_text=_("Contact email address.") ) commentary = models.CharField( @@ -516,17 +516,17 @@ class MailContact(AclMixin, models.Model): class Mandate(RevMixin, AclMixin, models.Model): class Meta: - verbose_name = _("Mandate") - verbose_name_plural = _("Mandates") - permissions = (("view_mandate", _("Can view a mandate")),) + verbose_name = _("mandate") + verbose_name_plural = _("mandates") + permissions = (("view_mandate", _("Can view a mandate object")),) president = models.ForeignKey( "users.User", on_delete=models.SET_NULL, null=True, blank=True, - verbose_name=_("President of the association"), - help_text=_("Displayed on subscription vouchers"), + verbose_name=_("president of the association"), + help_text=_("Displayed on subscription vouchers."), ) start_date = models.DateTimeField(verbose_name=_("start date")) end_date = models.DateTimeField(verbose_name=_("end date"), blank=True, null=True) @@ -542,7 +542,7 @@ class Mandate(RevMixin, AclMixin, models.Model): ) if not mandate: raise cls.DoesNotExist( - "No mandate have been created. Please go to the preferences page to create one." + _("No mandates have been created. Please go to the preferences page to create one.") ) return mandate @@ -571,8 +571,8 @@ class AssoOption(AclMixin, PreferencesModel): description = models.TextField(null=True, blank=True) class Meta: - permissions = (("view_assooption", _("Can view the organisation options")),) - verbose_name = _("organisation options") + permissions = (("view_assooption", _("Can view the organisation preferences")),) + verbose_name = _("organisation preferences") @receiver(post_save, sender=AssoOption) @@ -590,8 +590,8 @@ class HomeOption(AclMixin, PreferencesModel): twitter_account_name = models.CharField(max_length=32, null=True, blank=True) class Meta: - permissions = (("view_homeoption", _("Can view the homepage options")),) - verbose_name = _("homepage options") + permissions = (("view_homeoption", _("Can view the homepage preferences")),) + verbose_name = _("homepage preferences") @receiver(post_save, sender=HomeOption) @@ -605,17 +605,17 @@ class MailMessageOption(AclMixin, models.Model): """Reglages, mail de bienvenue et autre""" welcome_mail_fr = models.TextField( - default="", blank=True, help_text=_("Welcome email in French") + default="", blank=True, help_text=_("Welcome email in French.") ) welcome_mail_en = models.TextField( - default="", blank=True, help_text=_("Welcome email in English") + default="", blank=True, help_text=_("Welcome email in English.") ) class Meta: permissions = ( - ("view_mailmessageoption", _("Can view the email message" " options")), + ("view_mailmessageoption", _("Can view the email message preferences")), ) - verbose_name = _("email message options") + verbose_name = _("email message preferences") class RadiusAttribute(RevMixin, AclMixin, models.Model): @@ -625,12 +625,12 @@ class RadiusAttribute(RevMixin, AclMixin, models.Model): attribute = models.CharField( max_length=255, - verbose_name=_("Attribute"), - help_text=_("See http://freeradius.org/rfc/attributes.html"), + verbose_name=_("attribute"), + help_text=_("See https://freeradius.org/rfc/attributes.html."), ) - value = models.CharField(max_length=255, verbose_name=_("Value")) + value = models.CharField(max_length=255, verbose_name=_("value")) comment = models.TextField( - verbose_name=_("Comment"), + verbose_name=_("comment"), help_text=_("Use this field to document this attribute."), blank=True, default="", @@ -649,7 +649,7 @@ class RadiusOption(AclMixin, PreferencesModel): DEFINED = "DEFINED" CHOICE_RADIUS = ( (MACHINE, _("On the IP range's VLAN of the machine")), - (DEFINED, _("Preset in 'VLAN for machines accepted by RADIUS'")), + (DEFINED, _("Preset in \"VLAN for machines accepted by RADIUS\"")), ) REJECT = "REJECT" SET_VLAN = "SET_VLAN" @@ -664,7 +664,7 @@ class RadiusOption(AclMixin, PreferencesModel): max_length=32, choices=CHOICE_POLICY, default=REJECT, - verbose_name=_("Policy for unknown machines"), + verbose_name=_("policy for unknown machines"), ) unknown_machine_vlan = models.ForeignKey( "machines.Vlan", @@ -672,21 +672,21 @@ class RadiusOption(AclMixin, PreferencesModel): related_name="unknown_machine_vlan", blank=True, null=True, - verbose_name=_("Unknown machines VLAN"), - help_text=_("VLAN for unknown machines if not rejected"), + verbose_name=_("unknown machines VLAN"), + help_text=_("VLAN for unknown machines if not rejected."), ) unknown_machine_attributes = models.ManyToManyField( RadiusAttribute, related_name="unknown_machine_attribute", blank=True, - verbose_name=_("Unknown machines attributes."), + verbose_name=_("unknown machines attributes"), help_text=_("Answer attributes for unknown machines."), ) unknown_port = models.CharField( max_length=32, choices=CHOICE_POLICY, default=REJECT, - verbose_name=_("Policy for unknown ports"), + verbose_name=_("policy for unknown ports"), ) unknown_port_vlan = models.ForeignKey( "machines.Vlan", @@ -694,14 +694,14 @@ class RadiusOption(AclMixin, PreferencesModel): related_name="unknown_port_vlan", blank=True, null=True, - verbose_name=_("Unknown ports VLAN"), - help_text=_("VLAN for unknown ports if not rejected"), + verbose_name=_("unknown ports VLAN"), + help_text=_("VLAN for unknown ports if not rejected."), ) unknown_port_attributes = models.ManyToManyField( RadiusAttribute, related_name="unknown_port_attribute", blank=True, - verbose_name=_("Unknown ports attributes."), + verbose_name=_("unknown ports attributes"), help_text=_("Answer attributes for unknown ports."), ) unknown_room = models.CharField( @@ -719,21 +719,21 @@ class RadiusOption(AclMixin, PreferencesModel): on_delete=models.PROTECT, blank=True, null=True, - verbose_name=_("Unknown rooms VLAN"), - help_text=_("VLAN for unknown rooms if not rejected"), + verbose_name=_("unknown rooms VLAN"), + help_text=_("VLAN for unknown rooms if not rejected."), ) unknown_room_attributes = models.ManyToManyField( RadiusAttribute, related_name="unknown_room_attribute", blank=True, - verbose_name=_("Unknown rooms attributes."), + verbose_name=_("unknown rooms attributes"), help_text=_("Answer attributes for unknown rooms."), ) non_member = models.CharField( max_length=32, choices=CHOICE_POLICY, default=REJECT, - verbose_name=_("Policy for non members"), + verbose_name=_("policy for non members"), ) non_member_vlan = models.ForeignKey( "machines.Vlan", @@ -741,21 +741,21 @@ class RadiusOption(AclMixin, PreferencesModel): on_delete=models.PROTECT, blank=True, null=True, - verbose_name=_("Non members VLAN"), - help_text=_("VLAN for non members if not rejected"), + verbose_name=_("non members VLAN"), + help_text=_("VLAN for non members if not rejected."), ) non_member_attributes = models.ManyToManyField( RadiusAttribute, related_name="non_member_attribute", blank=True, - verbose_name=_("Non member attributes."), + verbose_name=_("non members attributes"), help_text=_("Answer attributes for non members."), ) banned = models.CharField( max_length=32, choices=CHOICE_POLICY, default=REJECT, - verbose_name=_("Policy for banned users"), + verbose_name=_("policy for banned users"), ) banned_vlan = models.ForeignKey( "machines.Vlan", @@ -763,14 +763,14 @@ class RadiusOption(AclMixin, PreferencesModel): on_delete=models.PROTECT, blank=True, null=True, - verbose_name=_("Banned users VLAN"), - help_text=_("VLAN for banned users if not rejected"), + verbose_name=_("banned users VLAN"), + help_text=_("VLAN for banned users if not rejected."), ) banned_attributes = models.ManyToManyField( RadiusAttribute, related_name="banned_attribute", blank=True, - verbose_name=_("Banned attributes."), + verbose_name=_("banned users attributes"), help_text=_("Answer attributes for banned users."), ) vlan_decision_ok = models.OneToOneField( @@ -784,7 +784,7 @@ class RadiusOption(AclMixin, PreferencesModel): RadiusAttribute, related_name="ok_attribute", blank=True, - verbose_name=_("Accepted users attributes."), + verbose_name=_("accepted users attributes"), help_text=_("Answer attributes for accepted users."), ) @@ -812,26 +812,27 @@ def default_voucher(): class CotisationsOption(AclMixin, PreferencesModel): class Meta: - verbose_name = _("cotisations options") + verbose_name = _("subscription preferences") invoice_template = models.OneToOneField( "preferences.DocumentTemplate", - verbose_name=_("Template for invoices"), + verbose_name=_("template for invoices"), related_name="invoice_template", on_delete=models.PROTECT, default=default_invoice, ) voucher_template = models.OneToOneField( "preferences.DocumentTemplate", - verbose_name=_("Template for subscription voucher"), + verbose_name=_("template for subscription vouchers"), related_name="voucher_template", on_delete=models.PROTECT, default=default_voucher, ) send_voucher_mail = models.BooleanField( - verbose_name=_("Send voucher by email when the invoice is controlled."), + verbose_name=_("send voucher by email when the invoice is controlled"), help_text=_( - "Be carefull, if no mandate is defined on the preferences page, errors will be triggered when generating vouchers." + "Be careful, if no mandate is defined on the preferences page," + " errors will be triggered when generating vouchers." ), default=False, ) diff --git a/preferences/templates/preferences/aff_mandate.html b/preferences/templates/preferences/aff_mandate.html index 38017985..10393200 100644 --- a/preferences/templates/preferences/aff_mandate.html +++ b/preferences/templates/preferences/aff_mandate.html @@ -35,7 +35,7 @@ with this program; if not, write to the Free Software Foundation, Inc., {% for mandate in mandate_list %} {{mandate.start_date|date:"d/m/Y"}} - {% if mandate.end_date %}{{mandate.end_date|date:"d/m/Y"}}{% else %}{% trans "In progress." %}{% endif %} + {% if mandate.end_date %}{{mandate.end_date|date:"d/m/Y"}}{% else %}{% trans "In progress" %}{% endif %} {{mandate.president.name}} {{mandate.president.surname}} {% can_edit mandate%} diff --git a/preferences/templates/preferences/aff_radiuskey.html b/preferences/templates/preferences/aff_radiuskey.html index b12288fb..f3b6fc9f 100644 --- a/preferences/templates/preferences/aff_radiuskey.html +++ b/preferences/templates/preferences/aff_radiuskey.html @@ -31,7 +31,7 @@ with this program; if not, write to the Free Software Foundation, Inc., {% trans "RADIUS key ID" %} {% trans "Comment" %} {% trans "Default RADIUS key for switches" %} - {% trans "RADIUS key used by the swithes" %} + {% trans "Switches using the RADIUS key" %} diff --git a/preferences/templates/preferences/aff_radiusoptions.html b/preferences/templates/preferences/aff_radiusoptions.html index 0e84b44c..fad2dbb4 100644 --- a/preferences/templates/preferences/aff_radiusoptions.html +++ b/preferences/templates/preferences/aff_radiusoptions.html @@ -27,7 +27,7 @@ with this program; if not, write to the Free Software Foundation, Inc., {% trans "General policy for VLAN setting" %} {{ radiusoptions.radius_general_policy }} - {% trans "This setting defines the VLAN policy after acceptance by RADIUS: either on the IP range's VLAN of the machine, or a VLAN preset in 'VLAN for machines accepted by RADIUS'" %} + {% blocktrans %}This setting defines the VLAN policy after acceptance by RADIUS: either on the IP range's VLAN of the machine, or a VLAN preset in "VLAN for machines accepted by RADIUS".{% endblocktrans %} {% trans "VLAN for machines accepted by RADIUS" %} diff --git a/preferences/templates/preferences/aff_service.html b/preferences/templates/preferences/aff_service.html index ff2d80af..fa7df1a3 100644 --- a/preferences/templates/preferences/aff_service.html +++ b/preferences/templates/preferences/aff_service.html @@ -42,7 +42,7 @@ with this program; if not, write to the Free Software Foundation, Inc., {{ service.description }} {{ service.image }} - {% can_edit service%} + {% can_edit service %} {% include 'buttons/edit.html' with href='preferences:edit-service' id=service.id %} {% acl_end %} {% can_delete service %} diff --git a/preferences/templates/preferences/aff_switchmanagementcred.html b/preferences/templates/preferences/aff_switchmanagementcred.html index 8f2f7ff6..88c680b7 100644 --- a/preferences/templates/preferences/aff_switchmanagementcred.html +++ b/preferences/templates/preferences/aff_switchmanagementcred.html @@ -30,7 +30,7 @@ with this program; if not, write to the Free Software Foundation, Inc., {% trans "Switch login" %} {% trans "Default switch management credentials" %} - {% trans "Management credentials used by the switches" %} + {% trans "Switches using the management credentials" %} diff --git a/preferences/templates/preferences/display_preferences.html b/preferences/templates/preferences/display_preferences.html index aae99d74..8e00962e 100644 --- a/preferences/templates/preferences/display_preferences.html +++ b/preferences/templates/preferences/display_preferences.html @@ -125,7 +125,7 @@ with this program; if not, write to the Free Software Foundation, Inc., {% trans "All users are active by default" %} {{ useroptions.all_users_active|tick }} - {% trans "Allow archived users to log-in" %} + {% trans "Allow archived users to log in" %} {{ useroptions.allow_archived_connexion|tick }} @@ -156,7 +156,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
@@ -177,7 +177,7 @@ with this program; if not, write to the Free Software Foundation, Inc., {% trans "Maximum number of DNS aliases allowed for a standard user" %} {{ machineoptions.max_lambdauser_aliases }} - {% trans "Default Time To Live (TTL) for CNAME, A and AAA records." %} + {% trans "Default Time To Live (TTL) for CNAME, A and AAAA records." %} {{ machineoptions.default_dns_ttl }} @@ -200,7 +200,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,

{% trans "RADIUS keys" %}

{% can_create RadiusKey%} - {% trans " Add a RADIUS key" %} + {% trans "Add a RADIUS key" %} {% acl_end %} {% include 'preferences/aff_radiuskey.html' with radiuskey_list=radiuskey_list %} @@ -262,7 +262,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
{% trans "Switch management credentials" %}
{% can_create SwitchManagementCred%} - {% trans " Add switch management credentials" %} + {% trans "Add switch management credentials" %} {% acl_end %}

@@ -282,8 +282,8 @@ with this program; if not, write to the Free Software Foundation, Inc., {% trans "Edit" %} {% include 'preferences/aff_radiusoptions.html' %} -
{% trans "Available RADIUS attributes"%}
- {% trans " Add an attribute" %} +
{% trans "Current RADIUS attributes"%}
+ {% trans "Add an attribute" %} {% include 'preferences/aff_radiusattributes.html' %}
@@ -346,7 +346,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
{% can_create DocumentTemplate %} - {% trans "Add a document template" %} + {% trans "Add a document template" %} {% acl_end %} @@ -359,7 +359,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
@@ -414,13 +414,13 @@ with this program; if not, write to the Free Software Foundation, Inc.,
{% can_create preferences.Reminder%} - {% trans " Add a reminder" %} + {% trans "Add a reminder" %}

{% acl_end %} {% include 'preferences/aff_reminder.html' with reminder_list=reminder_list %} @@ -437,7 +437,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
{% can_create preferences.Service%} - {% trans " Add a service" %} + {% trans "Add a service" %}

{% acl_end %} {% include 'preferences/aff_service.html' with service_list=service_list %} @@ -454,9 +454,9 @@ with this program; if not, write to the Free Software Foundation, Inc.,
{% can_create preferences.MailContact %} - {% trans " Add an address" %} + {% trans "Add an address" %} {% acl_end %} - {% trans " Delete one or several addresses" %} + {% trans "Delete one or several addresses" %}

{% include 'preferences/aff_mailcontact.html' with mailcontact_list=mailcontact_list %}
@@ -465,7 +465,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,

- {% trans "Social networks" %} + {% trans "Social networks" %}

diff --git a/preferences/views.py b/preferences/views.py index 91ced9b3..a7df9cef 100644 --- a/preferences/views.py +++ b/preferences/views.py @@ -191,7 +191,7 @@ def add_service(request): messages.success(request, _("The service was added.")) return redirect(reverse("preferences:display-options")) return form( - {"preferenceform": service, "action_name": _("Add a service")}, + {"preferenceform": service, "action_name": _("Add")}, "preferences/preferences.html", request, ) @@ -224,7 +224,7 @@ def del_service(request, service_instance, **_kwargs): messages.success(request, _("The service was deleted.")) return redirect(reverse("preferences:display-options")) return form( - {"objet": service_instance, "objet_name": "service"}, + {"objet": service_instance, "objet_name": _("service")}, "preferences/delete.html", request, ) @@ -240,7 +240,7 @@ def add_reminder(request): messages.success(request, _("The reminder was added.")) return redirect(reverse("preferences:display-options")) return form( - {"preferenceform": reminder, "action_name": _("Add a reminder")}, + {"preferenceform": reminder, "action_name": _("Add")}, "preferences/preferences.html", request, ) @@ -273,7 +273,7 @@ def del_reminder(request, reminder_instance, **_kwargs): messages.success(request, _("The reminder was deleted.")) return redirect(reverse("preferences:display-options")) return form( - {"objet": reminder_instance, "objet_name": "reminder"}, + {"objet": reminder_instance, "objet_name": _("reminder")}, "preferences/delete.html", request, ) @@ -289,7 +289,7 @@ def add_radiuskey(request): messages.success(request, _("The RADIUS key was added.")) return redirect(reverse("preferences:display-options")) return form( - {"preferenceform": radiuskey, "action_name": _("Add a RADIUS key")}, + {"preferenceform": radiuskey, "action_name": _("Add")}, "preferences/preferences.html", request, ) @@ -328,7 +328,7 @@ def del_radiuskey(request, radiuskey_instance, **_kwargs): ) return redirect(reverse("preferences:display-options")) return form( - {"objet": radiuskey_instance, "objet_name": "radiuskey"}, + {"objet": radiuskey_instance, "objet_name": _("RADIUS key")}, "preferences/delete.html", request, ) @@ -346,7 +346,7 @@ def add_switchmanagementcred(request): return form( { "preferenceform": switchmanagementcred, - "action_name": _("Add switch management credentials"), + "action_name": _("Add"), }, "preferences/preferences.html", request, @@ -391,7 +391,7 @@ def del_switchmanagementcred(request, switchmanagementcred_instance, **_kwargs): ) return redirect(reverse("preferences:display-options")) return form( - {"objet": switchmanagementcred_instance, "objet_name": "switchmanagementcred"}, + {"objet": switchmanagementcred_instance, "objet_name": _("switch management credentials")}, "preferences/delete.html", request, ) @@ -409,7 +409,7 @@ def add_mailcontact(request): return form( { "preferenceform": mailcontact, - "action_name": _("Add a contact email address"), + "action_name": _("Add"), }, "preferences/preferences.html", request, @@ -524,8 +524,8 @@ def del_document_template(request, instances): messages.error( request, _( - "The document template %(document_template)s can't be deleted \ - because it is currently being used." + "The document template %(document_template)s can't be" + " deleted because it is currently being used." ) % {"document_template": document_template}, ) @@ -551,7 +551,7 @@ def add_radiusattribute(request): messages.success(request, _("The attribute was added.")) return redirect(reverse("preferences:display-options")) return form( - {"preferenceform": attribute, "action_name": _("Add a RADIUS attribute")}, + {"preferenceform": attribute, "action_name": _("Add")}, "preferences/preferences.html", request, ) @@ -584,7 +584,7 @@ def del_radiusattribute(request, radiusattribute_instance, **_kwargs): messages.success(request, _("The attribute was deleted.")) return redirect(reverse("preferences:display-options")) return form( - {"objet": radiusattribute_instance, "objet_name": "attribute"}, + {"objet": radiusattribute_instance, "objet_name": _("attribute")}, "preferences/delete.html", request, ) @@ -600,7 +600,7 @@ def add_mandate(request): messages.success(request, _("The mandate was added.")) return redirect(reverse("preferences:display-options")) return form( - {"preferenceform": mandate, "action_name": _("Add a mandate")}, + {"preferenceform": mandate, "action_name": _("Add")}, "preferences/preferences.html", request, ) @@ -631,7 +631,7 @@ def del_mandate(request, mandate_instance, **_kwargs): messages.success(request, _("The mandate was deleted.")) return redirect(reverse("preferences:display-options")) return form( - {"objet": mandate_instance, "objet_name": "attribute"}, + {"objet": mandate_instance, "objet_name": _("mandate")}, "preferences/delete.html", request, )