From 3743a46bc522b7789b462baa2c6f66d7603fed47 Mon Sep 17 00:00:00 2001 From: Laouen Fernet Date: Sat, 16 Nov 2019 14:01:07 +0000 Subject: [PATCH 01/26] Mark strings for translation in api --- api/acl.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/api/acl.py b/api/acl.py index c2db9862..490b88c7 100644 --- a/api/acl.py +++ b/api/acl.py @@ -74,6 +74,6 @@ def can_view(user): can = user.has_perm(permission) return ( can, - None if can else _("You don't have the right to see this" " application."), + None if can else _("You don't have the right to view this application."), (permission,), ) From 2454de2032d60493e6da4dc1ea31dc68436b5b80 Mon Sep 17 00:00:00 2001 From: Laouen Fernet Date: Sat, 16 Nov 2019 14:02:32 +0000 Subject: [PATCH 02/26] Mark strings for translation in cotisations --- cotisations/forms.py | 10 +-- cotisations/models.py | 64 +++++++++---------- cotisations/payment_methods/balance/models.py | 11 ++-- cotisations/payment_methods/cheque/models.py | 2 +- cotisations/payment_methods/comnpay/models.py | 7 +- cotisations/payment_methods/forms.py | 8 +-- cotisations/payment_methods/free/models.py | 2 +- .../payment_methods/note_kfet/forms.py | 2 +- .../templates/cotisations/aff_paiement.html | 2 +- .../templates/cotisations/control.html | 12 ++-- cotisations/templates/cotisations/delete.html | 2 +- .../templates/cotisations/email_invoice | 14 ++-- .../cotisations/email_subscription_accepted | 7 +- .../templates/cotisations/index_article.html | 6 +- .../templates/cotisations/index_banque.html | 2 +- .../templates/cotisations/index_paiement.html | 2 +- .../templates/cotisations/sidebar.html | 2 +- cotisations/tex.py | 1 - cotisations/views.py | 52 +++++++++++---- 19 files changed, 117 insertions(+), 91 deletions(-) diff --git a/cotisations/forms.py b/cotisations/forms.py index 6f4a9a45..76db358c 100644 --- a/cotisations/forms.py +++ b/cotisations/forms.py @@ -116,7 +116,7 @@ class DiscountForm(Form): """ is_relative = forms.BooleanField( - label=_("Discount is on percentage."), required=False + label=_("Discount is in percentage."), required=False ) discount = forms.DecimalField( label=_("Discount"), @@ -136,7 +136,7 @@ class DiscountForm(Form): else: amount = discount if amount: - name = _("{}% discount") if is_relative else _("{}€ discount") + name = _("{}% discount") if is_relative else _("{} € discount") name = name.format(discount) Vente.objects.create(facture=invoice, name=name, prix=-amount, number=1) @@ -184,7 +184,7 @@ class DelArticleForm(FormRevMixin, Form): articles = forms.ModelMultipleChoiceField( queryset=Article.objects.none(), - label=_("Available articles"), + label=_("Current articles"), widget=forms.CheckboxSelectMultiple, ) @@ -226,7 +226,7 @@ class DelPaiementForm(FormRevMixin, Form): # TODO : change paiement to payment paiements = forms.ModelMultipleChoiceField( queryset=Paiement.objects.none(), - label=_("Available payment methods"), + label=_("Current payment methods"), widget=forms.CheckboxSelectMultiple, ) @@ -266,7 +266,7 @@ class DelBanqueForm(FormRevMixin, Form): # TODO : change banque to bank banques = forms.ModelMultipleChoiceField( queryset=Banque.objects.none(), - label=_("Available banks"), + label=_("Current banks"), widget=forms.CheckboxSelectMultiple, ) diff --git a/cotisations/models.py b/cotisations/models.py index 5cab9212..c2d23171 100644 --- a/cotisations/models.py +++ b/cotisations/models.py @@ -56,7 +56,7 @@ from cotisations.validators import check_no_balance class BaseInvoice(RevMixin, AclMixin, FieldPermissionModelMixin, models.Model): - date = models.DateTimeField(auto_now_add=True, verbose_name=_("Date")) + date = models.DateTimeField(auto_now_add=True, verbose_name=_("date")) # TODO : change prix to price def prix(self): @@ -138,7 +138,7 @@ class Facture(BaseInvoice): abstract = False permissions = ( # TODO : change facture to invoice - ("change_facture_control", _('Can edit the "controlled" state')), + ("change_facture_control", _("Can edit the \"controlled\" state")), ("view_facture", _("Can view an invoice object")), ("change_all_facture", _("Can edit all the previous invoices")), ) @@ -174,8 +174,8 @@ class Facture(BaseInvoice): return ( False, _( - "You don't have the right to edit an invoice " - "already controlled or invalidated." + "You don't have the right to edit an invoice" + " already controlled or invalidated." ), ("cotisations.change_all_facture",), ) @@ -206,8 +206,8 @@ class Facture(BaseInvoice): return ( False, _( - "You don't have the right to delete an invoice " - "already controlled or invalidated." + "You don't have the right to delete an invoice" + " already controlled or invalidated." ), ("cotisations.change_all_facture",), ) @@ -220,8 +220,8 @@ class Facture(BaseInvoice): return ( False, _( - "You don't have the right to view someone else's " - "invoices history." + "You don't have the right to view someone else's" + " invoices history." ), ("cotisations.view_facture",), ) @@ -243,7 +243,7 @@ class Facture(BaseInvoice): can = user_request.has_perm("cotisations.change_facture_control") return ( can, - _('You don\'t have the right to edit the "controlled" state.') + _("You don't have the right to edit the \"controlled\" state.") if not can else None, ("cotisations.change_facture_control",), @@ -262,13 +262,13 @@ class Facture(BaseInvoice): if len(Paiement.find_allowed_payments(user_request)) <= 0: return ( False, - _("There are no payment method which you can use."), + _("There are no payment methods that you can use."), ("cotisations.add_facture",), ) if len(Article.find_allowed_articles(user_request, user_request)) <= 0: return ( False, - _("There are no article that you can buy."), + _("There are no articles that you can buy."), ("cotisations.add_facture",), ) return True, None, None @@ -346,11 +346,11 @@ class CustomInvoice(BaseInvoice): class Meta: permissions = (("view_custominvoice", _("Can view a custom invoice object")),) - recipient = models.CharField(max_length=255, verbose_name=_("Recipient")) - payment = models.CharField(max_length=255, verbose_name=_("Payment type")) - address = models.CharField(max_length=255, verbose_name=_("Address")) - paid = models.BooleanField(verbose_name=_("Paid"), default=False) - remark = models.TextField(verbose_name=_("Remark"), blank=True, null=True) + recipient = models.CharField(max_length=255, verbose_name=_("recipient")) + payment = models.CharField(max_length=255, verbose_name=_("payment type")) + address = models.CharField(max_length=255, verbose_name=_("address")) + paid = models.BooleanField(verbose_name=_("paid"), default=False) + remark = models.TextField(verbose_name=_("remark"), blank=True, null=True) class CostEstimate(CustomInvoice): @@ -358,7 +358,7 @@ class CostEstimate(CustomInvoice): permissions = (("view_costestimate", _("Can view a cost estimate object")),) validity = models.DurationField( - verbose_name=_("Period of validity"), help_text="DD HH:MM:SS" + verbose_name=_("period of validity"), help_text="DD HH:MM:SS" ) final_invoice = models.ForeignKey( CustomInvoice, @@ -547,7 +547,7 @@ class Vente(RevMixin, AclMixin, models.Model): if not user_request.has_perm("cotisations.change_vente"): return ( False, - _("You don't have the right to edit the purchases."), + _("You don't have the right to edit a purchase."), ("cotisations.change_vente",), ) elif not (user_request.has_perm("cotisations.change_all_facture") or user_can): @@ -562,8 +562,8 @@ class Vente(RevMixin, AclMixin, models.Model): return ( False, _( - "You don't have the right to edit a purchase " - "already controlled or invalidated." + "You don't have the right to edit a purchase" + " already controlled or invalidated." ), ("cotisations.change_all_vente",), ) @@ -590,8 +590,8 @@ class Vente(RevMixin, AclMixin, models.Model): return ( False, _( - "You don't have the right to delete a purchase " - "already controlled or invalidated." + "You don't have the right to delete a purchase" + " already controlled or invalidated." ), None, ) @@ -606,8 +606,8 @@ class Vente(RevMixin, AclMixin, models.Model): return ( False, _( - "You don't have the right to view someone " - "else's purchase history." + "You don't have the right to view someone" + " else's purchase history." ), ("cotisations.view_vente",), ) @@ -731,7 +731,7 @@ class Article(RevMixin, AclMixin, models.Model): def clean(self): if self.name.lower() == "solde": - raise ValidationError(_("Balance is a reserved article name.")) + raise ValidationError(_("Solde is a reserved article name.")) if self.type_cotisation and not (self.duration or self.duration_days): raise ValidationError(_("Duration must be specified for a subscription.")) @@ -921,7 +921,7 @@ class Paiement(RevMixin, AclMixin, models.Model): p = find_payment_method(self) if p is not None: return p._meta.verbose_name - return _("No custom payment method.") + return _("No custom payment methods.") class Cotisation(RevMixin, AclMixin, models.Model): @@ -976,8 +976,8 @@ class Cotisation(RevMixin, AclMixin, models.Model): return ( False, _( - "You don't have the right to edit a subscription " - "already controlled or invalidated." + "You don't have the right to edit a subscription" + " already controlled or invalidated." ), ("cotisations.change_all_cotisation",), ) @@ -995,8 +995,8 @@ class Cotisation(RevMixin, AclMixin, models.Model): return ( False, _( - "You don't have the right to delete a subscription " - "already controlled or invalidated." + "You don't have the right to delete a subscription" + " already controlled or invalidated." ), None, ) @@ -1011,8 +1011,8 @@ class Cotisation(RevMixin, AclMixin, models.Model): return ( False, _( - "You don't have the right to view someone else's " - "subscription history." + "You don't have the right to view someone else's" + " subscription history." ), ("cotisations.view_cotisation",), ) diff --git a/cotisations/payment_methods/balance/models.py b/cotisations/payment_methods/balance/models.py index a252affb..afa43c48 100644 --- a/cotisations/payment_methods/balance/models.py +++ b/cotisations/payment_methods/balance/models.py @@ -44,18 +44,17 @@ class BalancePayment(PaymentMethodMixin, models.Model): editable=False, ) minimum_balance = models.DecimalField( - verbose_name=_("Minimum balance"), + verbose_name=_("minimum balance"), help_text=_( - "The minimal amount of money allowed for the balance" - " at the end of a payment. You can specify negative " - "amount." + "The minimal amount of money allowed for the balance at the end" + " of a payment. You can specify a negative amount." ), max_digits=5, decimal_places=2, default=0, ) maximum_balance = models.DecimalField( - verbose_name=_("Maximum balance"), + verbose_name=_("maximum balance"), help_text=_("The maximal amount of money allowed for the balance."), max_digits=5, decimal_places=2, @@ -64,7 +63,7 @@ class BalancePayment(PaymentMethodMixin, models.Model): null=True, ) credit_balance_allowed = models.BooleanField( - verbose_name=_("Allow user to credit their balance"), default=False + verbose_name=_("allow user to credit their balance"), default=False ) def end_payment(self, invoice, request): diff --git a/cotisations/payment_methods/cheque/models.py b/cotisations/payment_methods/cheque/models.py index 53acef6a..62479f22 100644 --- a/cotisations/payment_methods/cheque/models.py +++ b/cotisations/payment_methods/cheque/models.py @@ -33,7 +33,7 @@ class ChequePayment(PaymentMethodMixin, models.Model): """ class Meta: - verbose_name = _("Cheque") + verbose_name = _("cheque") payment = models.OneToOneField( Paiement, diff --git a/cotisations/payment_methods/comnpay/models.py b/cotisations/payment_methods/comnpay/models.py index ff35650c..2c46f685 100644 --- a/cotisations/payment_methods/comnpay/models.py +++ b/cotisations/payment_methods/comnpay/models.py @@ -51,9 +51,10 @@ class ComnpayPayment(PaymentMethodMixin, models.Model): max_length=255, null=True, blank=True, verbose_name=_("ComNpay secret key") ) minimum_payment = models.DecimalField( - verbose_name=_("Minimum payment"), + verbose_name=_("minimum payment"), help_text=_( - "The minimal amount of money you have to use when paying" " with ComNpay" + "The minimal amount of money you have to use when paying with" + " ComNpay." ), max_digits=5, decimal_places=2, @@ -62,7 +63,7 @@ class ComnpayPayment(PaymentMethodMixin, models.Model): production = models.BooleanField( default=True, verbose_name=_( - "Production mode enabled (production URL, instead of homologation)" + "production mode enabled (production URL, instead of homologation)" ), ) diff --git a/cotisations/payment_methods/forms.py b/cotisations/payment_methods/forms.py index fdcd50b8..a6bac3ed 100644 --- a/cotisations/payment_methods/forms.py +++ b/cotisations/payment_methods/forms.py @@ -58,9 +58,9 @@ class PaymentMethodForm(forms.Form): payment_method = forms.ChoiceField( label=_("Special payment method"), help_text=_( - "Warning: you will not be able to change the payment " - "method later. But you will be allowed to edit the other " - "options." + "Warning: you will not be able to change the payment" + " method later. But you will be allowed to edit the other" + " options." ), required=False, ) @@ -71,7 +71,7 @@ class PaymentMethodForm(forms.Form): self.fields["payment_method"].choices = [ (i, p.NAME) for (i, p) in enumerate(PAYMENT_METHODS) ] - self.fields["payment_method"].choices.insert(0, ("", _("no"))) + self.fields["payment_method"].choices.insert(0, ("", _("No"))) self.fields["payment_method"].widget.attrs = {"id": "paymentMethodSelect"} self.templates = [ forms.modelform_factory(p.PaymentMethod, fields="__all__")(prefix=prefix) diff --git a/cotisations/payment_methods/free/models.py b/cotisations/payment_methods/free/models.py index b64744fe..39a3aa80 100644 --- a/cotisations/payment_methods/free/models.py +++ b/cotisations/payment_methods/free/models.py @@ -51,4 +51,4 @@ class FreePayment(PaymentMethodMixin, models.Model): """Checks that the price meets the requirement to be paid with user balance. """ - return (price == 0, _("You cannot validate this invoice for free.")) + return (price == 0, _("You can't pay this invoice for free.")) diff --git a/cotisations/payment_methods/note_kfet/forms.py b/cotisations/payment_methods/note_kfet/forms.py index 098315b7..7d82b93f 100644 --- a/cotisations/payment_methods/note_kfet/forms.py +++ b/cotisations/payment_methods/note_kfet/forms.py @@ -30,5 +30,5 @@ class NoteCredentialForm(forms.Form): object. """ - login = forms.CharField(label=_("pseudo note")) + login = forms.CharField(label=_("Username")) password = forms.CharField(label=_("Password"), widget=forms.PasswordInput) diff --git a/cotisations/templates/cotisations/aff_paiement.html b/cotisations/templates/cotisations/aff_paiement.html index edd485f1..6043da67 100644 --- a/cotisations/templates/cotisations/aff_paiement.html +++ b/cotisations/templates/cotisations/aff_paiement.html @@ -31,7 +31,7 @@ with this program; if not, write to the Free Software Foundation, Inc., {% trans "Payment type" %} - {% trans "Is available for everyone" %} + {% trans "Available for everyone" %} {% trans "Custom payment method" %} diff --git a/cotisations/templates/cotisations/control.html b/cotisations/templates/cotisations/control.html index b199ba2d..497de6f4 100644 --- a/cotisations/templates/cotisations/control.html +++ b/cotisations/templates/cotisations/control.html @@ -45,12 +45,12 @@ with this program; if not, write to the Free Software Foundation, Inc., {% trans "Profile" %} - {% trans "Last name" as tr_last_name %} - {% include 'buttons/sort.html' with prefix='control' col='name' text=tr_last_name %} + {% trans "First name" as tr_first_name %} + {% include 'buttons/sort.html' with prefix='control' col='name' text=tr_first_name %} - {% trans "First name" as tr_first_name %} - {% include 'buttons/sort.html' with prefix='control' col='surname' text=tr_first_name %} + {% trans "Surname" as tr_surname %} + {% include 'buttons/sort.html' with prefix='control' col='surname' text=tr_surname %} {% trans "Invoice ID" as tr_invoice_id %} @@ -104,8 +104,8 @@ with this program; if not, write to the Free Software Foundation, Inc., {% endfor %} - {% trans "Edit" as tr_edit %} - {% bootstrap_button tr_edit button_type='submit' icon='ok' button_class='btn-success' %} + {% trans "Confirm" as tr_confirm %} + {% bootstrap_button tr_confirm button_type='submit' icon='ok' button_class='btn-success' %} {% endblock %} diff --git a/cotisations/templates/cotisations/delete.html b/cotisations/templates/cotisations/delete.html index 483dd218..e6f1b362 100644 --- a/cotisations/templates/cotisations/delete.html +++ b/cotisations/templates/cotisations/delete.html @@ -33,7 +33,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
{% csrf_token %}

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

{% trans "Confirm" as tr_confirm %} {% bootstrap_button tr_confirm button_type='submit' icon='trash' button_class='btn-danger' %} diff --git a/cotisations/templates/cotisations/email_invoice b/cotisations/templates/cotisations/email_invoice index 8d6b2cc2..01f80225 100644 --- a/cotisations/templates/cotisations/email_invoice +++ b/cotisations/templates/cotisations/email_invoice @@ -6,17 +6,17 @@ Nous vous remercions pour votre achat auprès de {{asso_name}} et nous vous en j En cas de question, n’hésitez pas à nous contacter par mail à {{contact_mail}}. -Cordialement, -L’équipe de {{asso_name}} +Respectueusement, +L’équipe de {{asso_name}}. === English version === -Dear {{name}}, +Hello {{name}}, -Thank you for your purchase. Here is your invoice. +Thank you for your purchase at {{asso_name}}. Here is your invoice. -Should you need extra information, you can email us at {{contact_mail}}. +Should you need extra information, do not hesitate to email us at {{contact_mail}}. -Best regards, - {{ asso_name }}'s team +Regards, +The {{ asso_name }} team. diff --git a/cotisations/templates/cotisations/email_subscription_accepted b/cotisations/templates/cotisations/email_subscription_accepted index bd1c7628..cb0eb760 100644 --- a/cotisations/templates/cotisations/email_subscription_accepted +++ b/cotisations/templates/cotisations/email_subscription_accepted @@ -6,17 +6,18 @@ Vous trouverez en pièce jointe un reçu. Pour nous faire part de toute remarque, suggestion ou problème vous pouvez nous envoyer un mail à {{asso_email}}. -À bientôt, +Respectueusement, L'équipe de {{asso_name}}. --- +Hello {{name}}! + Your subscription to {{asso_name}} has just been accepted. You are now a full member of {{asso_name}} until {{ date_end|date:"d/m/Y" }}. You will find with this email a subscription voucher. -For any information, suggestion or problem, you can contact us via email at -{{asso_email}}. +To express any comment, suggestion or problem, you can send us an email to {{asso_email}}. Regards, The {{asso_name}} team. diff --git a/cotisations/templates/cotisations/index_article.html b/cotisations/templates/cotisations/index_article.html index 8adc7639..1a4c3c8d 100644 --- a/cotisations/templates/cotisations/index_article.html +++ b/cotisations/templates/cotisations/index_article.html @@ -30,14 +30,14 @@ with this program; if not, write to the Free Software Foundation, Inc., {% block title %}{% trans "Articles" %}{% endblock %} {% block content %} -

{% trans "List of article types" %}

+

{% trans "List of articles" %}

{% can_create Article %} - {% trans "Add an article type" %} + {% trans "Add an article" %} {% acl_end %} - {% trans "Delete one or several article types" %} + {% trans "Delete one or several articles" %} {% include 'cotisations/aff_article.html' with article_list=article_list %} {% endblock %} diff --git a/cotisations/templates/cotisations/index_banque.html b/cotisations/templates/cotisations/index_banque.html index a497198f..c653acfd 100644 --- a/cotisations/templates/cotisations/index_banque.html +++ b/cotisations/templates/cotisations/index_banque.html @@ -33,7 +33,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,

{% trans "List of banks" %}

{% can_create Banque %} - {% trans "Add a bank" %} + {% trans "Add a bank" %} {% acl_end %} diff --git a/cotisations/templates/cotisations/index_paiement.html b/cotisations/templates/cotisations/index_paiement.html index b76dec65..1411add0 100644 --- a/cotisations/templates/cotisations/index_paiement.html +++ b/cotisations/templates/cotisations/index_paiement.html @@ -33,7 +33,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,

{% trans "List of payment methods" %}

{% can_create Paiement %}
- {% trans "Add a payment method" %} + {% trans "Add a payment method" %} {% acl_end %} diff --git a/cotisations/templates/cotisations/sidebar.html b/cotisations/templates/cotisations/sidebar.html index 96a674f9..8e69a8c9 100644 --- a/cotisations/templates/cotisations/sidebar.html +++ b/cotisations/templates/cotisations/sidebar.html @@ -52,7 +52,7 @@ with this program; if not, write to the Free Software Foundation, Inc., {% acl_end %} {% can_view_all Article %} - {% trans "Available articles" %} + {% trans "Articles" %} {% acl_end %} {% can_view_all Banque %} diff --git a/cotisations/tex.py b/cotisations/tex.py index 6872ac6a..2930fffe 100644 --- a/cotisations/tex.py +++ b/cotisations/tex.py @@ -36,7 +36,6 @@ from django.template.loader import get_template from django.http import HttpResponse from django.conf import settings from django.utils.text import slugify -from django.utils.translation import ugettext_lazy as _ from re2o.mixins import AclMixin, RevMixin from preferences.models import CotisationsOption diff --git a/cotisations/views.py b/cotisations/views.py index 4510aff9..562326e3 100644 --- a/cotisations/views.py +++ b/cotisations/views.py @@ -166,6 +166,7 @@ def new_facture(request, user, userid): "articlelist": article_list, "balance": balance, "action_name": _("Confirm"), + "title": _("New invoice"), }, "cotisations/facture.html", request, @@ -222,7 +223,7 @@ def new_cost_estimate(request): "articlesformset": articles_formset, "articlelist": articles, "discount_form": discount_form, - "title": _("Cost estimate"), + "title": _("New cost estimate"), }, "cotisations/facture.html", request, @@ -278,6 +279,7 @@ def new_custom_invoice(request): "articlesformset": articles_formset, "articlelist": articles, "discount_form": discount_form, + "title": _("New custom invoice"), }, "cotisations/facture.html", request, @@ -373,7 +375,7 @@ def del_facture(request, facture, **_kwargs): messages.success(request, _("The invoice was deleted.")) return redirect(reverse("cotisations:index")) return form( - {"objet": facture, "objet_name": _("Invoice")}, + {"objet": facture, "objet_name": _("invoice")}, "cotisations/delete.html", request, ) @@ -437,7 +439,11 @@ def edit_custom_invoice(request, invoice, **kwargs): return redirect(reverse("cotisations:index-custom-invoice")) return form( - {"factureform": invoice_form, "venteform": purchase_form}, + { + "factureform": invoice_form, + "venteform": purchase_form, + "title": _("Edit custom invoice"), + }, "cotisations/edit_facture.html", request, ) @@ -501,7 +507,7 @@ def del_cost_estimate(request, estimate, **_kwargs): messages.success(request, _("The cost estimate was deleted.")) return redirect(reverse("cotisations:index-cost-estimate")) return form( - {"objet": estimate, "objet_name": _("Cost estimate")}, + {"objet": estimate, "objet_name": _("cost estimate")}, "cotisations/delete.html", request, ) @@ -564,7 +570,7 @@ def del_custom_invoice(request, invoice, **_kwargs): messages.success(request, _("The invoice was deleted.")) return redirect(reverse("cotisations:index-custom-invoice")) return form( - {"objet": invoice, "objet_name": _("Invoice")}, + {"objet": invoice, "objet_name": _("invoice")}, "cotisations/delete.html", request, ) @@ -588,7 +594,11 @@ def add_article(request): messages.success(request, _("The article was created.")) return redirect(reverse("cotisations:index-article")) return form( - {"factureform": article, "action_name": _("Add"), "title": _("New article")}, + { + "factureform": article, + "action_name": _("Add"), + "title": _("New article"), + }, "cotisations/facture.html", request, ) @@ -607,7 +617,11 @@ def edit_article(request, article_instance, **_kwargs): messages.success(request, _("The article was edited.")) return redirect(reverse("cotisations:index-article")) return form( - {"factureform": article, "action_name": _("Edit"), "title": _("Edit article")}, + { + "factureform": article, + "action_name": _("Edit"), + "title": _("Edit article"), + }, "cotisations/facture.html", request, ) @@ -718,8 +732,8 @@ def del_paiement(request, instances): messages.error( request, _( - "The payment method %(method_name)s can't be deleted \ - because there are invoices using it." + "The payment method %(method_name)s can't be deleted" + " because there are invoices using it." ) % {"method_name": payment_del}, ) @@ -748,7 +762,11 @@ def add_banque(request): messages.success(request, _("The bank was created.")) return redirect(reverse("cotisations:index-banque")) return form( - {"factureform": bank, "action_name": _("Add"), "title": _("New bank")}, + { + "factureform": bank, + "action_name": _("Add"), + "title": _("New bank"), + }, "cotisations/facture.html", request, ) @@ -768,7 +786,11 @@ def edit_banque(request, banque_instance, **_kwargs): messages.success(request, _("The bank was edited.")) return redirect(reverse("cotisations:index-banque")) return form( - {"factureform": bank, "action_name": _("Edit"), "title": _("Edit bank")}, + { + "factureform": bank, + "action_name": _("Edit"), + "title": _("Edit bank"), + }, "cotisations/facture.html", request, ) @@ -802,7 +824,11 @@ def del_banque(request, instances): ) return redirect(reverse("cotisations:index-banque")) return form( - {"factureform": bank, "action_name": _("Delete"), "title": _("Delete bank")}, + { + "factureform": bank, + "action_name": _("Delete"), + "title": _("Delete bank"), + }, "cotisations/facture.html", request, ) @@ -833,7 +859,7 @@ def control(request): ) if control_invoices_form.is_valid(): control_invoices_form.save() - reversion.set_comment("Controle") + reversion.set_comment("Control") messages.success( request, _("Your changes have been properly taken into account.") ) From 07ce7bd8a77d76a4fab23d095f4722cc854c3396 Mon Sep 17 00:00:00 2001 From: Laouen Fernet Date: Sat, 16 Nov 2019 14:03:08 +0000 Subject: [PATCH 03/26] Mark strings for translation in logs --- logs/acl.py | 3 ++- logs/templates/logs/aff_summary.html | 2 +- logs/views.py | 38 ++++++++++++++-------------- 3 files changed, 22 insertions(+), 21 deletions(-) diff --git a/logs/acl.py b/logs/acl.py index f6be8183..42000ea8 100644 --- a/logs/acl.py +++ b/logs/acl.py @@ -41,6 +41,7 @@ def can_view(user): can = user.has_module_perms("admin") 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."), "admin", ) diff --git a/logs/templates/logs/aff_summary.html b/logs/templates/logs/aff_summary.html index 7205bc6a..31834a2d 100644 --- a/logs/templates/logs/aff_summary.html +++ b/logs/templates/logs/aff_summary.html @@ -113,7 +113,7 @@ with this program; if not, write to the Free Software Foundation, Inc., {% blocktrans with username=v.username number=v.version.object.number name=v.version.object.name %}{{ username }} has sold {{ number }}x {{ name }}{% endblocktrans %} {% with invoice=v.version.object.facture %} {% if invoice|is_facture %} - {% trans " to" %} + {% trans "to" %} {{ v.version.object.facture.facture.user.get_username }} {% if v.version.object.iscotisation %} ({% blocktrans with duration=v.version.object.duration %}+{{ duration }} months{% endblocktrans %}) diff --git a/logs/views.py b/logs/views.py index be71f7cc..7c509134 100644 --- a/logs/views.py +++ b/logs/views.py @@ -241,7 +241,7 @@ def stats_general(request): Club.objects.filter(state=Club.STATE_ARCHIVE).count(), ], "full_archive_users": [ - _("Full Archived users"), + _("Fully archived users"), User.objects.filter(state=User.STATE_FULL_ARCHIVE).count(), ( Adherent.objects.filter( @@ -321,7 +321,7 @@ def stats_general(request): _("Total number of IP addresses"), _("Number of assigned IP addresses"), _("Number of IP address assigned to an activated machine"), - _("Number of nonassigned IP addresses"), + _("Number of unassigned IP addresses"), ], ip_dict, # Data already prepared ], @@ -336,7 +336,7 @@ def stats_models(request): nombre d'users, d'écoles, de droits, de bannissements, de factures, de ventes, de banque, de machines, etc""" stats = { - _("Users"): { + _("Users (members and clubs)"): { "users": [User._meta.verbose_name, User.objects.count()], "adherents": [Adherent._meta.verbose_name, Adherent.objects.count()], "clubs": [Club._meta.verbose_name, Club.objects.count()], @@ -350,14 +350,14 @@ def stats_models(request): "ban": [Ban._meta.verbose_name, Ban.objects.count()], "whitelist": [Whitelist._meta.verbose_name, Whitelist.objects.count()], }, - _("Subscriptions"): { + Cotisation._meta.verbose_name_plural.title(): { "factures": [Facture._meta.verbose_name, Facture.objects.count()], "vente": [Vente._meta.verbose_name, Vente.objects.count()], "cotisation": [Cotisation._meta.verbose_name, Cotisation.objects.count()], "article": [Article._meta.verbose_name, Article.objects.count()], "banque": [Banque._meta.verbose_name, Banque.objects.count()], }, - _("Machines"): { + Machine._meta.verbose_name_plural.title(): { "machine": [Machine._meta.verbose_name, Machine.objects.count()], "typemachine": [ MachineType._meta.verbose_name, @@ -412,31 +412,31 @@ def stats_users(request): de moyens de paiements par user, de banque par user, de bannissement par user, etc""" stats = { - _("User"): { - _("Machines"): User.objects.annotate(num=Count("machine")).order_by("-num")[ + User._meta.verbose_name: { + Machine._meta.verbose_name_plural: User.objects.annotate(num=Count("machine")).order_by("-num")[ :10 ], - _("Invoice"): User.objects.annotate(num=Count("facture")).order_by("-num")[ + Facture._meta.verbose_name_plural: User.objects.annotate(num=Count("facture")).order_by("-num")[ :10 ], - _("Ban"): User.objects.annotate(num=Count("ban")).order_by("-num")[:10], - _("Whitelist"): User.objects.annotate(num=Count("whitelist")).order_by( + Ban._meta.verbose_name_plural: User.objects.annotate(num=Count("ban")).order_by("-num")[:10], + Whitelist._meta.verbose_name_plural: User.objects.annotate(num=Count("whitelist")).order_by( "-num" )[:10], - _("Rights"): User.objects.annotate(num=Count("groups")).order_by("-num")[ + _("rights"): User.objects.annotate(num=Count("groups")).order_by("-num")[ :10 ], }, - _("School"): { - _("User"): School.objects.annotate(num=Count("user")).order_by("-num")[:10] + School._meta.verbose_name: { + User._meta.verbose_name_plural: School.objects.annotate(num=Count("user")).order_by("-num")[:10] }, - _("Payment method"): { - _("User"): Paiement.objects.annotate(num=Count("facture")).order_by("-num")[ + Paiement._meta.verbose_name: { + User._meta.verbose_name_plural: Paiement.objects.annotate(num=Count("facture")).order_by("-num")[ :10 ] }, - _("Bank"): { - _("User"): Banque.objects.annotate(num=Count("facture")).order_by("-num")[ + Banque._meta.verbose_name: { + User._meta.verbose_name_plural: Banque.objects.annotate(num=Count("facture")).order_by("-num")[ :10 ] }, @@ -451,8 +451,8 @@ def stats_actions(request): utilisateurs. Affiche le nombre de modifications aggrégées par utilisateurs""" stats = { - _("User"): { - _("Action"): User.objects.annotate(num=Count("revision")).order_by("-num")[ + User._meta.verbose_name: { + _("actions"): User.objects.annotate(num=Count("revision")).order_by("-num")[ :40 ] } From ac5d8e2080f08b74bcfdc902f75af81bed7b1ab9 Mon Sep 17 00:00:00 2001 From: Laouen Fernet Date: Sat, 16 Nov 2019 14:07:15 +0000 Subject: [PATCH 04/26] Mark strings for translation in machines --- machines/acl.py | 3 +- machines/models.py | 108 ++++++++++-------- .../templates/machines/aff_extension.html | 2 +- machines/templates/machines/aff_iptype.html | 2 +- machines/templates/machines/aff_machines.html | 10 +- machines/templates/machines/aff_servers.html | 4 +- .../templates/machines/edit_portlist.html | 7 +- machines/templates/machines/index_alias.html | 4 +- .../templates/machines/index_extension.html | 29 +++-- machines/templates/machines/index_iptype.html | 4 +- machines/templates/machines/index_ipv6.html | 2 +- .../templates/machines/index_machinetype.html | 4 +- machines/templates/machines/index_nas.html | 4 +- .../templates/machines/index_portlist.html | 2 +- machines/templates/machines/index_role.html | 4 +- .../templates/machines/index_service.html | 4 +- machines/templates/machines/index_sshfp.html | 2 +- machines/templates/machines/index_vlan.html | 4 +- machines/templates/machines/sidebar.html | 2 +- machines/views.py | 50 ++++---- 20 files changed, 129 insertions(+), 122 deletions(-) diff --git a/machines/acl.py b/machines/acl.py index 55b48145..1989a788 100644 --- a/machines/acl.py +++ b/machines/acl.py @@ -41,6 +41,7 @@ def can_view(user): can = user.has_module_perms("machines") 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."), ("machines",), ) diff --git a/machines/models.py b/machines/models.py index 8b83e256..7b548cfb 100644 --- a/machines/models.py +++ b/machines/models.py @@ -68,7 +68,7 @@ class Machine(RevMixin, FieldPermissionModelMixin, models.Model): user = models.ForeignKey("users.User", on_delete=models.CASCADE) name = models.CharField( - max_length=255, help_text=_("Optional"), blank=True, null=True + max_length=255, help_text=_("Optional."), blank=True, null=True ) active = models.BooleanField(default=True) @@ -157,7 +157,8 @@ class Machine(RevMixin, FieldPermissionModelMixin, models.Model): if user != user_request: return ( False, - _("You don't have the right to add a machine" " to another user."), + _("You don't have the right to add a machine to another" + " user."), ("machines.add_machine",), ) if user.user_interfaces().count() >= max_lambdauser_interfaces: @@ -185,7 +186,8 @@ class Machine(RevMixin, FieldPermissionModelMixin, models.Model): if not (user_request.has_perm("machines.change_interface") and can_user): return ( False, - _("You don't have the right to edit a machine" " of another user."), + _("You don't have the right to edit a machine of another" + " user."), ("machines.change_interface",) + permissions, ) return True, None, None @@ -223,7 +225,8 @@ class Machine(RevMixin, FieldPermissionModelMixin, models.Model): ): return ( False, - _("You don't have the right to view other machines" " than yours."), + _("You don't have the right to view other machines than" + " yours."), ("machines.view_machine",), ) return True, None, None @@ -358,22 +361,22 @@ class IpType(RevMixin, AclMixin, models.Model): protocol="IPv4", null=True, blank=True, - help_text=_("Network containing the domain's IPv4 range (optional)"), + help_text=_("Network containing the domain's IPv4 range (optional)."), ) domaine_ip_netmask = models.IntegerField( default=24, validators=[MaxValueValidator(31), MinValueValidator(8)], - help_text=_("Netmask for the domain's IPv4 range"), + help_text=_("Netmask for the domain's IPv4 range."), ) reverse_v4 = models.BooleanField( - default=False, help_text=_("Enable reverse DNS for IPv4") + default=False, help_text=_("Enable reverse DNS for IPv4.") ) prefix_v6 = models.GenericIPAddressField(protocol="IPv6", null=True, blank=True) prefix_v6_length = models.IntegerField( default=64, validators=[MaxValueValidator(128), MinValueValidator(0)] ) reverse_v6 = models.BooleanField( - default=False, help_text=_("Enable reverse DNS for IPv6") + default=False, help_text=_("Enable reverse DNS for IPv6.") ) vlan = models.ForeignKey("Vlan", on_delete=models.PROTECT, blank=True, null=True) ouverture_ports = models.ForeignKey("OuverturePortList", blank=True, null=True) @@ -553,7 +556,8 @@ class IpType(RevMixin, AclMixin, models.Model): for element in IpType.objects.all().exclude(pk=self.pk): if not self.ip_set.isdisjoint(element.ip_set): raise ValidationError( - _("The specified range is not disjoint" " from existing ranges.") + _("The specified range is not disjoint from existing" + " ranges.") ) # On formate le prefix v6 if self.prefix_v6: @@ -604,8 +608,8 @@ class Vlan(RevMixin, AclMixin, models.Model): arp_protect = models.BooleanField(default=False) dhcp_snooping = models.BooleanField(default=False) dhcpv6_snooping = models.BooleanField(default=False) - igmp = models.BooleanField(default=False, help_text=_("v4 multicast management")) - mld = models.BooleanField(default=False, help_text=_("v6 multicast management")) + igmp = models.BooleanField(default=False, help_text=_("v4 multicast management.")) + mld = models.BooleanField(default=False, help_text=_("v6 multicast management.")) class Meta: permissions = (("view_vlan", _("Can view a VLAN object")),) @@ -653,30 +657,30 @@ class SOA(RevMixin, AclMixin, models.Model): """ name = models.CharField(max_length=255) - mail = models.EmailField(help_text=_("Contact email address for the zone")) + mail = models.EmailField(help_text=_("Contact email address for the zone.")) refresh = models.PositiveIntegerField( default=86400, # 24 hours help_text=_( "Seconds before the secondary DNS have to ask the primary" - " DNS serial to detect a modification" + " DNS serial to detect a modification." ), ) retry = models.PositiveIntegerField( default=7200, # 2 hours help_text=_( "Seconds before the secondary DNS ask the serial again in" - " case of a primary DNS timeout" + " case of a primary DNS timeout." ), ) expire = models.PositiveIntegerField( default=3600000, # 1000 hours help_text=_( "Seconds before the secondary DNS stop answering requests" - " in case of primary DNS timeout" + " in case of primary DNS timeout." ), ) ttl = models.PositiveIntegerField( - default=172800, help_text=_("Time to Live") # 2 days + default=172800, help_text=_("Time To Live.") # 2 days ) class Meta: @@ -732,7 +736,7 @@ class Extension(RevMixin, AclMixin, models.Model): name = models.CharField( max_length=255, unique=True, - help_text=_("Zone name, must begin with a dot (.example.org)"), + help_text=_("Zone name, must begin with a dot (.example.org)."), ) need_infra = models.BooleanField(default=False) origin = models.ForeignKey( @@ -740,17 +744,17 @@ class Extension(RevMixin, AclMixin, models.Model): on_delete=models.PROTECT, blank=True, null=True, - help_text=_("A record associated with the zone"), + help_text=_("A record associated with the zone."), ) origin_v6 = models.GenericIPAddressField( protocol="IPv6", null=True, blank=True, - help_text=_("AAAA record associated with the zone"), + help_text=_("AAAA record associated with the zone."), ) soa = models.ForeignKey("SOA", on_delete=models.CASCADE) dnssec = models.BooleanField( - default=False, help_text=_("Should the zone be signed with DNSSEC") + default=False, help_text=_("Should the zone be signed with DNSSEC.") ) class Meta: @@ -819,7 +823,7 @@ class Extension(RevMixin, AclMixin, models.Model): can = user_request.has_perm("machines.use_all_extension") return ( can, - _("You cannot use all extensions.") if not can else None, + _("You don't have the right to use all extensions.") if not can else None, ("machines.use_all_extension",), ) @@ -943,7 +947,7 @@ class Srv(RevMixin, AclMixin, models.Model): ) extension = models.ForeignKey("Extension", on_delete=models.PROTECT) ttl = models.PositiveIntegerField( - default=172800, help_text=_("Time to Live") # 2 days + default=172800, help_text=_("Time To Live.") # 2 days ) priority = models.PositiveIntegerField( default=0, @@ -951,7 +955,7 @@ class Srv(RevMixin, AclMixin, models.Model): help_text=_( "Priority of the target server (positive integer value," " the lower it is, the more the server will be used if" - " available)" + " available)." ), ) weight = models.PositiveIntegerField( @@ -959,14 +963,14 @@ class Srv(RevMixin, AclMixin, models.Model): validators=[MaxValueValidator(65535)], help_text=_( "Relative weight for records with the same priority" - " (integer value between 0 and 65535)" + " (integer value between 0 and 65535)." ), ) port = models.PositiveIntegerField( - validators=[MaxValueValidator(65535)], help_text=_("TCP/UDP port") + validators=[MaxValueValidator(65535)], help_text=_("TCP/UDP port.") ) target = models.ForeignKey( - "Domain", on_delete=models.PROTECT, help_text=_("Target server") + "Domain", on_delete=models.PROTECT, help_text=_("Target server.") ) class Meta: @@ -1023,10 +1027,10 @@ class SshFp(RevMixin, AclMixin, models.Model): ) machine = models.ForeignKey("Machine", on_delete=models.CASCADE) - pub_key_entry = models.TextField(help_text=_("SSH public key"), max_length=2048) + pub_key_entry = models.TextField(help_text=_("SSH public key."), max_length=2048) algo = models.CharField(choices=ALGO, max_length=32) comment = models.CharField( - help_text=_("Comment"), max_length=255, null=True, blank=True + help_text=_("Comment."), max_length=255, null=True, blank=True ) @cached_property @@ -1128,7 +1132,7 @@ class Interface(RevMixin, AclMixin, FieldPermissionModelMixin, models.Model): oui = mac.oui vendor = oui.registration().org except NotRegisteredError: - vendor = "Unknown vendor" + vendor = _("Unknown vendor.") return vendor def sync_ipv6_dhcpv6(self): @@ -1201,7 +1205,7 @@ class Interface(RevMixin, AclMixin, FieldPermissionModelMixin, models.Model): self.ipv4 = free_ips[0] else: raise ValidationError( - _("There is no IP address available in the" " slash.") + _("There are no IP addresses available in the slash.") ) return @@ -1214,7 +1218,7 @@ class Interface(RevMixin, AclMixin, FieldPermissionModelMixin, models.Model): """Unassign ipv4 to multiple interfaces""" with transaction.atomic(), reversion.create_revision(): interface_list.update(ipv4=None) - reversion.set_comment(_("IPv4 unassigning")) + reversion.set_comment("IPv4 unassignment") @classmethod def mass_assign_ipv4(cls, interface_list): @@ -1222,7 +1226,7 @@ class Interface(RevMixin, AclMixin, FieldPermissionModelMixin, models.Model): with transaction.atomic(), reversion.create_revision(): interface.assign_ipv4() interface.save() - reversion.set_comment(_("IPv4 assigning")) + reversion.set_comment("IPv4 assignment") def update_type(self): """ Lorsque le machinetype est changé de type d'ip, on réassigne""" @@ -1267,7 +1271,7 @@ class Interface(RevMixin, AclMixin, FieldPermissionModelMixin, models.Model): ) if interfaces_similar and interfaces_similar.first() != self: raise ValidationError( - _("Mac address already registered in this Machine Type/Subnet") + _("MAC address already registered in this machine type/subnet.") ) def save(self, *args, **kwargs): @@ -1276,7 +1280,7 @@ class Interface(RevMixin, AclMixin, FieldPermissionModelMixin, models.Model): if self.ipv4: if self.machine_type.ip_type != self.ipv4.ip_type: raise ValidationError( - _("The IPv4 address and the machine type" " don't match.") + _("The IPv4 address and the machine type don't match.") ) self.validate_unique() super(Interface, self).save(*args, **kwargs) @@ -1296,7 +1300,7 @@ class Interface(RevMixin, AclMixin, FieldPermissionModelMixin, models.Model): if not ( preferences.models.OptionalMachine.get_cached_value("create_machine") ): - return False, _("You can't add a machine."), ("machines.add_interface",) + return False, _("You don't have the right to add a machine."), ("machines.add_interface",) max_lambdauser_interfaces = preferences.models.OptionalMachine.get_cached_value( "max_lambdauser_interfaces" ) @@ -1328,7 +1332,7 @@ class Interface(RevMixin, AclMixin, FieldPermissionModelMixin, models.Model): can = user_request.has_perm("machines.change_interface_machine") return ( can, - _("Permission required to edit the machine.") if not can else None, + _("You don't have the right to edit the machine.") if not can else None, ("machines.change_interface_machine",), ) @@ -1345,7 +1349,8 @@ class Interface(RevMixin, AclMixin, FieldPermissionModelMixin, models.Model): if not (user_request.has_perm("machines.change_interface") and can_user): return ( False, - _("You don't have the right to edit a machine of" " another user."), + _("You don't have the right to edit a machine of another" + " user."), ("machines.change_interface",) + permissions, ) return True, None, None @@ -1363,7 +1368,8 @@ class Interface(RevMixin, AclMixin, FieldPermissionModelMixin, models.Model): if not (user_request.has_perm("machines.change_interface") and can_user): return ( False, - _("You don't have the right to edit a machine of" " another user."), + _("You don't have the right to edit a machine of another" + " user."), ("machines.change_interface",) + permissions, ) return True, None, None @@ -1411,7 +1417,7 @@ class Ipv6List(RevMixin, AclMixin, FieldPermissionModelMixin, models.Model): ("view_ipv6list", _("Can view an IPv6 addresses list object")), ( "change_ipv6list_slaac_ip", - _("Can change the SLAAC value of an" " IPv6 addresses list"), + _("Can change the SLAAC value of an IPv6 addresses list"), ), ) verbose_name = _("IPv6 addresses list") @@ -1446,7 +1452,7 @@ class Ipv6List(RevMixin, AclMixin, FieldPermissionModelMixin, models.Model): can = user_request.has_perm("machines.change_ipv6list_slaac_ip") return ( can, - _("Permission required to change the SLAAC value of an IPv6" " address") + _("You don't have the right to change the SLAAC value of an IPv6 address.") if not can else None, ("machines.change_ipv6list_slaac_ip",), @@ -1465,7 +1471,7 @@ class Ipv6List(RevMixin, AclMixin, FieldPermissionModelMixin, models.Model): if not (user_request.has_perm("machines.change_ipv6list") and can_user): return ( False, - _("You don't have the right to edit a machine of" " another user."), + _("You don't have the right to edit a machine of another user."), ("machines.change_ipv6list",), ) return True, None, None @@ -1483,7 +1489,7 @@ class Ipv6List(RevMixin, AclMixin, FieldPermissionModelMixin, models.Model): if not (user_request.has_perm("machines.change_ipv6list") and can_user): return ( False, - _("You don't have the right to edit a machine of" " another user."), + _("You don't have the right to edit a machine of another user."), ("machines.change_ipv6list",) + permissions, ) return True, None, None @@ -1587,7 +1593,7 @@ class Domain(RevMixin, AclMixin, FieldPermissionModelMixin, models.Model): unique_together = (("name", "extension"),) permissions = ( ("view_domain", _("Can view a domain object")), - ("change_ttl", _("Can change TTL of a domain object")), + ("change_ttl", _("Can change the TTL of a domain object")), ) verbose_name = _("domain") verbose_name_plural = _("domains") @@ -1612,20 +1618,20 @@ class Domain(RevMixin, AclMixin, FieldPermissionModelMixin, models.Model): if self.get_extension(): self.extension = self.get_extension() if self.interface_parent and self.cname: - raise ValidationError(_("You can't create a both A and CNAME" " record.")) + raise ValidationError(_("You can't create a both A and CNAME record.")) if self.cname == self: raise ValidationError( - _("You can't create a CNAME record pointing" " to itself.") + _("You can't create a CNAME record pointing to itself.") ) HOSTNAME_LABEL_PATTERN = re.compile(r"(?!-)[A-Z\d-]+(? 63: raise ValidationError( - _("The domain name %s is too long (over 63" " characters).") % dns + _("The domain name %s is too long (over 63 characters).") % dns ) if not HOSTNAME_LABEL_PATTERN.match(dns): raise ValidationError( - _("The domain name %s contains forbidden" " characters.") % dns + _("The domain name %s contains forbidden characters.") % dns ) self.validate_unique() super(Domain, self).clean() @@ -1753,7 +1759,8 @@ class Domain(RevMixin, AclMixin, FieldPermissionModelMixin, models.Model): ): return ( False, - _("You don't have the right to view machines other than yours."), + _("You don't have the right to view other machines than" + " yours."), ("machines.view_domain",), ) return True, None, None @@ -1794,7 +1801,7 @@ class IpList(RevMixin, AclMixin, models.Model): """ Erreur si l'ip_type est incorrect""" if not str(self.ipv4) in self.ip_type.ip_set_as_str: raise ValidationError( - _("The IPv4 address and the range of the IP" " type don't match.") + _("The IPv4 address and the range of the IP type don't match.") ) return @@ -1970,7 +1977,8 @@ class OuverturePortList(RevMixin, AclMixin, models.Model): class Meta: permissions = ( - ("view_ouvertureportlist", _("Can view a ports opening list" " object")), + ("view_ouvertureportlist", _("Can view a ports opening list" + " object")), ) verbose_name = _("ports opening list") verbose_name_plural = _("ports opening lists") diff --git a/machines/templates/machines/aff_extension.html b/machines/templates/machines/aff_extension.html index 809ef4ba..358fc33e 100644 --- a/machines/templates/machines/aff_extension.html +++ b/machines/templates/machines/aff_extension.html @@ -32,7 +32,7 @@ with this program; if not, write to the Free Software Foundation, Inc., {% trans "Extension" %} - {% trans "'infra' right required" %} + {% blocktrans %}"infra" right required{% endblocktrans %} {% trans "SOA record" %} {% trans "A record origin" %} {% if ipv6_enabled %} diff --git a/machines/templates/machines/aff_iptype.html b/machines/templates/machines/aff_iptype.html index 2675b87a..7cf710c2 100644 --- a/machines/templates/machines/aff_iptype.html +++ b/machines/templates/machines/aff_iptype.html @@ -34,7 +34,7 @@ with this program; if not, write to the Free Software Foundation, Inc., {% trans "IP type" %} {% trans "Extension" %} - {% trans "'infra' right required" %} + {% blocktrans %}"infra" right required{% endblocktrans %} {% trans "IPv4 range" %} {% trans "v6 prefix" %} {% trans "DNSSEC reverse v4/v6" %} diff --git a/machines/templates/machines/aff_machines.html b/machines/templates/machines/aff_machines.html index e59cfde6..77b65546 100644 --- a/machines/templates/machines/aff_machines.html +++ b/machines/templates/machines/aff_machines.html @@ -123,7 +123,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
  • - {% trans " Edit" %} + {% trans "Edit" %}
  • {% acl_end %} @@ -131,7 +131,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
  • - {% trans " Manage the aliases" %} + {% trans "Manage the aliases" %}
  • {% acl_end %} @@ -139,7 +139,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
  • - {% trans " Manage the IPv6 addresses" %} + {% trans "Manage the IPv6 addresses" %}
  • {% acl_end %} @@ -147,7 +147,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
  • - {% trans " Manage the SSH fingerprints" %} + {% trans "Manage the SSH fingerprints" %}
  • {% acl_end %} @@ -155,7 +155,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
  • - {% trans " Manage the ports configuration" %} + {% trans "Manage the ports configuration" %}
  • {% acl_end %} diff --git a/machines/templates/machines/aff_servers.html b/machines/templates/machines/aff_servers.html index 36c4bca0..3829c6c1 100644 --- a/machines/templates/machines/aff_servers.html +++ b/machines/templates/machines/aff_servers.html @@ -31,8 +31,8 @@ with this program; if not, write to the Free Software Foundation, Inc., {% trans "Service name" %} {% trans "Server" %} {% trans "Last regeneration" %} - {% trans "Regeneration required" %} - {% trans "Regeneration activated" %} + {% trans "Regeneration asked" %} + {% trans "Regeneration needed" %} {% for server in servers_list %} diff --git a/machines/templates/machines/edit_portlist.html b/machines/templates/machines/edit_portlist.html index 387723bb..a2aded23 100644 --- a/machines/templates/machines/edit_portlist.html +++ b/machines/templates/machines/edit_portlist.html @@ -47,11 +47,10 @@ with this program; if not, write to the Free Software Foundation, Inc.,

    - {% trans "Add a port" as value %} - +

    - {% trans "Create or edit" as tr_create_or_edit %} - {% bootstrap_button tr_create_or_edit icon='ok' button_class='btn-success' %} + {% trans "Confirm" as tr_confirm %} + {% bootstrap_button tr_confirm icon='ok' button_class='btn-success' %}