diff --git a/machines/acl.py b/machines/acl.py index 1b74760c..45cb6ec2 100644 --- a/machines/acl.py +++ b/machines/acl.py @@ -25,6 +25,7 @@ Here are defined some functions to check acl on the application. """ +from django.utils.translation import ugettext as _ def can_view(user): @@ -38,4 +39,6 @@ def can_view(user): viewing is granted and msg is a message (can be None). """ can = user.has_module_perms('machines') - return can, None if can else "Vous ne pouvez pas voir cette application." + return can, None if can else _("You don't have the right to view this" + " application.") + diff --git a/machines/forms.py b/machines/forms.py index b68cb203..4af060d3 100644 --- a/machines/forms.py +++ b/machines/forms.py @@ -37,7 +37,7 @@ from __future__ import unicode_literals from django.forms import ModelForm, Form from django import forms -from django.utils.translation import ugettext_lazy as _l +from django.utils.translation import ugettext_lazy as _ from re2o.field_permissions import FieldPermissionFormMixin from re2o.mixins import FormRevMixin @@ -75,7 +75,7 @@ class EditMachineForm(FormRevMixin, FieldPermissionFormMixin, ModelForm): def __init__(self, *args, **kwargs): prefix = kwargs.pop('prefix', self.Meta.model.__name__) super(EditMachineForm, self).__init__(*args, prefix=prefix, **kwargs) - self.fields['name'].label = 'Nom de la machine' + self.fields['name'].label = _("Machine name") class NewMachineForm(EditMachineForm): @@ -94,12 +94,11 @@ class EditInterfaceForm(FormRevMixin, FieldPermissionFormMixin, ModelForm): prefix = kwargs.pop('prefix', self.Meta.model.__name__) user = kwargs.get('user') super(EditInterfaceForm, self).__init__(*args, prefix=prefix, **kwargs) - self.fields['mac_address'].label = 'Adresse mac' - self.fields['type'].label = 'Type de machine' - self.fields['type'].empty_label = "Séléctionner un type de machine" + self.fields['mac_address'].label = _("MAC address") + self.fields['type'].label = _("Machine type") + self.fields['type'].empty_label = _("Select a machine type") if "ipv4" in self.fields: - self.fields['ipv4'].empty_label = ("Assignation automatique de " - "l'ipv4") + self.fields['ipv4'].empty_label = _("Automatic IPv4 assignment") self.fields['ipv4'].queryset = IpList.objects.filter( interface__isnull=True ) @@ -170,7 +169,7 @@ class DelAliasForm(FormRevMixin, Form): """Suppression d'un ou plusieurs objets alias""" alias = forms.ModelMultipleChoiceField( queryset=Domain.objects.all(), - label="Alias actuels", + label=_("Current aliases"), widget=forms.CheckboxSelectMultiple ) @@ -191,15 +190,15 @@ class MachineTypeForm(FormRevMixin, ModelForm): def __init__(self, *args, **kwargs): prefix = kwargs.pop('prefix', self.Meta.model.__name__) super(MachineTypeForm, self).__init__(*args, prefix=prefix, **kwargs) - self.fields['type'].label = 'Type de machine à ajouter' - self.fields['ip_type'].label = "Type d'ip relié" + self.fields['type'].label = _("Machine type to add") + self.fields['ip_type'].label = _("Related IP type") class DelMachineTypeForm(FormRevMixin, Form): """Suppression d'un ou plusieurs machinetype""" machinetypes = forms.ModelMultipleChoiceField( queryset=MachineType.objects.none(), - label="Types de machines actuelles", + label=_("Current machine types"), widget=forms.CheckboxSelectMultiple ) @@ -222,7 +221,7 @@ class IpTypeForm(FormRevMixin, ModelForm): def __init__(self, *args, **kwargs): prefix = kwargs.pop('prefix', self.Meta.model.__name__) super(IpTypeForm, self).__init__(*args, prefix=prefix, **kwargs) - self.fields['type'].label = 'Type ip à ajouter' + self.fields['type'].label = _("IP type to add") class EditIpTypeForm(IpTypeForm): @@ -239,7 +238,7 @@ class DelIpTypeForm(FormRevMixin, Form): """Suppression d'un ou plusieurs iptype""" iptypes = forms.ModelMultipleChoiceField( queryset=IpType.objects.none(), - label="Types d'ip actuelles", + label=_("Current IP types"), widget=forms.CheckboxSelectMultiple ) @@ -261,17 +260,17 @@ class ExtensionForm(FormRevMixin, ModelForm): def __init__(self, *args, **kwargs): prefix = kwargs.pop('prefix', self.Meta.model.__name__) super(ExtensionForm, self).__init__(*args, prefix=prefix, **kwargs) - self.fields['name'].label = 'Extension à ajouter' - self.fields['origin'].label = 'Enregistrement A origin' - self.fields['origin_v6'].label = 'Enregistrement AAAA origin' - self.fields['soa'].label = 'En-tête SOA à utiliser' + self.fields['name'].label = _("Extension to add") + self.fields['origin'].label = _("A record origin") + self.fields['origin_v6'].label = _("AAAA record origin") + self.fields['soa'].label = _("SOA record to use") class DelExtensionForm(FormRevMixin, Form): """Suppression d'une ou plusieurs extensions""" extensions = forms.ModelMultipleChoiceField( queryset=Extension.objects.none(), - label="Extensions actuelles", + label=_("Current extensions"), widget=forms.CheckboxSelectMultiple ) @@ -310,7 +309,7 @@ class DelSOAForm(FormRevMixin, Form): """Suppression d'un ou plusieurs SOA""" soa = forms.ModelMultipleChoiceField( queryset=SOA.objects.none(), - label="SOA actuels", + label=_("Current SOA records"), widget=forms.CheckboxSelectMultiple ) @@ -341,7 +340,7 @@ class DelMxForm(FormRevMixin, Form): """Suppression d'un ou plusieurs MX""" mx = forms.ModelMultipleChoiceField( queryset=Mx.objects.none(), - label="MX actuels", + label=_("Current MX records"), widget=forms.CheckboxSelectMultiple ) @@ -374,7 +373,7 @@ class DelNsForm(FormRevMixin, Form): """Suppresion d'un ou plusieurs NS""" ns = forms.ModelMultipleChoiceField( queryset=Ns.objects.none(), - label="Enregistrements NS actuels", + label=_("Current NS records"), widget=forms.CheckboxSelectMultiple ) @@ -402,7 +401,7 @@ class DelTxtForm(FormRevMixin, Form): """Suppression d'un ou plusieurs TXT""" txt = forms.ModelMultipleChoiceField( queryset=Txt.objects.none(), - label="Enregistrements Txt actuels", + label=_("Current TXT records"), widget=forms.CheckboxSelectMultiple ) @@ -430,7 +429,7 @@ class DelDNameForm(FormRevMixin, Form): """Delete a set of DNAME entries""" dnames = forms.ModelMultipleChoiceField( queryset=Txt.objects.none(), - label="Existing DNAME entries", + label=_("Current DNAME records"), widget=forms.CheckboxSelectMultiple ) @@ -458,7 +457,7 @@ class DelSrvForm(FormRevMixin, Form): """Suppression d'un ou plusieurs Srv""" srv = forms.ModelMultipleChoiceField( queryset=Srv.objects.none(), - label="Enregistrements Srv actuels", + label=_("Current SRV records"), widget=forms.CheckboxSelectMultiple ) @@ -487,7 +486,7 @@ class DelNasForm(FormRevMixin, Form): """Suppression d'un ou plusieurs nas""" nas = forms.ModelMultipleChoiceField( queryset=Nas.objects.none(), - label="Enregistrements Nas actuels", + label=_("Current NAS devices"), widget=forms.CheckboxSelectMultiple ) @@ -519,7 +518,7 @@ class DelRoleForm(FormRevMixin, Form): """Deletion of one or several roles.""" role = forms.ModelMultipleChoiceField( queryset=Role.objects.none(), - label=_l("Current roles"), + label=_("Current roles"), widget=forms.CheckboxSelectMultiple ) @@ -560,7 +559,7 @@ class DelServiceForm(FormRevMixin, Form): """Suppression d'un ou plusieurs service""" service = forms.ModelMultipleChoiceField( queryset=Service.objects.none(), - label="Services actuels", + label=_("Current services"), widget=forms.CheckboxSelectMultiple ) @@ -588,7 +587,7 @@ class DelVlanForm(FormRevMixin, Form): """Suppression d'un ou plusieurs vlans""" vlan = forms.ModelMultipleChoiceField( queryset=Vlan.objects.none(), - label="Vlan actuels", + label=_("Current VLANs"), widget=forms.CheckboxSelectMultiple ) @@ -646,3 +645,4 @@ class SshFpForm(FormRevMixin, ModelForm): prefix=prefix, **kwargs ) + diff --git a/machines/locale/fr/LC_MESSAGES/django.mo b/machines/locale/fr/LC_MESSAGES/django.mo new file mode 100644 index 00000000..c9696d92 Binary files /dev/null and b/machines/locale/fr/LC_MESSAGES/django.mo differ diff --git a/machines/locale/fr/LC_MESSAGES/django.po b/machines/locale/fr/LC_MESSAGES/django.po new file mode 100644 index 00000000..50ab03a8 --- /dev/null +++ b/machines/locale/fr/LC_MESSAGES/django.po @@ -0,0 +1,1748 @@ +# Re2o est un logiciel d'administration développé initiallement au rezometz. Il +# se veut agnostique au réseau considéré, de manière à être installable en +# quelques clics. +# +# Copyright © 2018 Maël Kervella +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License along +# with this program; if not, write to the Free Software Foundation, Inc., +# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +msgid "" +msgstr "" +"Project-Id-Version: 2.5\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2018-08-15 18:10+0200\n" +"PO-Revision-Date: 2018-06-23 16:35+0200\n" +"Last-Translator: Laouen Fernet \n" +"Language-Team: \n" +"Language: fr_FR\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" + +#: acl.py:42 +msgid "You don't have the right to view this application." +msgstr "Vous n'avez pas le droit de voir cette application." + +#: forms.py:78 +msgid "Machine name" +msgstr "Nom de la machine" + +#: forms.py:97 templates/machines/aff_machines.html:46 +msgid "MAC address" +msgstr "Adresse MAC" + +#: forms.py:98 templates/machines/aff_machinetype.html:32 +#: templates/machines/machine.html:112 +msgid "Machine type" +msgstr "Type de machine" + +#: forms.py:99 +msgid "Select a machine type" +msgstr "Sélectionnez un type de machine" + +#: forms.py:101 +msgid "Automatic IPv4 assignment" +msgstr "Assignation automatique IPv4" + +#: forms.py:172 +msgid "Current aliases" +msgstr "Alias actuels" + +#: forms.py:193 +msgid "Machine type to add" +msgstr "Type de machine à ajouter" + +#: forms.py:194 +msgid "Related IP type" +msgstr "Type d'IP relié" + +#: forms.py:201 +msgid "Current machine types" +msgstr "Types de machines actuels" + +#: forms.py:224 +msgid "IP type to add" +msgstr "Type d'IP à ajouter" + +#: forms.py:241 +msgid "Current IP types" +msgstr "Types d'IP actuels" + +#: forms.py:263 +msgid "Extension to add" +msgstr "Extension à ajouter" + +#: forms.py:264 templates/machines/aff_extension.html:37 +msgid "A record origin" +msgstr "Enregistrement A origin" + +#: forms.py:265 templates/machines/aff_extension.html:39 +msgid "AAAA record origin" +msgstr "Enregistrement AAAA origin" + +#: forms.py:266 +msgid "SOA record to use" +msgstr "Enregistrement SOA à utiliser" + +#: forms.py:273 +msgid "Current extensions" +msgstr "Extensions actuelles" + +#: forms.py:312 +msgid "Current SOA records" +msgstr "Enregistrements SOA actuels" + +#: forms.py:343 +msgid "Current MX records" +msgstr "Enregistrements MX actuels" + +#: forms.py:376 +msgid "Current NS records" +msgstr "Enregistrements NS actuels" + +#: forms.py:404 +msgid "Current TXT records" +msgstr "Enregistrements TXT actuels" + +#: forms.py:432 +msgid "Current DNAME records" +msgstr "Enregistrements DNAME actuels" + +#: forms.py:460 +msgid "Current SRV records" +msgstr "Enregistrements SRV actuels" + +#: forms.py:489 +msgid "Current NAS devices" +msgstr "Dispositifs NAS actuels" + +#: forms.py:521 +msgid "Current roles" +msgstr "Rôles actuels" + +#: forms.py:562 +msgid "Current services" +msgstr "Services actuels" + +#: forms.py:590 +msgid "Current VLANs" +msgstr "VLANs actuels" + +#: models.py:63 +msgid "Optional" +msgstr "Optionnel" + +#: models.py:71 +msgid "Can view a machine object" +msgstr "Peut voir un objet machine" + +#: models.py:73 +msgid "Can change the user of a machine" +msgstr "Peut changer l'utilisateur d'une machine" + +#: models.py:75 +msgid "machine" +msgstr "machine" + +#: models.py:76 +msgid "machines" +msgstr "machines" + +#: models.py:109 +msgid "You don't have the right to change the machine's user." +msgstr "Vous n'avez pas le droit de changer l'utilisateur de la machine." + +#: models.py:118 +msgid "You don't have the right to view all the machines." +msgstr "Vous n'avez pas le droit de voir toutes les machines." + +#: models.py:132 +msgid "Nonexistent user." +msgstr "Utilisateur inexistant." + +#: models.py:140 +msgid "You don't have the right to add a machine." +msgstr "Vous n'avez pas le droit d'ajouter une machine." + +#: models.py:142 +msgid "You don't have the right to add a machine to another user." +msgstr "Vous n'avez pas le droit d'ajouter une machine à un autre utilisateur." + +#: models.py:145 models.py:1152 +#, python-format +msgid "" +"You reached the maximum number of interfaces that you are allowed to create " +"yourself (%s)." +msgstr "" +"Vous avez atteint le nombre maximal d'interfaces que vous pouvez créer vous-" +"mêmes (%s)." + +#: models.py:164 models.py:1177 models.py:1194 models.py:1296 models.py:1313 +msgid "You don't have the right to edit a machine of another user." +msgstr "" +"Vous n'avez pas le droit de modifier une machine d'un autre utilisateur." + +#: models.py:182 +msgid "You don't have the right to delete a machine of another user." +msgstr "" +"Vous n'avez pas le droit de supprimer une machine d'une autre utilisateur." + +#: models.py:194 +msgid "You don't have the right to view other machines than yours." +msgstr "Vous n'avez pas le droit de voir d'autres machines que les vôtres." + +#: models.py:241 +msgid "Can view a machine type object" +msgstr "Peut voir un objet type de machine" + +#: models.py:242 +msgid "Can use all machine types" +msgstr "Peut utiliser tous les types de machine" + +#: models.py:244 +msgid "machine type" +msgstr "type de machine" + +#: models.py:245 +msgid "machine types" +msgstr "types de machine" + +#: models.py:263 +msgid "You don't have the right to use all machine types." +msgstr "Vous n'avez pas le droit d'utiliser tous les types de machine." + +#: models.py:282 +msgid "Network containing the domain's IPv4 range (optional)" +msgstr "Réseau contenant la plage IPv4 du domaine (optionnel)" + +#: models.py:290 +msgid "Netmask for the domain's IPv4 range" +msgstr "Masque de sous-réseau pour la plage IPv4 du domaine" + +#: models.py:294 +msgid "Enable reverse DNS for IPv4" +msgstr "Activer DNS inverse pour IPv4" + +#: models.py:310 +msgid "Enable reverse DNS for IPv6" +msgstr "Activer DNS inverser pour IPv6" + +#: models.py:326 +msgid "Can view an IP type object" +msgstr "Peut voir un objet type d'IP" + +#: models.py:327 +msgid "Can use all IP types" +msgstr "Peut utiliser tous les types d'IP" + +#: models.py:329 templates/machines/aff_iptype.html:35 +#: templates/machines/machine.html:108 +msgid "IP type" +msgstr "type d'IP" + +#: models.py:433 +msgid "" +"One or several IP addresses from the range are affected, impossible to " +"delete the range." +msgstr "" +"Une ou plusieurs adresses IP de la plage sont affectées, impossible de " +"supprimer la plage." + +#: models.py:475 +msgid "Range end must be after range start..." +msgstr "La fin de la plage doit être après le début..." + +#: models.py:478 +msgid "The range is too large, you can't create a larger one than a /16." +msgstr "" +"La plage est trop grande, vous ne pouvez pas en créer une plus grande " +"qu'un /16." + +#: models.py:483 +msgid "The specified range is not disjoint from existing ranges." +msgstr "La plage renseignée n'est pas disjointe des plages existantes." + +#: models.py:491 +msgid "" +"If you specify a domain network or netmask, it must contain the domain's IP " +"range." +msgstr "" +"Si vous renseignez un réseau ou masque de sous-réseau, il doit contenir" +" la plage IP du domaine." + +#: models.py:521 +msgid "Can view a VLAN object" +msgstr "Peut voir un objet VLAN" + +#: models.py:523 templates/machines/machine.html:160 +msgid "VLAN" +msgstr "VLAN" + +#: models.py:524 templates/machines/sidebar.html:57 +msgid "VLANs" +msgstr "VLANs" + +#: models.py:560 +msgid "Can view a NAS device object" +msgstr "Peut voir un objet dispositif NAS" + +#: models.py:562 templates/machines/machine.html:164 +msgid "NAS device" +msgstr "dispositif NAS" + +#: models.py:563 templates/machines/sidebar.html:63 +msgid "NAS devices" +msgstr "dispositifs NAS" + +#: models.py:577 +msgid "Contact email address for the zone" +msgstr "Adresse mail de contact pour la zone" + +#: models.py:581 +msgid "" +"Seconds before the secondary DNS have to ask the primary DNS serial to " +"detect a modification" +msgstr "" +"Secondes avant que le DNS secondaire demande au DNS primaire le serial pour " +"détecter une modification" + +#: models.py:586 +msgid "" +"Seconds before the secondary DNS ask the serial again in case of a primary " +"DNS timeout" +msgstr "" +"Secondes avant que le DNS secondaire demande le serial de nouveau dans le " +"cas d'un délai d'attente du DNS primaire" + +#: models.py:591 +msgid "" +"Seconds before the secondary DNS stop answering requests in case of primary " +"DNS timeout" +msgstr "" +"Secondes avant que le DNS secondaire arrête de répondre aux requêtes dans le " +"cas d'un délai d'attente du DNS primaire" + +#: models.py:596 models.py:846 +msgid "Time to Live" +msgstr "Temps de vie" + +#: models.py:601 +msgid "Can view an SOA record object" +msgstr "Peut voir un objet enregistrement SOA" + +#: models.py:603 templates/machines/aff_extension.html:36 +#: templates/machines/machine.html:120 +msgid "SOA record" +msgstr "enregistrement SOA" + +#: models.py:604 +msgid "SOA records" +msgstr "enregistrements SOA" + +#: models.py:643 +msgid "SOA to edit" +msgstr "SOA à modifier" + +#: models.py:654 +msgid "Zone name, must begin with a dot (.example.org)" +msgstr "Nom de zone, doit commencer par un point (.example.org)" + +#: models.py:662 +msgid "A record associated with the zone" +msgstr "Enregistrement A associé à la zone" + +#: models.py:668 +msgid "AAAA record associated with the zone" +msgstr "Enregristrement AAAA associé avec la zone" + +#: models.py:677 +msgid "Can view an extension object" +msgstr "Peut voir un objet extension" + +#: models.py:678 +msgid "Can use all extensions" +msgstr "Peut utiliser toutes les extensions" + +#: models.py:680 +msgid "DNS extension" +msgstr "extension DNS" + +#: models.py:681 +msgid "DNS extensions" +msgstr "extensions DNS" + +#: models.py:732 +msgid "An extension must begin with a dot." +msgstr "Une extension doit commencer par un point." + +#: models.py:746 +msgid "Can view an MX record object" +msgstr "Peut voir un objet enregistrement MX" + +#: models.py:748 templates/machines/machine.html:124 +msgid "MX record" +msgstr "enregistrement MX" + +#: models.py:749 +msgid "MX records" +msgstr "enregistrements MX" + +#: models.py:771 +msgid "Can view an NS record object" +msgstr "Peut voir un objet enregistrement NS" + +#: models.py:773 templates/machines/machine.html:128 +msgid "NS record" +msgstr "enregistrement NS" + +#: models.py:774 +msgid "NS records" +msgstr "enregistrements NS" + +#: models.py:793 +msgid "Can view a TXT record object" +msgstr "Peut voir un objet enregistrement TXT" + +#: models.py:795 templates/machines/machine.html:132 +msgid "TXT record" +msgstr "enregistrement TXT" + +#: models.py:796 +msgid "TXT records" +msgstr "enregistrements TXT" + +#: models.py:815 +msgid "Can view a DNAME record object" +msgstr "Peut voir un objet enregistrement DNAME" + +#: models.py:817 templates/machines/machine.html:136 +msgid "DNAME record" +msgstr "enregistrement DNAME" + +#: models.py:818 +msgid "DNAME records" +msgstr "enregistrements DNAME" + +#: models.py:851 +msgid "" +"Priority of the target server (positive integer value, the lower it is, the " +"more the server will be used if available)" +msgstr "" +"Priorité du serveur cible (entier positif, plus il est bas, plus le serveur " +"sera utilisé si disponible)" + +#: models.py:858 +msgid "" +"Relative weight for records with the same priority (integer value between 0 " +"and 65535)" +msgstr "" +"Poids relatif des enregistrements avec la même priorité (entier entre 0 et " +"65535)" + +#: models.py:863 +msgid "TCP/UDP port" +msgstr "Port TCP/UDP" + +#: models.py:868 +msgid "Target server" +msgstr "Serveur cible" + +#: models.py:873 +msgid "Can view an SRV record object" +msgstr "Peut voir un objet enregistrement SRV" + +#: models.py:875 templates/machines/machine.html:140 +msgid "SRV record" +msgstr "enregistrement SRV" + +#: models.py:876 +msgid "SRV records" +msgstr "enregistrements SRV" + +#: models.py:940 +msgid "Can view an SSHFP record object" +msgstr "Peut voir un objet enregistrement SSHFP" + +#: models.py:942 templates/machines/machine.html:144 +msgid "SSHFP record" +msgstr "enregistrement SSHFP" + +#: models.py:943 +msgid "SSHFP records" +msgstr "enregistrements SSHFP" + +#: models.py:981 +msgid "Can view an interface object" +msgstr "Peut voir un objet interface" + +#: models.py:983 +msgid "Can change the owner of an interface" +msgstr "Peut changer l'utilisateur d'une interface" + +#: models.py:985 +msgid "interface" +msgstr "interface" + +#: models.py:986 +msgid "interfaces" +msgstr "interfaces" + +#: models.py:1080 +msgid "The given MAC address is invalid." +msgstr "L'adresse MAC indiquée est invalide." + +#: models.py:1093 +msgid "The selected IP type is invalid." +msgstr "Le type d'IP sélectionné est invalide." + +#: models.py:1106 +msgid "There is no IP address available in the slash." +msgstr "Il n'y a pas d'adresse IP disponible dans le slash." + +#: models.py:1124 +msgid "The IPv4 address and the machine type don't match." +msgstr "L'adresse IPv4 et le type de machine ne correspondent pas." + +#: models.py:1138 +msgid "Nonexistent machine." +msgstr "Machine inexistante." + +#: models.py:1142 +msgid "You can't add a machine." +msgstr "Vous ne pouvez pas ajouter une machine." + +#: models.py:1148 +msgid "" +"You don't have the right to add an interface to a machine of another user." +msgstr "" +"Vous n'avez pas le droit d'ajouter une interface à une machine d'un autre " +"utilisateur." + +#: models.py:1162 +msgid "Permission required to edit the machine." +msgstr "Permission requise pour modifier la machine." + +#: models.py:1206 models.py:1325 models.py:1532 +msgid "You don't have the right to view machines other than yours." +msgstr "Vous n'avez pas le droit de voir d'autres machines que les vôtres." + +#: models.py:1252 +msgid "Can view an IPv6 addresses list object" +msgstr "Peut voir un objet list d'adresses IPv6" + +#: models.py:1253 +msgid "Can change the SLAAC value of an IPv6 addresses list" +msgstr "Peut modifier la valeur SLAAC d'une liste d'adresses IPv6" + +#: models.py:1256 +msgid "IPv6 addresses list" +msgstr "Liste d'adresses IPv6" + +#: models.py:1257 +msgid "IPv6 addresses lists" +msgstr "Listes d'adresses IPv6" + +#: models.py:1269 models.py:1480 +msgid "Nonexistent interface." +msgstr "Interface inexistante." + +#: models.py:1272 models.py:1487 +msgid "You don't have the right to add an alias to a machine of another user." +msgstr "" +"Vous n'avez pas le droit d'ajouter un alias à une machine d'un autre " +"utilisateur." + +#: models.py:1280 +msgid "Permission required to change the SLAAC value of an IPv6 address" +msgstr "Permission requise pour changer la valeur SLAAC d'une adresse IPv6." + +#: models.py:1352 +msgid "A SLAAC IP address is already registered." +msgstr "Une adresse IP SLAAC est déjà enregistrée." + +#: models.py:1357 +msgid "" +"The v6 prefix is incorrect and doesn't match the type associated with the " +"machine." +msgstr "" +"Le préfixe v6 est incorrect et ne correspond pas au type associé à la " +"machine." + +#: models.py:1383 +msgid "Mandatory and unique, must not contain dots." +msgstr "Obligatoire et unique, ne doit pas contenir de points." + +#: models.py:1397 +msgid "Can view a domain object" +msgstr "Peut voir un objet domaine" + +#: models.py:1399 +msgid "domain" +msgstr "domaine" + +#: models.py:1400 +msgid "domains" +msgstr "domaines" + +#: models.py:1422 +msgid "You can't create a both A and CNAME record." +msgstr "Vous ne pouvez pas créer un enregistrement à la fois A et CNAME." + +#: models.py:1425 +msgid "You can't create a CNAME record pointing to itself." +msgstr "Vous ne pouvez pas créer un enregistrement CNAME vers lui-même." + +#: models.py:1433 +#, python-format +msgid "The domain name %s is too long (over 63 characters)." +msgstr "Le nom de domaine %s est trop long (plus de 63 caractères)." + +#: models.py:1436 +#, python-format +msgid "The domain name %s contains forbidden characters." +msgstr "Le nom de domaine %s contient des caractères interdits." + +#: models.py:1454 +msgid "Invalid extension." +msgstr "Extension invalide." + +#: models.py:1495 +#, python-format +msgid "" +"You reached the maximum number of alias that you are allowed to create " +"yourself (%s). " +msgstr "" +"Vous avez atteint le nombre maximal d'alias que vous pouvez créer vous-mêmes " +"(%s)." + +#: models.py:1508 +msgid "You don't have the right to edit an alias of a machine of another user." +msgstr "" +"Vous n'avez pas le droit de modifier un alias d'une machine d'un autre " +"utilisateur." + +#: models.py:1520 +msgid "" +"You don't have the right to delete an alias of a machine of another user." +msgstr "" +"Vous n'avez pas le droit de supprimer un alias d'une machine d'un autre " +"utilisateur." + +#: models.py:1548 +msgid "Can view an IPv4 addresses list object" +msgstr "Peut voir un object liste d'adresses IPv4" + +#: models.py:1550 +msgid "IPv4 addresses list" +msgstr "Liste d'adresses IPv4" + +#: models.py:1551 +msgid "IPv4 addresses lists" +msgstr "Listes d'adresses IPv4" + +#: models.py:1562 +msgid "The IPv4 address and the range of the IP type don't match." +msgstr "L'adresse IPv4 et la plage du type d'IP ne correspondent pas." + +#: models.py:1580 +msgid "DHCP server" +msgstr "Serveur DHCP" + +#: models.py:1581 +msgid "Switches configuration server" +msgstr "Serveur de configuration des commutateurs réseau" + +#: models.py:1582 +msgid "Recursive DNS server" +msgstr "Serveur DNS récursif" + +#: models.py:1583 +msgid "NTP server" +msgstr "Serveur NTP" + +#: models.py:1584 +msgid "RADIUS server" +msgstr "Serveur RADIUS" + +#: models.py:1585 +msgid "Log server" +msgstr "Serveur log" + +#: models.py:1586 +msgid "LDAP master server" +msgstr "Serveur LDAP maître" + +#: models.py:1587 +msgid "LDAP backup server" +msgstr "Serveur LDAP de secours" + +#: models.py:1588 +msgid "SMTP server" +msgstr "Serveur SMTP" + +#: models.py:1589 +msgid "postgreSQL server" +msgstr "Serveur postgreSQL" + +#: models.py:1590 +msgid "mySQL server" +msgstr "Serveur mySQL" + +#: models.py:1591 +msgid "SQL client" +msgstr "Client SQL" + +#: models.py:1592 +msgid "Gateway" +msgstr "Passerelle" + +#: models.py:1606 +msgid "Can view a role object" +msgstr "Peut voir un objet rôle" + +#: models.py:1608 +msgid "server role" +msgstr "rôle de serveur" + +#: models.py:1609 +msgid "server roles" +msgstr "rôles de serveur" + +#: models.py:1650 +msgid "Minimal time before regeneration of the service." +msgstr "Temps minimal avant régénération du service." + +#: models.py:1654 +msgid "Maximal time before regeneration of the service." +msgstr "Temps maximal avant régénération du service." + +#: models.py:1660 +msgid "Can view a service object" +msgstr "Peut voir un objet service" + +#: models.py:1662 +msgid "service to generate (DHCP, DNS, ...)" +msgstr "service à générer (DHCP, DNS, ...)" + +#: models.py:1663 +msgid "services to generate (DHCP, DNS, ...)" +msgstr "services à générer (DHCP, DNS, ...)" + +#: models.py:1709 +msgid "Can view a service server link object" +msgstr "Peut voir un objet lien service serveur" + +#: models.py:1711 +msgid "link between service and server" +msgstr "lien entre service et serveur" + +#: models.py:1712 +msgid "links between service and server" +msgstr "liens entre service et serveur" + +#: models.py:1754 +msgid "Name of the ports configuration" +msgstr "Nom de la configuration de ports" + +#: models.py:1760 +msgid "Can view a ports opening list object" +msgstr "Peut voir un objet liste d'ouverture de ports" + +#: models.py:1763 +msgid "ports opening list" +msgstr "liste d'ouverture de ports" + +#: models.py:1764 +msgid "ports opening lists" +msgstr "listes d'ouverture de ports" + +#: models.py:1773 +msgid "You don't have the right to delete a ports opening list." +msgstr "Vous n'avez pas le droit de supprimer une liste d'ouverture de ports." + +#: models.py:1776 +msgid "This ports opening list is used." +msgstr "Cette liste d'ouverture de ports est utilisée." + +#: models.py:1849 +msgid "ports opening" +msgstr "ouverture de ports" + +#: models.py:1850 +msgid "ports openings" +msgstr "ouvertures de ports" + +#: templates/machines/aff_alias.html:32 +msgid "Aliases" +msgstr "Alias" + +#: templates/machines/aff_dname.html:30 +msgid "Target zone" +msgstr "Cible" + +#: templates/machines/aff_dname.html:31 templates/machines/aff_mx.html:34 +#: templates/machines/aff_txt.html:33 +msgid "Record" +msgstr "Enregistrement" + +#: templates/machines/aff_extension.html:34 +#: templates/machines/aff_iptype.html:36 templates/machines/aff_srv.html:34 +#: templates/machines/machine.html:116 +msgid "Extension" +msgstr "Extension" + +#: templates/machines/aff_extension.html:35 +#: templates/machines/aff_iptype.html:37 +msgid "'infra' right required" +msgstr "droit 'infra' requis" + +#: templates/machines/aff_iptype.html:38 +msgid "IPv4 range" +msgstr "Plage IPv4" + +#: templates/machines/aff_iptype.html:39 +msgid "v6 prefix" +msgstr "Préfixe v6" + +#: templates/machines/aff_iptype.html:40 +msgid "DNSSEC reverse v4/v6" +msgstr "DNSSEC inverse v4/v6" + +#: templates/machines/aff_iptype.html:41 +msgid "On VLAN(s)" +msgstr "Sur VLAN(s)" + +#: templates/machines/aff_iptype.html:42 +msgid "Default ports opening" +msgstr "Ouverture de ports par défaut" + +#: templates/machines/aff_ipv6.html:32 +msgid "IPv6 addresses" +msgstr "Adresses IPv6" + +#: templates/machines/aff_ipv6.html:33 +msgid "SLAAC" +msgstr "SLAAC" + +#: templates/machines/aff_machines.html:43 +msgid "DNS name" +msgstr "Nom DNS" + +#: templates/machines/aff_machines.html:45 +msgid "Type" +msgstr "Type" + +#: templates/machines/aff_machines.html:47 +msgid "IP address" +msgstr "Adresse IP" + +#: templates/machines/aff_machines.html:48 +msgid "Actions" +msgstr "Actions" + +#: templates/machines/aff_machines.html:53 +msgid "No name" +msgstr "Sans nom" + +#: templates/machines/aff_machines.html:54 +msgid "View the profile" +msgstr "Voir le profil" + +#: templates/machines/aff_machines.html:62 views.py:375 +msgid "Create an interface" +msgstr "Créer une interface" + +#: templates/machines/aff_machines.html:77 +msgid "Display the aliases" +msgstr "Afficher les alias" + +#: templates/machines/aff_machines.html:95 +msgid "Display the IPv6 address" +msgstr "Afficher les adresses IPv6" + +#: templates/machines/aff_machines.html:110 +msgid " Edit" +msgstr " Modifier" + +#: templates/machines/aff_machines.html:118 +msgid " Manage the aliases" +msgstr " Gérer les alias" + +#: templates/machines/aff_machines.html:126 +msgid " Manage the IPv6 addresses" +msgstr " Gérer les adresses IPv6" + +#: templates/machines/aff_machines.html:134 +msgid " Manage the SSH fingerprints" +msgstr " Gérer les empreintes SSH" + +#: templates/machines/aff_machines.html:142 +msgid " Manage the ports configuration" +msgstr " Gérer les configuration de ports" + +#: templates/machines/aff_machinetype.html:33 +msgid "Matching IP type" +msgstr "Type d'IP correspondant" + +#: templates/machines/aff_mx.html:32 templates/machines/aff_ns.html:32 +#: templates/machines/aff_txt.html:32 +msgid "Concerned zone" +msgstr "Zone concernée" + +#: templates/machines/aff_mx.html:33 templates/machines/aff_srv.html:36 +msgid "Priority" +msgstr "Priorité" + +#: templates/machines/aff_nas.html:33 templates/machines/aff_soa.html:32 +#: templates/machines/aff_vlan.html:34 +#: templates/machines/index_portlist.html:18 +msgid "Name" +msgstr "Nom" + +#: templates/machines/aff_nas.html:34 +msgid "NAS device type" +msgstr "Type de dispositif NAS" + +#: templates/machines/aff_nas.html:35 +msgid "Machine type linked to the NAS device" +msgstr "Type de machine lié au dispositif NAS" + +#: templates/machines/aff_nas.html:36 +msgid "Access mode" +msgstr "Mode d'accès" + +#: templates/machines/aff_nas.html:37 +msgid "MAC address auto capture" +msgstr "Capture automatique de l'adresse MAC" + +#: templates/machines/aff_ns.html:33 +msgid "Authoritarian interface for the concerned zone" +msgstr "Interface authoritaire pour la zone concernée" + +#: templates/machines/aff_role.html:33 +msgid "Role name" +msgstr "Nom du rôle" + +#: templates/machines/aff_role.html:34 +msgid "Specific role" +msgstr "Rôle spécifique" + +#: templates/machines/aff_role.html:35 +msgid "Servers" +msgstr "Serveurs" + +#: templates/machines/aff_servers.html:31 +#: templates/machines/aff_service.html:32 +msgid "Service name" +msgstr "Nom du service" + +#: templates/machines/aff_servers.html:32 +msgid "Server" +msgstr "Serveur" + +#: templates/machines/aff_servers.html:33 +msgid "Last regeneration" +msgstr "Dernière régénération" + +#: templates/machines/aff_servers.html:34 +msgid "Regeneration required" +msgstr "Régénération requise" + +#: templates/machines/aff_servers.html:35 +msgid "Regeneration activated" +msgstr "Régénération activée" + +#: templates/machines/aff_service.html:33 +msgid "Minimal time before regeneration" +msgstr "Temps minimal avant régénération" + +#: templates/machines/aff_service.html:34 +msgid "Maximal time before regeneration" +msgstr "Temps maximal avant régénération" + +#: templates/machines/aff_service.html:35 +msgid "Included servers" +msgstr "Serveurs inclus" + +#: templates/machines/aff_service.html:36 +msgid "Ask for regeneration" +msgstr "Demander la régénération" + +#: templates/machines/aff_soa.html:33 +msgid "Mail" +msgstr "Mail" + +#: templates/machines/aff_soa.html:34 +msgid "Refresh" +msgstr "Rafraichissement" + +#: templates/machines/aff_soa.html:35 +msgid "Retry" +msgstr "Relance" + +#: templates/machines/aff_soa.html:36 +msgid "Expire" +msgstr "Expiration" + +#: templates/machines/aff_soa.html:37 templates/machines/aff_srv.html:35 +msgid "TTL" +msgstr "Temps de vie" + +#: templates/machines/aff_srv.html:32 templates/machines/machine.html:152 +msgid "Service" +msgstr "Service" + +#: templates/machines/aff_srv.html:33 +msgid "Protocol" +msgstr "Protocole" + +#: templates/machines/aff_srv.html:37 +msgid "Weight" +msgstr "Poids" + +#: templates/machines/aff_srv.html:38 +msgid "Port" +msgstr "Port" + +#: templates/machines/aff_srv.html:39 +msgid "Target" +msgstr "Cible" + +#: templates/machines/aff_sshfp.html:31 +msgid "SSH public key" +msgstr "Clé publique SSH" + +#: templates/machines/aff_sshfp.html:32 +msgid "Algorithm used" +msgstr "Algorithme utilisé" + +#: templates/machines/aff_sshfp.html:33 templates/machines/aff_vlan.html:35 +msgid "Comment" +msgstr "Commentaire" + +#: templates/machines/aff_vlan.html:33 +msgid "ID" +msgstr "ID" + +#: templates/machines/aff_vlan.html:36 templates/machines/sidebar.html:51 +msgid "IP ranges" +msgstr "Plages d'IP" + +#: templates/machines/delete.html:29 +msgid "Creation and editing of machines" +msgstr "Création et modification de machines" + +#: templates/machines/delete.html:35 +#, python-format +msgid "" +"Warning: are you sure you want to delete this object %(objet_name)s " +"( %(objet)s )?" +msgstr "" +"Attention : voulez-vous vraiment supprimer cet objet %(objet_name)s " +"( %(objet)s ) ?" + +#: templates/machines/delete.html:36 +msgid "Confirm" +msgstr "Confirmer" + +#: templates/machines/edit_portlist.html:29 templates/machines/index.html:29 +#: templates/machines/index.html:32 templates/machines/index_alias.html:29 +#: templates/machines/index_extension.html:31 +#: templates/machines/index_iptype.html:31 +#: templates/machines/index_ipv6.html:30 +#: templates/machines/index_machinetype.html:31 +#: templates/machines/index_nas.html:31 +#: templates/machines/index_portlist.html:8 +#: templates/machines/index_portlist.html:23 +#: templates/machines/index_role.html:30 +#: templates/machines/index_service.html:30 +#: templates/machines/index_sshfp.html:28 templates/machines/index_vlan.html:31 +#: templates/machines/machine.html:31 templates/machines/sidebar.html:33 +msgid "Machines" +msgstr "Machines" + +#: templates/machines/edit_portlist.html:50 +msgid "Add a port" +msgstr "Ajouter un port" + +#: templates/machines/edit_portlist.html:53 +msgid "Create or edit" +msgstr "Créer ou modifier" + +#: templates/machines/index_alias.html:32 +msgid "List of the aliases of the interface" +msgstr "Liste des alias de l'interface" + +#: templates/machines/index_alias.html:33 +msgid " Add an alias" +msgstr " Ajouter un alias" + +#: templates/machines/index_alias.html:34 +msgid " Delete one or several aliases" +msgstr " Supprimer un ou plusieurs alias" + +#: templates/machines/index_extension.html:34 +msgid "List of extensions" +msgstr "Liste des extensions" + +#: templates/machines/index_extension.html:36 +msgid " Add an extension" +msgstr " Ajouter une extension" + +#: templates/machines/index_extension.html:38 +msgid " Delete one or several extensions" +msgstr " Supprimer une ou plusieurs extensions" + +#: templates/machines/index_extension.html:41 +msgid "List of SOA records" +msgstr "Liste des enregistrements SOA" + +#: templates/machines/index_extension.html:43 +msgid " Add an SOA record" +msgstr " Ajouter un enregistrement SOA" + +#: templates/machines/index_extension.html:45 +msgid " Delete one or several SOA records" +msgstr " Supprimer un ou plusieurs enregistrements SOA" + +#: templates/machines/index_extension.html:48 +msgid "List of MX records" +msgstr "Liste des enregistrements MX" + +#: templates/machines/index_extension.html:50 +msgid " Add an MX record" +msgstr " Ajouter un enregistrement MX" + +#: templates/machines/index_extension.html:52 +msgid " Delete one or several MX records" +msgstr " Supprimer un ou plusieurs enregistrements MX" + +#: templates/machines/index_extension.html:55 +msgid "List of NS records" +msgstr "Liste des enregistrements NS" + +#: templates/machines/index_extension.html:57 +msgid " Add an NS record" +msgstr " Ajouter un enregistrement NS" + +#: templates/machines/index_extension.html:59 +msgid " Delete one or several NS records" +msgstr " Supprimer un ou plusieurs enregistrements NS" + +#: templates/machines/index_extension.html:62 +msgid "List of TXT records" +msgstr "Liste des enregistrements TXT" + +#: templates/machines/index_extension.html:64 +msgid " Add a TXT record" +msgstr " Ajouter un enregistrement TXT" + +#: templates/machines/index_extension.html:66 +msgid " Delete one or several TXT records" +msgstr " Supprimer un ou plusieurs enregistrements TXT" + +#: templates/machines/index_extension.html:69 +msgid "List of DNAME records" +msgstr "Liste des enregistrements DNAME" + +#: templates/machines/index_extension.html:72 +msgid " Add a DNAME record" +msgstr " Ajouter un enregistrement DNAME" + +#: templates/machines/index_extension.html:76 +msgid " Delete one or several DNAME records" +msgstr " Supprimer un ou plusieurs enregistrements DNAME" + +#: templates/machines/index_extension.html:80 +msgid "List of SRV records" +msgstr "Liste des enregistrements SRV" + +#: templates/machines/index_extension.html:82 +msgid " Add an SRV record" +msgstr " Ajouter un enregistrement SRV" + +#: templates/machines/index_extension.html:84 +msgid " Delete one or several SRV records" +msgstr " Supprimer un ou plusieurs enregistrements SRV" + +#: templates/machines/index_iptype.html:34 +msgid "List of IP types" +msgstr "Liste des types d'IP" + +#: templates/machines/index_iptype.html:36 +msgid " Add an IP type" +msgstr " Ajouter un type d'IP" + +#: templates/machines/index_iptype.html:38 +msgid " Delete one or several IP types" +msgstr " Supprimer un ou plusieurs types d'IP" + +#: templates/machines/index_ipv6.html:33 +msgid "List of the IPv6 addresses of the interface" +msgstr "Liste des adresses IPv6 de l'interface" + +#: templates/machines/index_ipv6.html:35 +msgid " Add an IPv6 address" +msgstr " Ajouter une adresse IPv6" + +#: templates/machines/index_machinetype.html:34 +msgid "List of machine types" +msgstr "Liste des types de machine" + +#: templates/machines/index_machinetype.html:36 +msgid " Add a machine type" +msgstr " Ajouter un type de machine" + +#: templates/machines/index_machinetype.html:38 +msgid " Delete one or several machine types" +msgstr " Supprimer un ou plusieurs types de machine" + +#: templates/machines/index_nas.html:34 +msgid "List of NAS devices" +msgstr "Liste des dispositifs NAS" + +#: templates/machines/index_nas.html:35 +msgid "" +"The NAS device type and machine type are linked. It is useful for MAC " +"address auto capture by RADIUS, and allows to choose the machine type to " +"assign to the machines according to the NAS device type." +msgstr "" +"Le type de dispositif NAS et le type de machine sont liés. C'est utile pour " +"la capture automatique de l'adresse MAC par RADIUS, et permet de choisir le " +"type de machine à assigner aux machines en fonction du type de dispositif " +"NAS." + +#: templates/machines/index_nas.html:37 +msgid " Add a NAS device type" +msgstr " Ajouter un type de dispositif NAS" + +#: templates/machines/index_nas.html:39 +msgid " Delete one or several NAS device types" +msgstr " Supprimer un ou plusieurs types de dispositif NAS" + +#: templates/machines/index_portlist.html:11 +msgid "List of ports configurations" +msgstr "Liste des configurations de ports" + +#: templates/machines/index_portlist.html:13 +msgid " Add a configuration" +msgstr " Ajouter une configuration" + +#: templates/machines/index_portlist.html:19 +msgid "TCP (input)" +msgstr "TCP (entrée)" + +#: templates/machines/index_portlist.html:20 +msgid "TCP (output)" +msgstr "TCP (sortie)" + +#: templates/machines/index_portlist.html:21 +msgid "UDP (input)" +msgstr "UDP (entrée)" + +#: templates/machines/index_portlist.html:22 +msgid "UDP (output)" +msgstr "UDP (sortie)" + +#: templates/machines/index_role.html:33 +msgid "List of roles" +msgstr "Liste des rôles" + +#: templates/machines/index_role.html:35 +msgid " Add a role" +msgstr " Ajouter un rôle" + +#: templates/machines/index_role.html:37 +msgid " Delete one or several roles" +msgstr " Supprimer un ou plusieurs rôles" + +#: templates/machines/index_service.html:33 +msgid "List of services" +msgstr "Liste des services" + +#: templates/machines/index_service.html:35 +msgid " Add a service" +msgstr " Ajouter un service" + +#: templates/machines/index_service.html:37 +msgid " Delete one or several services" +msgstr " Supprimer un ou plusieurs services" + +#: templates/machines/index_service.html:39 +msgid "States of servers" +msgstr "États des serveurs" + +#: templates/machines/index_sshfp.html:31 +msgid "SSH fingerprints" +msgstr "Empreintes SSH" + +#: templates/machines/index_sshfp.html:34 +msgid " Add an SSH fingerprint" +msgstr " Ajouter une empreinte SSH" + +#: templates/machines/index_vlan.html:34 +msgid "List of VLANs" +msgstr "Liste des VLANs" + +#: templates/machines/index_vlan.html:36 +msgid " Add a VLAN" +msgstr " Ajouter un VLAN" + +#: templates/machines/index_vlan.html:38 +msgid " Delete one or several VLANs" +msgstr " Supprimer un ou plusieurs VLANs" + +#: templates/machines/machine.html:92 +msgid "Machine" +msgstr "Machine" + +#: templates/machines/machine.html:96 +msgid "Interface" +msgstr "Interface" + +#: templates/machines/machine.html:104 +msgid "Domain" +msgstr "Domaine" + +#: templates/machines/machine.html:148 +msgid "Alias" +msgstr "Alias" + +#: templates/machines/machine.html:168 +msgid "IPv6 address" +msgstr "Adresse IPv6" + +#: templates/machines/sidebar.html:39 +msgid "Machine types" +msgstr "Types de machine" + +#: templates/machines/sidebar.html:45 +msgid "Extensions and zones" +msgstr "Extensions et zones" + +#: templates/machines/sidebar.html:69 +msgid "Services (DHCP, DNS, ...)" +msgstr "Services (DHCP, DNS, ...)" + +#: templates/machines/sidebar.html:75 +msgid "Server roles" +msgstr "Rôles de serveur" + +#: templates/machines/sidebar.html:81 +msgid "Ports openings" +msgstr "Ouvertures de ports" + +#: views.py:156 +msgid "Select a machine type first.}," +msgstr "Sélectionnez un type de machine d'abord.}," + +#: views.py:258 +msgid "The machine was created." +msgstr "La machine a été créée." + +#: views.py:270 +msgid "Create a machine" +msgstr "Créer une machine" + +#: views.py:310 +msgid "The machine was edited." +msgstr "La machine a été modifiée." + +#: views.py:322 views.py:446 views.py:512 views.py:568 views.py:630 +#: views.py:691 views.py:749 views.py:806 views.py:863 views.py:919 +#: views.py:977 views.py:1034 views.py:1106 views.py:1169 views.py:1226 +#: views.py:1292 views.py:1349 +msgid "Edit" +msgstr "Modifier" + +#: views.py:335 +msgid "The machine was deleted." +msgstr "La machine a été supprimée." + +#: views.py:364 +msgid "The interface was created." +msgstr "L'interface a été créée." + +#: views.py:391 +msgid "The interface was deleted." +msgstr "L'interface a été supprimée." + +#: views.py:416 +msgid "The IPv6 addresses list was created." +msgstr "La liste d'adresses IPv6 a été créée." + +#: views.py:422 +msgid "Create an IPv6 addresses list" +msgstr "Créer une liste d'adresses IPv6" + +#: views.py:440 +msgid "The IPv6 addresses list was edited." +msgstr "La liste d'adresses IPv6 a été modifiée." + +#: views.py:459 +msgid "The IPv6 addresses list was deleted." +msgstr "La liste d'adresses IPv6 a été supprimée." + +#: views.py:483 +msgid "The SSHFP record was created." +msgstr "L'enregistrement SSHFP a été créé." + +#: views.py:489 +msgid "Create a SSHFP record" +msgstr "Créer un enregistrement SSHFP" + +#: views.py:506 +msgid "The SSHFP record was edited." +msgstr "L'enregistrement SSHFP a été modifié." + +#: views.py:525 +msgid "The SSHFP record was deleted." +msgstr "L'enregistrement SSHFP a été supprimé." + +#: views.py:546 +msgid "The IP type was created." +msgstr "Le type d'IP a été créé." + +#: views.py:549 +msgid "Create an IP type" +msgstr "Créer un type d'IP" + +#: views.py:565 +msgid "The IP type was edited." +msgstr "Le type d'IP a été modifié." + +#: views.py:584 +msgid "The IP type was deleted." +msgstr "Le type d'IP a été supprimé." + +#: views.py:588 +#, python-format +msgid "" +"The IP type %s is assigned to at least one machine, you can't delete it." +msgstr "" +"Le type d'IP %s est assigné à au moins une machine, vous ne pouvez pas le " +"supprimer." + +#: views.py:593 views.py:655 views.py:716 views.py:773 views.py:830 +#: views.py:887 views.py:944 views.py:1001 views.py:1058 views.py:1136 +#: views.py:1193 views.py:1250 views.py:1316 views.py:1373 +msgid "Delete" +msgstr "Supprimer" + +#: views.py:606 +msgid "The machine type was created." +msgstr "Le type de machine a été créé." + +#: views.py:609 +msgid "Create a machine type" +msgstr "Créer un type de machine" + +#: views.py:627 +msgid "The machine type was edited." +msgstr "Le type de machine a été modifié." + +#: views.py:646 +msgid "The machine type was deleted." +msgstr "Le type de machine a été supprimé." + +#: views.py:650 +#, python-format +msgid "" +"The machine type %s is assigned to at least one machine, you can't delete it." +msgstr "" +"Le type de machine %s est assigné à au moins un machine, vous ne pouvez pas " +"le supprimer." + +#: views.py:668 +msgid "The extension was created." +msgstr "L'extension a été créée." + +#: views.py:671 +msgid "Create an extension" +msgstr "Créer une extension" + +#: views.py:688 +msgid "The extension was edited." +msgstr "L'extension a été modifiée." + +#: views.py:707 +msgid "The extension was deleted." +msgstr "L'extension a été supprimée." + +#: views.py:711 +#, python-format +msgid "" +"The extension %s is assigned to at least one machine type, you can't delete " +"it." +msgstr "" +"L'extension %s est assignée à au moins un type de machine, vous ne pouvez " +"pas le supprimer." + +#: views.py:729 +msgid "The SOA record was created." +msgstr "L'enregistrement SOA a été créé." + +#: views.py:732 +msgid "Create an SOA record" +msgstr "Créer un enregistrement SOA" + +#: views.py:746 +msgid "The SOA record was edited." +msgstr "L'enregistrement SOA a été modifié." + +#: views.py:765 +msgid "The SOA record was deleted." +msgstr "L'enregistrement SOA a été supprimé." + +#: views.py:769 +#, python-format +msgid "Error: the SOA record %s can't be deleted." +msgstr "Erreur : l'enregistrement SOA %s ne peut pas être supprimé." + +#: views.py:786 +msgid "The MX record was created." +msgstr "L'enregistrement MX a été créé." + +#: views.py:789 +msgid "Create an MX record" +msgstr "Créer un enregistrement MX" + +#: views.py:803 +msgid "The MX record was edited." +msgstr "L'enregistrement MX a été modifié." + +#: views.py:822 +msgid "The MX record was deleted." +msgstr "L'enregistrement MX a été supprimé." + +#: views.py:826 +#, python-format +msgid "Error: the MX record %s can't be deleted." +msgstr "Erreur : l'enregistrement MX %s ne peut pas être supprimé." + +#: views.py:843 +msgid "The NS record was created." +msgstr "L'enregistrement NS a été créé." + +#: views.py:846 +msgid "Create an NS record" +msgstr "Créer un enregistrement NS" + +#: views.py:860 +msgid "The NS record was edited." +msgstr "L'enregistrement NS a été modifié." + +#: views.py:879 +msgid "The NS record was deleted." +msgstr "L'enregistrement NS a été supprimé." + +#: views.py:883 +#, python-format +msgid "Error: the NS record %s can't be deleted." +msgstr "Erreur : l'enregistrement NS %s ne peut pas être supprimé." + +#: views.py:899 +msgid "The DNAME record was created." +msgstr "L'enregistrement DNAME a été créé." + +#: views.py:902 +msgid "Create a DNAME record" +msgstr "Créer un enregistrement DNAME" + +#: views.py:916 +msgid "The DNAME record was edited." +msgstr "L'enregistrement DNAME a été modifié." + +#: views.py:935 +msgid "The DNAME record was deleted." +msgstr "L'enregistrement DNAME a été supprimé." + +#: views.py:939 +#, python-format +msgid "Error: the DNAME record %s can't be deleted." +msgstr "Erreur : l'enregistrement DNAME %s ne peut pas être supprimé." + +#: views.py:957 +msgid "The TXT record was created." +msgstr "L'enregistrement TXT a été créé." + +#: views.py:960 +msgid "Create a TXT record" +msgstr "Créer un enregistrement TXT" + +#: views.py:974 +msgid "The TXT record was edited." +msgstr "L'enregistrement TXT a été modifié." + +#: views.py:993 +msgid "The TXT record was deleted." +msgstr "L'enregistrement TXT a été supprimé." + +#: views.py:997 +#, python-format +msgid "Error: the TXT record %s can't be deleted." +msgstr "Erreur : l'enregistrement %s ne peut pas être supprimé." + +#: views.py:1014 +msgid "The SRV record was created." +msgstr "L'enregistrement SRV a été créé." + +#: views.py:1017 +msgid "Create an SRV record" +msgstr "Créer un enregistrement SRV" + +#: views.py:1031 +msgid "The SRV record was edited." +msgstr "L'enregistrement SRV a été modifié." + +#: views.py:1050 +msgid "The SRV record was deleted." +msgstr "L'enregistrement SRV a été supprimé." + +#: views.py:1054 +#, python-format +msgid "Error: the SRV record %s can't be deleted." +msgstr "Erreur : l'enregistrement SRV %s ne peut pas être supprimé." + +#: views.py:1074 +msgid "The alias was created." +msgstr "L'alias a été créé." + +#: views.py:1080 +msgid "Create an alias" +msgstr "Créer un alias" + +#: views.py:1098 +msgid "The alias was edited." +msgstr "L'alias a été modifié." + +#: views.py:1124 +#, python-format +msgid "The alias %s was deleted." +msgstr "L'alias %s a été supprimé." + +#: views.py:1129 +#, python-format +msgid "Error: the alias %s can't be deleted." +msgstr "Erreur : l'alias %s ne peut pas être supprimé." + +#: views.py:1149 +msgid "The role was created." +msgstr "Le rôle a été créé." + +#: views.py:1152 +msgid "Create a role" +msgstr "Créer un rôle" + +#: views.py:1166 +msgid "The role was edited." +msgstr "Le rôle a été modifié." + +#: views.py:1185 +msgid "The role was deleted." +msgstr "Le rôle a été supprimé." + +#: views.py:1189 +#, python-format +msgid "Error: the role %s can't be deleted." +msgstr "Erreur : le rôle %s ne peut pas être supprimé." + +#: views.py:1206 +msgid "The service was created." +msgstr "Le service a été créé." + +#: views.py:1209 +msgid "Create a service" +msgstr "Créer un service" + +#: views.py:1223 +msgid "The service was edited." +msgstr "Le service a été modifié." + +#: views.py:1242 +msgid "The service was deleted." +msgstr "Le service a été supprimé." + +#: views.py:1246 +#, python-format +msgid "Error: the service %s can't be deleted." +msgstr "Erreur : le service %s ne peut pas être supprimé." + +#: views.py:1272 +msgid "The VLAN was created." +msgstr "Le VLAN a été créé." + +#: views.py:1275 +msgid "Create a VLAN" +msgstr "Créer un VLAN" + +#: views.py:1289 +msgid "The VLAN was edited." +msgstr "Le VLAN a été modifié." + +#: views.py:1308 +msgid "The VLAN was deleted." +msgstr "Le VLAN a été supprimé." + +#: views.py:1312 +#, python-format +msgid "Error: the VLAN %s can't be deleted." +msgstr "Erreur : le VLAN %s ne peut pas être supprimé." + +#: views.py:1329 +msgid "The NAS device was created." +msgstr "Le dispositif NAS a été créé." + +#: views.py:1332 +msgid "Create a NAS device" +msgstr "Créer un dispositif NAS" + +#: views.py:1346 +msgid "The NAS device was edited." +msgstr "Le dispositif NAS a été modifié." + +#: views.py:1365 +msgid "The NAS device was deleted." +msgstr "Le dispositif NAS a été supprimé." + +#: views.py:1369 +#, python-format +msgid "Error: the NAS device %s can't be deleted." +msgstr "Erreur : le dispositif NAS %s ne peut pas être supprimé." + +#: views.py:1625 +msgid "The ports list was edited." +msgstr "La liste de ports a été modifiée." + +#: views.py:1639 +msgid "The ports list was deleted." +msgstr "La liste de ports a été supprimée." + +#: views.py:1664 +msgid "The ports list was created." +msgstr "La liste de ports a été créée." + +#: views.py:1682 +msgid "Warning: the IPv4 isn't public, the opening won't have effect in v4." +msgstr "" +"Attention : l'adresse IPv4 n'est pas publique, l'ouverture n'aura pas " +"d'effet en v4." + +#: views.py:1692 +msgid "The ports configuration was edited." +msgstr "La configuration de ports a été modifiée." + +#: views.py:1695 +msgid "Edit the configuration" +msgstr "Modifier la configuration" diff --git a/machines/migrations/0094_auto_20180815_1918.py b/machines/migrations/0094_auto_20180815_1918.py new file mode 100644 index 00000000..775ac2c7 --- /dev/null +++ b/machines/migrations/0094_auto_20180815_1918.py @@ -0,0 +1,221 @@ +# -*- coding: utf-8 -*- +# Generated by Django 1.10.7 on 2018-08-15 17:18 +from __future__ import unicode_literals + +import datetime +import django.core.validators +from django.db import migrations, models +import django.db.models.deletion + + +class Migration(migrations.Migration): + + dependencies = [ + ('machines', '0093_auto_20180807_1115'), + ] + + operations = [ + migrations.AlterModelOptions( + name='dname', + options={'permissions': (('view_dname', 'Can view a DNAME record object'),), 'verbose_name': 'DNAME record', 'verbose_name_plural': 'DNAME records'}, + ), + migrations.AlterModelOptions( + name='domain', + options={'permissions': (('view_domain', 'Can view a domain object'),), 'verbose_name': 'domain', 'verbose_name_plural': 'domains'}, + ), + migrations.AlterModelOptions( + name='extension', + options={'permissions': (('view_extension', 'Can view an extension object'), ('use_all_extension', 'Can use all extensions')), 'verbose_name': 'DNS extension', 'verbose_name_plural': 'DNS extensions'}, + ), + migrations.AlterModelOptions( + name='interface', + options={'permissions': (('view_interface', 'Can view an interface object'), ('change_interface_machine', 'Can change the owner of an interface')), 'verbose_name': 'interface', 'verbose_name_plural': 'interfaces'}, + ), + migrations.AlterModelOptions( + name='iplist', + options={'permissions': (('view_iplist', 'Can view an IPv4 addresses list object'),), 'verbose_name': 'IPv4 addresses list', 'verbose_name_plural': 'IPv4 addresses lists'}, + ), + migrations.AlterModelOptions( + name='iptype', + options={'permissions': (('view_iptype', 'Can view an IP type object'), ('use_all_iptype', 'Can use all IP types')), 'verbose_name': 'IP type', 'verbose_name_plural': 'IP types'}, + ), + migrations.AlterModelOptions( + name='ipv6list', + options={'permissions': (('view_ipv6list', 'Can view an IPv6 addresses list object'), ('change_ipv6list_slaac_ip', 'Can change the SLAAC value of an IPv6 addresses list')), 'verbose_name': 'IPv6 addresses list', 'verbose_name_plural': 'IPv6 addresses lists'}, + ), + migrations.AlterModelOptions( + name='machine', + options={'permissions': (('view_machine', 'Can view a machine object'), ('change_machine_user', 'Can change the user of a machine')), 'verbose_name': 'machine', 'verbose_name_plural': 'machines'}, + ), + migrations.AlterModelOptions( + name='machinetype', + options={'permissions': (('view_machinetype', 'Can view a machine type object'), ('use_all_machinetype', 'Can use all machine types')), 'verbose_name': 'machine type', 'verbose_name_plural': 'machine types'}, + ), + migrations.AlterModelOptions( + name='mx', + options={'permissions': (('view_mx', 'Can view an MX record object'),), 'verbose_name': 'MX record', 'verbose_name_plural': 'MX records'}, + ), + migrations.AlterModelOptions( + name='nas', + options={'permissions': (('view_nas', 'Can view a NAS device object'),), 'verbose_name': 'NAS device', 'verbose_name_plural': 'NAS devices'}, + ), + migrations.AlterModelOptions( + name='ns', + options={'permissions': (('view_ns', 'Can view an NS record object'),), 'verbose_name': 'NS record', 'verbose_name_plural': 'NS records'}, + ), + migrations.AlterModelOptions( + name='ouvertureport', + options={'verbose_name': 'ports openings'}, + ), + migrations.AlterModelOptions( + name='ouvertureportlist', + options={'permissions': (('view_ouvertureportlist', 'Can view a ports opening list object'),), 'verbose_name': 'ports opening list', 'verbose_name_plural': 'ports opening lists'}, + ), + migrations.AlterModelOptions( + name='role', + options={'permissions': (('view_role', 'Can view a role object'),), 'verbose_name': 'server role', 'verbose_name_plural': 'server roles'}, + ), + migrations.AlterModelOptions( + name='service', + options={'permissions': (('view_service', 'Can view a service object'),), 'verbose_name': 'service to generate (DHCP, DNS, ...)', 'verbose_name_plural': 'services to generate (DHCP, DNS, ...)'}, + ), + migrations.AlterModelOptions( + name='service_link', + options={'permissions': (('view_service_link', 'Can view a service server link object'),), 'verbose_name': 'link between service and server', 'verbose_name_plural': 'links between service and server'}, + ), + migrations.AlterModelOptions( + name='soa', + options={'permissions': (('view_soa', 'Can view an SOA record object'),), 'verbose_name': 'SOA record', 'verbose_name_plural': 'SOA records'}, + ), + migrations.AlterModelOptions( + name='srv', + options={'permissions': (('view_srv', 'Can view an SRV record object'),), 'verbose_name': 'SRV record', 'verbose_name_plural': 'SRV records'}, + ), + migrations.AlterModelOptions( + name='sshfp', + options={'permissions': (('view_sshfp', 'Can view an SSHFP record object'),), 'verbose_name': 'SSHFP record', 'verbose_name_plural': 'SSHFP records'}, + ), + migrations.AlterModelOptions( + name='txt', + options={'permissions': (('view_txt', 'Can view a TXT record object'),), 'verbose_name': 'TXT record', 'verbose_name_plural': 'TXT records'}, + ), + migrations.AlterModelOptions( + name='vlan', + options={'permissions': (('view_vlan', 'Can view a VLAN object'),), 'verbose_name': 'VLAN', 'verbose_name_plural': 'VLANs'}, + ), + migrations.AlterField( + model_name='domain', + name='name', + field=models.CharField(help_text='Mandatory and unique, must not contain dots.', max_length=255), + ), + migrations.AlterField( + model_name='extension', + name='name', + field=models.CharField(help_text='Zone name, must begin with a dot (.example.org)', max_length=255, unique=True), + ), + migrations.AlterField( + model_name='extension', + name='origin', + field=models.ForeignKey(blank=True, help_text='A record associated with the zone', null=True, on_delete=django.db.models.deletion.PROTECT, to='machines.IpList'), + ), + migrations.AlterField( + model_name='extension', + name='origin_v6', + field=models.GenericIPAddressField(blank=True, help_text='AAAA record associated with the zone', null=True, protocol='IPv6'), + ), + migrations.AlterField( + model_name='iptype', + name='domaine_ip_netmask', + field=models.IntegerField(default=24, help_text="Netmask for the domain's IPv4 range", validators=[django.core.validators.MaxValueValidator(31), django.core.validators.MinValueValidator(8)]), + ), + migrations.AlterField( + model_name='iptype', + name='domaine_ip_network', + field=models.GenericIPAddressField(blank=True, help_text="Network containing the domain's IPv4 range (optional)", null=True, protocol='IPv4'), + ), + migrations.AlterField( + model_name='iptype', + name='reverse_v4', + field=models.BooleanField(default=False, help_text='Enable reverse DNS for IPv4'), + ), + migrations.AlterField( + model_name='iptype', + name='reverse_v6', + field=models.BooleanField(default=False, help_text='Enable reverse DNS for IPv6'), + ), + migrations.AlterField( + model_name='machine', + name='name', + field=models.CharField(blank=True, help_text='Optional', max_length=255, null=True), + ), + migrations.AlterField( + model_name='ouvertureportlist', + name='name', + field=models.CharField(help_text='Name of the ports configuration', max_length=255), + ), + migrations.AlterField( + model_name='role', + name='specific_role', + field=models.CharField(blank=True, choices=[('dhcp-server', 'DHCP server'), ('switch-conf-server', 'Switches configuration server'), ('dns-recursif-server', 'Recursive DNS server'), ('ntp-server', 'NTP server'), ('radius-server', 'RADIUS server'), ('log-server', 'Log server'), ('ldap-master-server', 'LDAP master server'), ('ldap-backup-server', 'LDAP backup server'), ('smtp-server', 'SMTP server'), ('postgresql-server', 'postgreSQL server'), ('mysql-server', 'mySQL server'), ('sql-client', 'SQL client'), ('gateway', 'Gateway')], max_length=32, null=True), + ), + migrations.AlterField( + model_name='service', + name='min_time_regen', + field=models.DurationField(default=datetime.timedelta(0, 60), help_text='Minimal time before regeneration of the service.'), + ), + migrations.AlterField( + model_name='service', + name='regular_time_regen', + field=models.DurationField(default=datetime.timedelta(0, 3600), help_text='Maximal time before regeneration of the service.'), + ), + migrations.AlterField( + model_name='soa', + name='expire', + field=models.PositiveIntegerField(default=3600000, help_text='Seconds before the secondary DNS stop answering requests in case of primary DNS timeout'), + ), + migrations.AlterField( + model_name='soa', + name='mail', + field=models.EmailField(help_text='Contact email address for the zone', max_length=254), + ), + migrations.AlterField( + model_name='soa', + name='refresh', + field=models.PositiveIntegerField(default=86400, help_text='Seconds before the secondary DNS have to ask the primary DNS serial to detect a modification'), + ), + migrations.AlterField( + model_name='soa', + name='retry', + field=models.PositiveIntegerField(default=7200, help_text='Seconds before the secondary DNS ask the serial again in case of a primary DNS timeout'), + ), + migrations.AlterField( + model_name='soa', + name='ttl', + field=models.PositiveIntegerField(default=172800, help_text='Time to Live'), + ), + migrations.AlterField( + model_name='srv', + name='port', + field=models.PositiveIntegerField(help_text='TCP/UDP port', validators=[django.core.validators.MaxValueValidator(65535)]), + ), + migrations.AlterField( + model_name='srv', + name='priority', + field=models.PositiveIntegerField(default=0, help_text='Priority of the target server (positive integer value, the lower it is, the more the server will be used if available)', validators=[django.core.validators.MaxValueValidator(65535)]), + ), + migrations.AlterField( + model_name='srv', + name='target', + field=models.ForeignKey(help_text='Target server', on_delete=django.db.models.deletion.PROTECT, to='machines.Domain'), + ), + migrations.AlterField( + model_name='srv', + name='ttl', + field=models.PositiveIntegerField(default=172800, help_text='Time to Live'), + ), + migrations.AlterField( + model_name='srv', + name='weight', + field=models.PositiveIntegerField(default=0, help_text='Relative weight for records with the same priority (integer value between 0 and 65535)', validators=[django.core.validators.MaxValueValidator(65535)]), + ), + ] diff --git a/machines/models.py b/machines/models.py index f201f667..4de0b012 100644 --- a/machines/models.py +++ b/machines/models.py @@ -42,8 +42,8 @@ from django.dispatch import receiver from django.forms import ValidationError from django.utils.functional import cached_property from django.utils import timezone -from django.utils.translation import ugettext_lazy as _l from django.core.validators import MaxValueValidator, MinValueValidator +from django.utils.translation import ugettext_lazy as _ from macaddress.fields import MACAddressField @@ -57,12 +57,10 @@ import preferences.models class Machine(RevMixin, FieldPermissionModelMixin, models.Model): """ Class définissant une machine, object parent user, objets fils interfaces""" - PRETTY_NAME = "Machine" - user = models.ForeignKey('users.User', on_delete=models.PROTECT) name = models.CharField( max_length=255, - help_text="Optionnel", + help_text=_("Optional"), blank=True, null=True ) @@ -70,10 +68,12 @@ class Machine(RevMixin, FieldPermissionModelMixin, models.Model): class Meta: permissions = ( - ("view_machine", "Peut voir un objet machine quelquonque"), + ("view_machine", _("Can view a machine object")), ("change_machine_user", - "Peut changer le propriétaire d'une machine"), + _("Can change the user of a machine")), ) + verbose_name = _("machine") + verbose_name_plural = _("machines") @classmethod def get_instance(cls, machineid, *_args, **_kwargs): @@ -106,7 +106,7 @@ class Machine(RevMixin, FieldPermissionModelMixin, models.Model): explanation message. """ return (user_request.has_perm('machines.change_machine_user'), - "Vous ne pouvez pas modifier l'utilisateur de la machine.") + _("You don't have the right to change the machine's user.")) @staticmethod def can_view_all(user_request, *_args, **_kwargs): @@ -115,8 +115,8 @@ class Machine(RevMixin, FieldPermissionModelMixin, models.Model): :param user_request: instance user qui fait l'edition :return: True ou False avec la raison de l'échec le cas échéant""" if not user_request.has_perm('machines.view_machine'): - return False, (u"Vous ne pouvez pas afficher l'ensemble des " - "machines sans permission") + return False, _("You don't have the right to view all the" + " machines.") return True, None @staticmethod @@ -129,7 +129,7 @@ class Machine(RevMixin, FieldPermissionModelMixin, models.Model): try: user = users.models.User.objects.get(pk=userid) except users.models.User.DoesNotExist: - return False, u"Utilisateur inexistant" + return False, _("Nonexistent user.") max_lambdauser_interfaces = (preferences.models.OptionalMachine .get_cached_value( 'max_lambdauser_interfaces' @@ -137,14 +137,14 @@ class Machine(RevMixin, FieldPermissionModelMixin, models.Model): if not user_request.has_perm('machines.add_machine'): if not (preferences.models.OptionalMachine .get_cached_value('create_machine')): - return False, u"Vous ne pouvez pas ajouter une machine" + return False, (_("You don't have the right to add a machine.")) if user != user_request: - return False, (u"Vous ne pouvez pas ajouter une machine à un " - "autre user que vous sans droit") + return False, (_("You don't have the right to add a machine" + " to another user.")) if user.user_interfaces().count() >= max_lambdauser_interfaces: - return False, (u"Vous avez atteint le maximum d'interfaces " - "autorisées que vous pouvez créer vous même " - "(%s) " % max_lambdauser_interfaces) + return False, (_("You reached the maximum number of interfaces" + " that you are allowed to create yourself" + " (%s)." % max_lambdauser_interfaces)) return True, None def can_edit(self, user_request, *args, **kwargs): @@ -160,9 +160,9 @@ class Machine(RevMixin, FieldPermissionModelMixin, models.Model): user_request, *args, **kwargs - )[0]): - return False, (u"Vous ne pouvez pas éditer une machine " - "d'un autre user que vous sans droit") + )[0]): + return False, (_("You don't have the right to edit a machine" + " of another user.")) return True, None def can_delete(self, user_request, *args, **kwargs): @@ -178,9 +178,9 @@ class Machine(RevMixin, FieldPermissionModelMixin, models.Model): user_request, *args, **kwargs - )[0]): - return False, (u"Vous ne pouvez pas éditer une machine " - "d'un autre user que vous sans droit") + )[0]): + return False, _("You don't have the right to delete a machine" + " of another user.") return True, None def can_view(self, user_request, *_args, **_kwargs): @@ -191,8 +191,8 @@ class Machine(RevMixin, FieldPermissionModelMixin, models.Model): :return: True ou False avec la raison de l'échec le cas échéant""" if (not user_request.has_perm('machines.view_machine') and self.user != user_request): - return False, (u"Vous n'avez pas droit de voir les machines autre " - "que les vôtres") + return False, _("You don't have the right to view other machines" + " than yours.") return True, None @cached_property @@ -228,8 +228,6 @@ class Machine(RevMixin, FieldPermissionModelMixin, models.Model): class MachineType(RevMixin, AclMixin, models.Model): """ Type de machine, relié à un type d'ip, affecté aux interfaces""" - PRETTY_NAME = "Type de machine" - type = models.CharField(max_length=255) ip_type = models.ForeignKey( 'IpType', @@ -240,10 +238,11 @@ class MachineType(RevMixin, AclMixin, models.Model): class Meta: permissions = ( - ("view_machinetype", "Peut voir un objet machinetype"), - ("use_all_machinetype", - "Peut utiliser n'importe quel type de machine"), + ("view_machinetype", _("Can view a machine type object")), + ("use_all_machinetype", _("Can use all machine types")), ) + verbose_name = _("machine type") + verbose_name_plural = _("machine types") def all_interfaces(self): """ Renvoie toutes les interfaces (cartes réseaux) de type @@ -261,8 +260,8 @@ class MachineType(RevMixin, AclMixin, models.Model): message is acces is not allowed. """ if not user_request.has_perm('machines.use_all_machinetype'): - return False, (u"Vous n'avez pas le droit d'utiliser tout types " - "de machines") + return False, (_("You don't have the right to use all machine" + " types.")) return True, None def __str__(self): @@ -271,8 +270,6 @@ class MachineType(RevMixin, AclMixin, models.Model): class IpType(RevMixin, AclMixin, models.Model): """ Type d'ip, définissant un range d'ip, affecté aux machine types""" - PRETTY_NAME = "Type d'ip" - type = models.CharField(max_length=255) extension = models.ForeignKey('Extension', on_delete=models.PROTECT) need_infra = models.BooleanField(default=False) @@ -282,7 +279,7 @@ class IpType(RevMixin, AclMixin, models.Model): protocol='IPv4', null=True, blank=True, - help_text="Network containing the ipv4 range domain ip start/stop. Optional" + help_text=_("Network containing the domain's IPv4 range (optional)") ) domaine_ip_netmask = models.IntegerField( default=24, @@ -290,11 +287,11 @@ class IpType(RevMixin, AclMixin, models.Model): MaxValueValidator(31), MinValueValidator(8) ], - help_text="Netmask for the ipv4 range domain" + help_text=_("Netmask for the domain's IPv4 range") ) reverse_v4 = models.BooleanField( default=False, - help_text="Enable reverse DNS for IPv4", + help_text=_("Enable reverse DNS for IPv4"), ) prefix_v6 = models.GenericIPAddressField( protocol='IPv6', @@ -310,7 +307,7 @@ class IpType(RevMixin, AclMixin, models.Model): ) reverse_v6 = models.BooleanField( default=False, - help_text="Enable reverse DNS for IPv6", + help_text=_("Enable reverse DNS for IPv6"), ) vlan = models.ForeignKey( 'Vlan', @@ -326,9 +323,11 @@ class IpType(RevMixin, AclMixin, models.Model): class Meta: permissions = ( - ("view_iptype", "Peut voir un objet iptype"), - ("use_all_iptype", "Peut utiliser tous les iptype"), + ("view_iptype", _("Can view an IP type object")), + ("use_all_iptype", _("Can use all IP types")), ) + verbose_name = _("IP type") + verbose_name_plural = ("IP types") @cached_property def ip_range(self): @@ -431,8 +430,9 @@ class IpType(RevMixin, AclMixin, models.Model): """ Methode dépréciée, IpList est en mode cascade et supprimé automatiquement""" if Interface.objects.filter(ipv4__in=self.ip_objects()): - raise ValidationError("Une ou plusieurs ip du range sont\ - affectées, impossible de supprimer le range") + raise ValidationError(_("One or several IP addresses from the" + " range are affected, impossible to delete" + " the range.")) for ip in self.ip_objects(): ip.delete() @@ -472,24 +472,25 @@ class IpType(RevMixin, AclMixin, models.Model): - Que le range crée ne recoupe pas un range existant - Formate l'ipv6 donnée en /64""" if IPAddress(self.domaine_ip_start) > IPAddress(self.domaine_ip_stop): - raise ValidationError("Domaine end doit être après start...") + raise ValidationError(_("Range end must be after range start...")) # On ne crée pas plus grand qu'un /16 if self.ip_range.size > 65536: - raise ValidationError("Le range est trop gros, vous ne devez\ - pas créer plus grand qu'un /16") + raise ValidationError(_("The range is too large, you can't create" + " a larger one than a /16.")) # On check que les / ne se recoupent pas for element in IpType.objects.all().exclude(pk=self.pk): if not self.ip_set.isdisjoint(element.ip_set): - raise ValidationError("Le range indiqué n'est pas disjoint\ - des ranges existants") + raise ValidationError(_("The specified range is not disjoint" + " from existing ranges.")) # On formate le prefix v6 if self.prefix_v6: self.prefix_v6 = str(IPNetwork(self.prefix_v6 + '/64').network) # On vérifie qu'un domaine network/netmask contiens bien le domaine ip start-stop if self.domaine_ip_network: if not self.domaine_ip_start in self.ip_network or not self.domaine_ip_stop in self.ip_network: - raise ValidationError("If you specify a domaine ip network/netmask, it\ - must contain domaine ipstart-stop range") + raise ValidationError(_("If you specify a domain network or" + " netmask, it must contain the" + " domain's IP range.")) return def save(self, *args, **kwargs): @@ -511,16 +512,16 @@ class IpType(RevMixin, AclMixin, models.Model): class Vlan(RevMixin, AclMixin, models.Model): """ Un vlan : vlan_id et nom On limite le vlan id entre 0 et 4096, comme défini par la norme""" - PRETTY_NAME = "Vlans" - vlan_id = models.PositiveIntegerField(validators=[MaxValueValidator(4095)]) name = models.CharField(max_length=256) comment = models.CharField(max_length=256, blank=True) class Meta: permissions = ( - ("view_vlan", "Peut voir un objet vlan"), + ("view_vlan", _("Can view a VLAN object")), ) + verbose_name = _("VLAN") + verbose_name_plural = _("VLANs") def __str__(self): return self.name @@ -530,8 +531,6 @@ class Nas(RevMixin, AclMixin, models.Model): """ Les nas. Associé à un machine_type. Permet aussi de régler le port_access_mode (802.1X ou mac-address) pour le radius. Champ autocapture de la mac à true ou false""" - PRETTY_NAME = "Correspondance entre les nas et les machines connectées" - default_mode = '802.1X' AUTH = ( ('802.1X', '802.1X'), @@ -558,8 +557,10 @@ class Nas(RevMixin, AclMixin, models.Model): class Meta: permissions = ( - ("view_nas", "Peut voir un objet Nas"), + ("view_nas", _("Can view a NAS device object")), ) + verbose_name = _("NAS device") + verbose_name_plural = _("NAS devices") def __str__(self): return self.name @@ -571,36 +572,36 @@ class SOA(RevMixin, AclMixin, models.Model): Les valeurs par défault viennent des recommandations RIPE : https://www.ripe.net/publications/docs/ripe-203 """ - PRETTY_NAME = "Enregistrement SOA" - name = models.CharField(max_length=255) mail = models.EmailField( - help_text='Email du contact pour la zone' + help_text=_("Contact email address for the zone") ) refresh = models.PositiveIntegerField( default=86400, # 24 hours - help_text='Secondes avant que les DNS secondaires doivent demander le\ - serial du DNS primaire pour détecter une modification' + help_text=_("Seconds before the secondary DNS have to ask the primary" + " DNS serial to detect a modification") ) retry = models.PositiveIntegerField( default=7200, # 2 hours - help_text='Secondes avant que les DNS secondaires fassent une nouvelle\ - demande de serial en cas de timeout du DNS primaire' + help_text=_("Seconds before the secondary DNS ask the serial again in" + " case of a primary DNS timeout") ) expire = models.PositiveIntegerField( default=3600000, # 1000 hours - help_text='Secondes après lesquelles les DNS secondaires arrêtent de\ - de répondre aux requêtes en cas de timeout du DNS primaire' + help_text=_("Seconds before the secondary DNS stop answering requests" + " in case of primary DNS timeout") ) ttl = models.PositiveIntegerField( default=172800, # 2 days - help_text='Time To Live' + help_text=_("Time to Live") ) class Meta: permissions = ( - ("view_soa", "Peut voir un objet soa"), + ("view_soa", _("Can view an SOA record object")), ) + verbose_name = _("SOA record") + verbose_name_plural = _("SOA records") def __str__(self): return str(self.name) @@ -639,7 +640,7 @@ class SOA(RevMixin, AclMixin, models.Model): /!\ Ne jamais supprimer ou renommer cette fonction car elle est utilisée dans les migrations de la BDD. """ return cls.objects.get_or_create( - name="SOA to edit", + name=_("SOA to edit"), mail="postmaser@example.com" )[0].pk @@ -647,12 +648,10 @@ class SOA(RevMixin, AclMixin, models.Model): class Extension(RevMixin, AclMixin, models.Model): """ Extension dns type example.org. Précise si tout le monde peut l'utiliser, associé à un origin (ip d'origine)""" - PRETTY_NAME = "Extensions dns" - name = models.CharField( max_length=255, unique=True, - help_text="Nom de la zone, doit commencer par un point (.example.org)" + help_text=_("Zone name, must begin with a dot (.example.org)") ) need_infra = models.BooleanField(default=False) origin = models.ForeignKey( @@ -660,13 +659,13 @@ class Extension(RevMixin, AclMixin, models.Model): on_delete=models.PROTECT, blank=True, null=True, - help_text="Enregistrement A associé à la zone" + help_text=_("A record associated with the zone") ) origin_v6 = models.GenericIPAddressField( protocol='IPv6', null=True, blank=True, - help_text="Enregistrement AAAA associé à la zone" + help_text=_("AAAA record associated with the zone") ) soa = models.ForeignKey( 'SOA', @@ -675,9 +674,11 @@ class Extension(RevMixin, AclMixin, models.Model): class Meta: permissions = ( - ("view_extension", "Peut voir un objet extension"), - ("use_all_extension", "Peut utiliser toutes les extension"), + ("view_extension", _("Can view an extension object")), + ("use_all_extension", _("Can use all extensions")), ) + verbose_name = _("DNS extension") + verbose_name_plural = _("DNS extensions") @cached_property def dns_entry(self): @@ -728,7 +729,7 @@ class Extension(RevMixin, AclMixin, models.Model): def clean(self, *args, **kwargs): if self.name and self.name[0] != '.': - raise ValidationError("Une extension doit commencer par un point") + raise ValidationError(_("An extension must begin with a dot.")) super(Extension, self).clean(*args, **kwargs) @@ -736,16 +737,16 @@ class Mx(RevMixin, AclMixin, models.Model): """ Entrées des MX. Enregistre la zone (extension) associée et la priorité Todo : pouvoir associer un MX à une interface """ - PRETTY_NAME = "Enregistrements MX" - zone = models.ForeignKey('Extension', on_delete=models.PROTECT) priority = models.PositiveIntegerField() name = models.ForeignKey('Domain', on_delete=models.PROTECT) class Meta: permissions = ( - ("view_mx", "Peut voir un objet mx"), + ("view_mx", _("Can view an MX record object")), ) + verbose_name = _("MX record") + verbose_name_plural = _("MX records") @cached_property def dns_entry(self): @@ -762,15 +763,15 @@ class Mx(RevMixin, AclMixin, models.Model): class Ns(RevMixin, AclMixin, models.Model): """Liste des enregistrements name servers par zone considéérée""" - PRETTY_NAME = "Enregistrements NS" - zone = models.ForeignKey('Extension', on_delete=models.PROTECT) ns = models.ForeignKey('Domain', on_delete=models.PROTECT) class Meta: permissions = ( - ("view_ns", "Peut voir un objet ns"), + ("view_ns", _("Can view an NS record object")), ) + verbose_name = _("NS record") + verbose_name_plural = _("NS records") @cached_property def dns_entry(self): @@ -783,16 +784,16 @@ class Ns(RevMixin, AclMixin, models.Model): class Txt(RevMixin, AclMixin, models.Model): """ Un enregistrement TXT associé à une extension""" - PRETTY_NAME = "Enregistrement TXT" - zone = models.ForeignKey('Extension', on_delete=models.PROTECT) field1 = models.CharField(max_length=255) field2 = models.TextField(max_length=2047) class Meta: permissions = ( - ("view_txt", "Peut voir un objet txt"), + ("view_txt", _("Can view a TXT record object")), ) + verbose_name = _("TXT record") + verbose_name_plural = _("TXT records") def __str__(self): return str(self.zone) + " : " + str(self.field1) + " " +\ @@ -811,10 +812,10 @@ class DName(RevMixin, AclMixin, models.Model): class Meta: permissions = ( - ("view_dname", "Can see a dname object"), + ("view_dname", _("Can view a DNAME record object")), ) - verbose_name = "DNAME entry" - verbose_name_plural = "DNAME entries" + verbose_name = _("DNAME record") + verbose_name_plural = _("DNAME records") def __str__(self): return str(self.zone) + " : " + str(self.alias) @@ -827,8 +828,6 @@ class DName(RevMixin, AclMixin, models.Model): class Srv(RevMixin, AclMixin, models.Model): """ A SRV record """ - PRETTY_NAME = "Enregistrement Srv" - TCP = 'TCP' UDP = 'UDP' @@ -844,35 +843,37 @@ class Srv(RevMixin, AclMixin, models.Model): extension = models.ForeignKey('Extension', on_delete=models.PROTECT) ttl = models.PositiveIntegerField( default=172800, # 2 days - help_text='Time To Live' + help_text=_("Time to Live") ) priority = models.PositiveIntegerField( default=0, validators=[MaxValueValidator(65535)], - help_text=("La priorité du serveur cible (valeur entière non " - "négative, plus elle est faible, plus ce serveur sera " - "utilisé s'il est disponible)") + help_text=_("Priority of the target server (positive integer value," + " the lower it is, the more the server will be used if" + " available)") ) weight = models.PositiveIntegerField( default=0, validators=[MaxValueValidator(65535)], - help_text="Poids relatif pour les enregistrements de même priorité\ - (valeur entière de 0 à 65535)" + help_text=_("Relative weight for records with the same priority" + " (integer value between 0 and 65535)") ) port = models.PositiveIntegerField( validators=[MaxValueValidator(65535)], - help_text="Port (tcp/udp)" + help_text=_("TCP/UDP port") ) target = models.ForeignKey( 'Domain', on_delete=models.PROTECT, - help_text="Serveur cible" + help_text=_("Target server") ) class Meta: permissions = ( - ("view_srv", "Peut voir un objet srv"), + ("view_srv", _("Can view an SRV record object")), ) + verbose_name = _("SRV record") + verbose_name_plural = _("SRV records") def __str__(self): return str(self.service) + ' ' + str(self.protocole) + ' ' +\ @@ -936,10 +937,10 @@ class SshFp(RevMixin, AclMixin, models.Model): class Meta: permissions = ( - ("view_sshfp", "Can see an SSHFP record"), + ("view_sshfp", _("Can view an SSHFP record object")), ) - verbose_name = "SSHFP record" - verbose_name_plural = "SSHFP records" + verbose_name = _("SSHFP record") + verbose_name_plural = _("SSHFP records") def can_view(self, user_request, *_args, **_kwargs): return self.machine.can_view(user_request, *_args, **_kwargs) @@ -963,8 +964,6 @@ class Interface(RevMixin, AclMixin, FieldPermissionModelMixin, models.Model): - le type parent associé au range ip et à l'extension - un objet domain associé contenant son nom - la liste des ports oiuvert""" - PRETTY_NAME = "Interface" - ipv4 = models.OneToOneField( 'IpList', on_delete=models.PROTECT, @@ -979,10 +978,12 @@ class Interface(RevMixin, AclMixin, FieldPermissionModelMixin, models.Model): class Meta: permissions = ( - ("view_interface", "Peut voir un objet interface"), + ("view_interface", _("Can view an interface object")), ("change_interface_machine", - "Peut changer le propriétaire d'une interface"), + _("Can change the owner of an interface")), ) + verbose_name = _("interface") + verbose_name_plural = _("interfaces") @cached_property def is_active(self): @@ -1076,7 +1077,7 @@ class Interface(RevMixin, AclMixin, FieldPermissionModelMixin, models.Model): try: self.mac_address = str(EUI(self.mac_address)) except: - raise ValidationError("La mac donnée est invalide") + raise ValidationError(_("The given MAC address is invalid.")) def clean(self, *args, **kwargs): """ Formate l'addresse mac en mac_bare (fonction filter_mac) @@ -1089,7 +1090,7 @@ class Interface(RevMixin, AclMixin, FieldPermissionModelMixin, models.Model): # But in our case, it's impossible to create a type value so we raise # the error. if not hasattr(self, 'type'): - raise ValidationError("Le type d'ip choisi n'est pas valide") + raise ValidationError(_("The selected IP type is invalid.")) self.filter_macaddress() self.mac_address = str(EUI(self.mac_address)) or None if not self.ipv4 or self.type.ip_type != self.ipv4.ip_type: @@ -1102,8 +1103,8 @@ class Interface(RevMixin, AclMixin, FieldPermissionModelMixin, models.Model): if free_ips: self.ipv4 = free_ips[0] else: - raise ValidationError("Il n'y a plus d'ip disponibles\ - dans le slash") + raise ValidationError(_("There is no IP address available in the" + " slash.")) return def unassign_ipv4(self): @@ -1120,8 +1121,8 @@ class Interface(RevMixin, AclMixin, FieldPermissionModelMixin, models.Model): # On verifie la cohérence en forçant l'extension par la méthode if self.ipv4: if self.type.ip_type != self.ipv4.ip_type: - raise ValidationError("L'ipv4 et le type de la machine ne\ - correspondent pas") + raise ValidationError(_("The IPv4 address and the machine type" + " don't match.")) super(Interface, self).save(*args, **kwargs) @staticmethod @@ -1134,23 +1135,23 @@ class Interface(RevMixin, AclMixin, FieldPermissionModelMixin, models.Model): try: machine = Machine.objects.get(pk=machineid) except Machine.DoesNotExist: - return False, u"Machine inexistante" + return False, _("Nonexistent machine.") if not user_request.has_perm('machines.add_interface'): if not (preferences.models.OptionalMachine .get_cached_value('create_machine')): - return False, u"Vous ne pouvez pas ajouter une machine" + return False, _("You can't add a machine.") max_lambdauser_interfaces = (preferences.models.OptionalMachine .get_cached_value( 'max_lambdauser_interfaces' )) if machine.user != user_request: - return False, u"Vous ne pouvez pas ajouter une interface à une\ - machine d'un autre user que vous sans droit" + return False, _("You don't have the right to add an interface" + " to a machine of another user.") if (machine.user.user_interfaces().count() >= max_lambdauser_interfaces): - return False, u"Vous avez atteint le maximum d'interfaces\ - autorisées que vous pouvez créer vous même (%s) "\ - % max_lambdauser_interfaces + return False, (_("You reached the maximum number of interfaces" + " that you are allowed to create yourself" + " (%s)." % max_lambdauser_interfaces)) return True, None @staticmethod @@ -1158,7 +1159,7 @@ class Interface(RevMixin, AclMixin, FieldPermissionModelMixin, models.Model): """Check if a user can change the machine associated with an Interface object """ return (user_request.has_perm('machines.change_interface_machine'), - "Droit requis pour changer la machine") + _("Permission required to edit the machine.")) def can_edit(self, user_request, *args, **kwargs): """Verifie que l'user a les bons droits infra pour editer @@ -1172,9 +1173,9 @@ class Interface(RevMixin, AclMixin, FieldPermissionModelMixin, models.Model): user_request, *args, **kwargs - )[0]): - return False, (u"Vous ne pouvez pas éditer une machine " - "d'un autre user que vous sans droit") + )[0]): + return False, _("You don't have the right to edit a machine of" + " another user.") return True, None def can_delete(self, user_request, *args, **kwargs): @@ -1189,9 +1190,9 @@ class Interface(RevMixin, AclMixin, FieldPermissionModelMixin, models.Model): user_request, *args, **kwargs - )[0]): - return False, (u"Vous ne pouvez pas éditer une machine " - "d'un autre user que vous sans droit") + )[0]): + return False, _("You don't have the right to edit a machine of" + " another user.") return True, None def can_view(self, user_request, *_args, **_kwargs): @@ -1202,8 +1203,8 @@ class Interface(RevMixin, AclMixin, FieldPermissionModelMixin, models.Model): :return: True ou False avec la raison de l'échec le cas échéant""" if (not user_request.has_perm('machines.view_interface') and self.machine.user != user_request): - return False, (u"Vous n'avez pas le droit de voir des machines " - "autre que les vôtres") + return False, _("You don't have the right to view machines other" + " than yours.") return True, None def __init__(self, *args, **kwargs): @@ -1235,7 +1236,6 @@ class Interface(RevMixin, AclMixin, FieldPermissionModelMixin, models.Model): class Ipv6List(RevMixin, AclMixin, FieldPermissionModelMixin, models.Model): """ A list of IPv6 """ - PRETTY_NAME = 'Enregistrements Ipv6 des machines' ipv6 = models.GenericIPAddressField( protocol='IPv6', @@ -1249,10 +1249,12 @@ class Ipv6List(RevMixin, AclMixin, FieldPermissionModelMixin, models.Model): class Meta: permissions = ( - ("view_ipv6list", "Peut voir un objet ipv6"), - ("change_ipv6list_slaac_ip", - "Peut changer la valeur slaac sur une ipv6"), + ("view_ipv6list", _("Can view an IPv6 addresses list object")), + ("change_ipv6list_slaac_ip", _("Can change the SLAAC value of an" + " IPv6 addresses list")), ) + verbose_name = _("IPv6 addresses list") + verbose_name_plural = _("IPv6 addresses lists") @staticmethod def can_create(user_request, interfaceid, *_args, **_kwargs): @@ -1264,18 +1266,19 @@ class Ipv6List(RevMixin, AclMixin, FieldPermissionModelMixin, models.Model): try: interface = Interface.objects.get(pk=interfaceid) except Interface.DoesNotExist: - return False, u"Interface inexistante" + return False, _("Nonexistent interface.") if not user_request.has_perm('machines.add_ipv6list'): if interface.machine.user != user_request: - return False, u"Vous ne pouvez pas ajouter un alias à une\ - machine d'un autre user que vous sans droit" + return False, _("You don't have the right to add an alias to a" + " machine of another user.") return True, None @staticmethod def can_change_slaac_ip(user_request, *_args, **_kwargs): """ Check if a user can change the slaac value """ return (user_request.has_perm('machines.change_ipv6list_slaac_ip'), - "Droit requis pour changer la valeur slaac ip") + _("Permission required to change the SLAAC value of an IPv6" + " address")) def can_edit(self, user_request, *args, **kwargs): """Verifie que l'user a les bons droits infra pour editer @@ -1289,9 +1292,9 @@ class Ipv6List(RevMixin, AclMixin, FieldPermissionModelMixin, models.Model): user_request, *args, **kwargs - )[0]): - return False, (u"Vous ne pouvez pas éditer une machine " - "d'un autre user que vous sans droit") + )[0]): + return False, _("You don't have the right to edit a machine of" + " another user.") return True, None def can_delete(self, user_request, *args, **kwargs): @@ -1306,9 +1309,9 @@ class Ipv6List(RevMixin, AclMixin, FieldPermissionModelMixin, models.Model): user_request, *args, **kwargs - )[0]): - return False, (u"Vous ne pouvez pas éditer une machine " - "d'un autre user que vous sans droit") + )[0]): + return False, _("You don't have the right to edit a machine of" + " another user.") return True, None def can_view(self, user_request, *_args, **_kwargs): @@ -1319,8 +1322,8 @@ class Ipv6List(RevMixin, AclMixin, FieldPermissionModelMixin, models.Model): :return: True ou False avec la raison de l'échec le cas échéant""" if (not user_request.has_perm('machines.view_ipv6list') and self.interface.machine.user != user_request): - return False, (u"Vous n'avez pas le droit de voir des machines " - "autre que les vôtres") + return False, _("You don't have the right to view machines other" + " than yours.") return True, None def __init__(self, *args, **kwargs): @@ -1346,15 +1349,14 @@ class Ipv6List(RevMixin, AclMixin, FieldPermissionModelMixin, models.Model): if self.slaac_ip and (Ipv6List.objects .filter(interface=self.interface, slaac_ip=True) .exclude(id=self.id)): - raise ValidationError("Une ip slaac est déjà enregistrée") + raise ValidationError(_("A SLAAC IP address is already registered.")) prefix_v6 = self.interface.type.ip_type.prefix_v6.encode().decode('utf-8') if prefix_v6: if (IPv6Address(self.ipv6.encode().decode('utf-8')).exploded[:20] != IPv6Address(prefix_v6).exploded[:20]): - raise ValidationError( - "Le prefixv6 est incorrect et ne correspond pas au type " - "associé à la machine" - ) + raise ValidationError(_("The v6 prefix is incorrect and" + " doesn't match the type associated" + " with the machine.")) super(Ipv6List, self).clean(*args, **kwargs) def save(self, *args, **kwargs): @@ -1370,7 +1372,6 @@ class Domain(RevMixin, AclMixin, models.Model): """ Objet domain. Enregistrement A et CNAME en même temps : permet de stocker les alias et les nom de machines, suivant si interface_parent ou cname sont remplis""" - PRETTY_NAME = "Domaine dns" interface_parent = models.OneToOneField( 'Interface', @@ -1379,7 +1380,7 @@ class Domain(RevMixin, AclMixin, models.Model): null=True ) name = models.CharField( - help_text="Obligatoire et unique, ne doit pas comporter de points", + help_text=_("Mandatory and unique, must not contain dots."), max_length=255 ) extension = models.ForeignKey('Extension', on_delete=models.PROTECT) @@ -1393,8 +1394,10 @@ class Domain(RevMixin, AclMixin, models.Model): class Meta: unique_together = (("name", "extension"),) permissions = ( - ("view_domain", "Peut voir un objet domain"), + ("view_domain", _("Can view a domain object")), ) + verbose_name = _("domain") + verbose_name_plural = _("domains") def get_extension(self): """ Retourne l'extension de l'interface parente si c'est un A @@ -1416,20 +1419,22 @@ class Domain(RevMixin, AclMixin, models.Model): if self.get_extension(): self.extension = self.get_extension() if self.interface_parent and self.cname: - raise ValidationError("On ne peut créer à la fois A et CNAME") + raise ValidationError(_("You can't create a both A and CNAME" + " record.")) if self.cname == self: - raise ValidationError("On ne peut créer un cname sur lui même") + raise ValidationError(_("You can't create a CNAME record pointing" + " to itself.")) HOSTNAME_LABEL_PATTERN = re.compile( r"(?!-)[A-Z\d-]+(? 63: - raise ValidationError("Le nom de domaine %s est trop long\ - (maximum de 63 caractères)." % dns) + raise ValidationError(_("The domain name %s is too long (over 63" + " characters).") % dns) if not HOSTNAME_LABEL_PATTERN.match(dns): - raise ValidationError("Ce nom de domaine %s contient des\ - carractères interdits." % dns) + raise ValidationError(_("The domain name %s contains forbidden" + " characters.") % dns) self.validate_unique() super(Domain, self).clean() @@ -1446,7 +1451,7 @@ class Domain(RevMixin, AclMixin, models.Model): """ Empèche le save sans extension valide. Force à avoir appellé clean avant""" if not self.get_extension(): - raise ValidationError("Extension invalide") + raise ValidationError(_("Invalid extension.")) self.full_clean() super(Domain, self).save(*args, **kwargs) @@ -1472,24 +1477,24 @@ class Domain(RevMixin, AclMixin, models.Model): try: interface = Interface.objects.get(pk=interfaceid) except Interface.DoesNotExist: - return False, u"Interface inexistante" + return False, _("Nonexistent interface.") if not user_request.has_perm('machines.add_domain'): max_lambdauser_aliases = (preferences.models.OptionalMachine .get_cached_value( 'max_lambdauser_aliases' )) if interface.machine.user != user_request: - return False, (u"Vous ne pouvez pas ajouter un alias à une " - "machine d'un autre user que vous sans droit") + return False, _("You don't have the right to add an alias to a" + " machine of another user.") if Domain.objects.filter( - cname__in=Domain.objects.filter( - interface_parent__in=(interface.machine.user - .user_interfaces()) - ) - ).count() >= max_lambdauser_aliases: - return False, (u"Vous avez atteint le maximum d'alias " - "autorisés que vous pouvez créer vous même " - "(%s) " % max_lambdauser_aliases) + cname__in=Domain.objects.filter( + interface_parent__in=(interface.machine.user + .user_interfaces()) + ) + ).count() >= max_lambdauser_aliases: + return False, _("You reached the maximum number of alias that" + " you are allowed to create yourself (%s). " + % max_lambdauser_aliases) return True, None def can_edit(self, user_request, *_args, **_kwargs): @@ -1500,8 +1505,8 @@ class Domain(RevMixin, AclMixin, models.Model): :return: soit True, soit False avec la raison de l'échec""" if (not user_request.has_perm('machines.change_domain') and self.get_source_interface.machine.user != user_request): - return False, (u"Vous ne pouvez pas editer un alias à une machine " - "d'un autre user que vous sans droit") + return False, _("You don't have the right to edit an alias of a" + " machine of another user.") return True, None def can_delete(self, user_request, *_args, **_kwargs): @@ -1512,8 +1517,8 @@ class Domain(RevMixin, AclMixin, models.Model): :return: soit True, soit False avec la raison de l'échec""" if (not user_request.has_perm('machines.delete_domain') and self.get_source_interface.machine.user != user_request): - return False, (u"Vous ne pouvez pas supprimer un alias à une " - "machine d'un autre user que vous sans droit") + return False, _("You don't have the right to delete an alias of a" + " machine of another user.") return True, None def can_view(self, user_request, *_args, **_kwargs): @@ -1524,8 +1529,8 @@ class Domain(RevMixin, AclMixin, models.Model): :return: True ou False avec la raison de l'échec le cas échéant""" if (not user_request.has_perm('machines.view_domain') and self.get_source_interface.machine.user != user_request): - return False, (u"Vous n'avez pas le droit de voir des machines " - "autre que les vôtres") + return False, _("You don't have the right to view machines other" + " than yours.") return True, None def __str__(self): @@ -1534,15 +1539,16 @@ class Domain(RevMixin, AclMixin, models.Model): class IpList(RevMixin, AclMixin, models.Model): """ A list of IPv4 """ - PRETTY_NAME = "Addresses ipv4" ipv4 = models.GenericIPAddressField(protocol='IPv4', unique=True) ip_type = models.ForeignKey('IpType', on_delete=models.CASCADE) class Meta: permissions = ( - ("view_iplist", "Peut voir un objet iplist"), + ("view_iplist", _("Can view an IPv4 addresses list object")), ) + verbose_name = _("IPv4 addresses list") + verbose_name_plural = _("IPv4 addresses lists") @cached_property def need_infra(self): @@ -1553,8 +1559,8 @@ class IpList(RevMixin, AclMixin, models.Model): def clean(self): """ Erreur si l'ip_type est incorrect""" if not str(self.ipv4) in self.ip_type.ip_set_as_str: - raise ValidationError("L'ipv4 et le range de l'iptype ne\ - correspondent pas!") + raise ValidationError(_("The IPv4 address and the range of the IP" + " type don't match.")) return def save(self, *args, **kwargs): @@ -1571,19 +1577,19 @@ class Role(RevMixin, AclMixin, models.Model): """ ROLE = ( - ('dhcp-server', _l('DHCP server')), - ('switch-conf-server', _l('Switches configuration server')), - ('dns-recursif-server', _l('Recursive DNS server')), - ('ntp-server', _l('NTP server')), - ('radius-server', _l('Radius server')), - ('log-server', _l('Log server')), - ('ldap-master-server', _l('LDAP master server')), - ('ldap-backup-server', _l('LDAP backup server')), - ('smtp-server', _l('SMTP server')), - ('postgresql-server', _l('postgreSQL server')), - ('mysql-server', _l('mySQL server')), - ('sql-client', _l('SQL client')), - ('gateway', _l('Gatewaw')), + ('dhcp-server', _("DHCP server")), + ('switch-conf-server', _("Switches configuration server")), + ('dns-recursif-server', _("Recursive DNS server")), + ('ntp-server', _("NTP server")), + ('radius-server', _("RADIUS server")), + ('log-server', _("Log server")), + ('ldap-master-server', _("LDAP master server")), + ('ldap-backup-server', _("LDAP backup server")), + ('smtp-server', _("SMTP server")), + ('postgresql-server', _("postgreSQL server")), + ('mysql-server', _("mySQL server")), + ('sql-client', _("SQL client")), + ('gateway', _("Gateway")), ) role_type = models.CharField(max_length=255, unique=True) @@ -1597,9 +1603,10 @@ class Role(RevMixin, AclMixin, models.Model): class Meta: permissions = ( - ("view_role", _l("Can view a role.")), + ("view_role", _("Can view a role object")), ) - verbose_name = _l("Server role") + verbose_name = _("server role") + verbose_name_plural = _("server roles") @classmethod def get_instance(cls, roleid, *_args, **_kwargs): @@ -1636,23 +1643,24 @@ class Role(RevMixin, AclMixin, models.Model): class Service(RevMixin, AclMixin, models.Model): """ Definition d'un service (dhcp, dns, etc)""" - PRETTY_NAME = "Services à générer (dhcp, dns, etc)" service_type = models.CharField(max_length=255, blank=True, unique=True) min_time_regen = models.DurationField( default=timedelta(minutes=1), - help_text="Temps minimal avant nouvelle génération du service" + help_text=_("Minimal time before regeneration of the service.") ) regular_time_regen = models.DurationField( default=timedelta(hours=1), - help_text="Temps maximal avant nouvelle génération du service" + help_text=_("Maximal time before regeneration of the service.") ) servers = models.ManyToManyField('Interface', through='Service_link') class Meta: permissions = ( - ("view_service", "Peut voir un objet service"), + ("view_service", _("Can view a service object")), ) + verbose_name = _("service to generate (DHCP, DNS, ...)") + verbose_name_plural = _("services to generate (DHCP, DNS, ...)") def ask_regen(self): """ Marque à True la demande de régénération pour un service x """ @@ -1690,7 +1698,6 @@ def regen(service): class Service_link(RevMixin, AclMixin, models.Model): """ Definition du lien entre serveurs et services""" - PRETTY_NAME = "Relation entre service et serveur" service = models.ForeignKey('Service', on_delete=models.CASCADE) server = models.ForeignKey('Interface', on_delete=models.CASCADE) @@ -1699,8 +1706,10 @@ class Service_link(RevMixin, AclMixin, models.Model): class Meta: permissions = ( - ("view_service_link", "Peut voir un objet service_link"), + ("view_service_link", _("Can view a service server link object")), ) + verbose_name = _("link between service and server") + verbose_name_plural = _("links between service and server") def done_regen(self): """ Appellé lorsqu'un serveur a regénéré son service""" @@ -1740,17 +1749,19 @@ class Service_link(RevMixin, AclMixin, models.Model): class OuverturePortList(RevMixin, AclMixin, models.Model): """Liste des ports ouverts sur une interface.""" - PRETTY_NAME = "Profil d'ouverture de ports" name = models.CharField( - help_text="Nom de la configuration des ports.", + help_text=_("Name of the ports configuration"), max_length=255 ) class Meta: permissions = ( - ("view_ouvertureportlist", "Peut voir un objet ouvertureport"), + ("view_ouvertureportlist", _("Can view a ports opening list" + " object")), ) + verbose_name = _("ports opening list") + verbose_name_plural = _("ports opening lists") def can_delete(self, user_request, *_args, **_kwargs): """Verifie que l'user a les bons droits bureau pour delete @@ -1759,10 +1770,10 @@ class OuverturePortList(RevMixin, AclMixin, models.Model): :param user_request: Utilisateur qui fait la requête :return: soit True, soit False avec la raison de l'échec""" if not user_request.has_perm('machines.delete_ouvertureportlist'): - return False, (u"Vous n'avez pas le droit de supprimer une " - "ouverture de port") + return False, _("You don't have the right to delete a ports" + " opening list.") if self.interface_set.all(): - return False, u"Cette liste de ports est utilisée" + return False, _("This ports opening list is used.") return True, None def __str__(self): @@ -1806,7 +1817,6 @@ class OuverturePort(RevMixin, AclMixin, models.Model): On limite les ports entre 0 et 65535, tels que défini par la RFC """ - PRETTY_NAME = "Plage de port ouverte" TCP = 'T' UDP = 'U' @@ -1834,6 +1844,10 @@ class OuverturePort(RevMixin, AclMixin, models.Model): ), default=OUT, ) + + class Meta: + verbose_name = _("ports opening") + verbose_name = _("ports openings") def __str__(self): if self.begin == self.end: @@ -1999,3 +2013,4 @@ def srv_post_save(**_kwargs): def srv_post_delete(**_kwargs): """Regeneration dns après modification d'un SRV""" regen('dns') + diff --git a/machines/templates/machines/aff_alias.html b/machines/templates/machines/aff_alias.html index 184db6f4..17266a6e 100644 --- a/machines/templates/machines/aff_alias.html +++ b/machines/templates/machines/aff_alias.html @@ -23,25 +23,26 @@ with this program; if not, write to the Free Software Foundation, Inc., {% endcomment %} {% load acl %} +{% load i18n %} {% load logs_extra %} - + {% for alias in alias_list %} - - - - + + + + {% endfor %}
Alias{% trans "Aliases" %}
{{ alias }} - {% can_edit alias %} - {% include 'buttons/edit.html' with href='machines:edit-alias' id=alias.id %} - {% acl_end %} - {% history_button alias %} -
{{ alias }} + {% can_edit alias %} + {% include 'buttons/edit.html' with href='machines:edit-alias' id=alias.id %} + {% acl_end %} + {% history_button alias %} +
diff --git a/machines/templates/machines/aff_dname.html b/machines/templates/machines/aff_dname.html index 8797be72..7e043d7c 100644 --- a/machines/templates/machines/aff_dname.html +++ b/machines/templates/machines/aff_dname.html @@ -22,16 +22,17 @@ with this program; if not, write to the Free Software Foundation, Inc., {% load acl %} {% load logs_extra %} +{% load i18n %} - - - - - - - - - {% for dname in dname_list %} +
Target zoneRecord
+ + + + + + + + {% for dname in dname_list %} @@ -39,10 +40,9 @@ with this program; if not, write to the Free Software Foundation, Inc., {% can_edit dname %} {% include 'buttons/edit.html' with href='machines:edit-dname' id=dname.id %} {% acl_end %} - {% history_button dname %} + {% history_button dname %} - {% endfor %} -
{% trans "Target zone" %}{% trans "Record" %}
{{ dname.zone }} {{ dname.dns_entry }}
- + {% endfor %} + diff --git a/machines/templates/machines/aff_extension.html b/machines/templates/machines/aff_extension.html index ba444eca..43bb9e39 100644 --- a/machines/templates/machines/aff_extension.html +++ b/machines/templates/machines/aff_extension.html @@ -25,17 +25,18 @@ with this program; if not, write to the Free Software Foundation, Inc., {% load acl %} {% load logs_extra %} {% load design %} +{% load i18n %}
- - - - + + + + {% if ipv6_enabled %} - + {% endif %} @@ -44,7 +45,7 @@ with this program; if not, write to the Free Software Foundation, Inc., - + {% if ipv6_enabled %} @@ -59,3 +60,4 @@ with this program; if not, write to the Free Software Foundation, Inc., {% endfor %}
ExtensionDroit infra pour utiliser ?Enregistrement SOAEnregistrement A origin{% trans "Extension" %}{% trans "'infra' right required" %}{% trans "SOA record" %}{% trans "A record origin" %}Enregistrement AAAA origin{% trans "AAAA record origin" %}
{{ extension.name }} {{ extension.need_infra|tick }}{{ extension.soa}}{{ extension.soa }} {{ extension.origin }}{{ extension.origin_v6 }}
+ diff --git a/machines/templates/machines/aff_iptype.html b/machines/templates/machines/aff_iptype.html index afd35d1b..b8ed5293 100644 --- a/machines/templates/machines/aff_iptype.html +++ b/machines/templates/machines/aff_iptype.html @@ -26,18 +26,20 @@ with this program; if not, write to the Free Software Foundation, Inc., {% load acl %} {% load logs_extra %} +{% load i18n %} +
- - - - - - - - + + + + + + + + @@ -61,3 +63,4 @@ with this program; if not, write to the Free Software Foundation, Inc., {% endfor %}
Type d'ipExtensionNécessite l'autorisation infraPlage ipv4Préfixe v6DNSSEC reverse v4/v6Sur vlanOuverture ports par défault{% trans "IP type" %}{% trans "Extension" %}{% trans "'infra' right required" %}{% trans "IPv4 range" %}{% trans "v6 prefix" %}{% trans "DNSSEC reverse v4/v6" %}{% trans "On VLAN(s)" %}{% trans "Default ports opening" %}
+ diff --git a/machines/templates/machines/aff_ipv6.html b/machines/templates/machines/aff_ipv6.html index d5323f61..a98c0327 100644 --- a/machines/templates/machines/aff_ipv6.html +++ b/machines/templates/machines/aff_ipv6.html @@ -24,29 +24,30 @@ with this program; if not, write to the Free Software Foundation, Inc., {% load acl %} {% load logs_extra %} +{% load i18n %} - - + + - + {% for ipv6 in ipv6_list %} - - - - - + + + + + {% endfor %}
Ipv6Slaac{% trans "IPv6 addresses" %}{% trans "SLAAC" %}
{{ ipv6.ipv6 }}{{ ipv6.slaac_ip }} - {% can_edit ipv6 %} - {% include 'buttons/edit.html' with href='machines:edit-ipv6list' id=ipv6.id %} - {% acl_end %} - {% can_delete ipv6 %} - {% include 'buttons/suppr.html' with href='machines:del-ipv6list' id=ipv6.id %} - {% acl_end %} - {% history_button ipv6 %} -
{{ ipv6.ipv6 }}{{ ipv6.slaac_ip }} + {% can_edit ipv6 %} + {% include 'buttons/edit.html' with href='machines:edit-ipv6list' id=ipv6.id %} + {% acl_end %} + {% can_delete ipv6 %} + {% include 'buttons/suppr.html' with href='machines:del-ipv6list' id=ipv6.id %} + {% acl_end %} + {% history_button ipv6 %} +
diff --git a/machines/templates/machines/aff_machines.html b/machines/templates/machines/aff_machines.html index ba736f10..e3404036 100644 --- a/machines/templates/machines/aff_machines.html +++ b/machines/templates/machines/aff_machines.html @@ -24,6 +24,7 @@ with this program; if not, write to the Free Software Foundation, Inc., {% load acl %} {% load logs_extra %} +{% load i18n %}
{% if machines_list.paginator %} @@ -39,23 +40,27 @@ with this program; if not, write to the Free Software Foundation, Inc., - {% include "buttons/sort.html" with prefix='machine' col='name' text='Nom DNS' %} - Type - MAC - IP - Actions + {% trans "DNS name" as tr_dns_name %} + {% include "buttons/sort.html" with prefix='machine' col='name' text=tr_dns_name %} + {% trans "Type" %} + {% trans "MAC address" %} + {% trans "IP address" %} + {% trans "Actions" %} - {% for machine in machines_list %} + {% for machine in machines_list %} - {{ machine.name|default:'Pas de nom' }} - + {% trans "No name" as tr_no_name %} + {% trans "View the profile" as tr_view_the_profile %} + {{ machine.name|default:'tr_no_name' }} + {{ machine.user }} {% can_create Interface machine.id %} - {% include 'buttons/add.html' with href='machines:new-interface' id=machine.id desc='Ajouter une interface' %} + {% trans "Create an interface" as tr_create_an_interface %} + {% include 'buttons/add.html' with href='machines:new-interface' id=machine.id desc=tr_create_an_interface %} {% acl_end %} {% history_button machine %} {% can_delete machine %} @@ -68,8 +73,8 @@ with this program; if not, write to the Free Software Foundation, Inc., {% if interface.domain.related_domain.all %} {{ interface.domain }} - {% else %} {{ interface.domain }} @@ -77,7 +82,7 @@ with this program; if not, write to the Free Software Foundation, Inc., {{ interface.type }} - + {{ interface.mac_address }} @@ -86,8 +91,8 @@ with this program; if not, write to the Free Software Foundation, Inc.,
{% if ipv6_enabled and interface.ipv6 != 'None'%} IPv6 - {% endif %} @@ -97,39 +102,44 @@ with this program; if not, write to the Free Software Foundation, Inc., -
- {% if ipv6_enabled and interface.ipv6 != 'None'%}
- - {% endif %} - - - {% if interface.domain.related_domain.all %} - - -
- -
- - - {% endif %} - {% endfor %} - - - - {% endfor %} + + {% endif %} + {% if interface.domain.related_domain.all %} + + +
+ +
+ + + {% endif %} + {% endfor %} + + + + {% endfor %} + - - {% endblock %} + diff --git a/machines/templates/machines/index.html b/machines/templates/machines/index.html index 3d85dd59..509334a0 100644 --- a/machines/templates/machines/index.html +++ b/machines/templates/machines/index.html @@ -24,11 +24,12 @@ with this program; if not, write to the Free Software Foundation, Inc., {% endcomment %} {% load bootstrap3 %} +{% load i18n %} -{% block title %}Machines{% endblock %} +{% block title %}{% trans "Machines" %}{% endblock %} {% block content %} -

Machines

+

{% trans "Machines" %}

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

diff --git a/machines/templates/machines/index_alias.html b/machines/templates/machines/index_alias.html index 07750754..2d33177f 100644 --- a/machines/templates/machines/index_alias.html +++ b/machines/templates/machines/index_alias.html @@ -24,16 +24,17 @@ with this program; if not, write to the Free Software Foundation, Inc., {% endcomment %} {% load bootstrap3 %} +{% load i18n %} -{% block title %}Machines{% endblock %} +{% block title %}{% trans "Machines" %}{% endblock %} {% block content %} -

Liste des alias de l'interface

- Ajouter un alias - Supprimer un ou plusieurs alias - {% include "machines/aff_alias.html" with alias_list=alias_list %} -
-
-
+

{% trans "List of the aliases of the interface" %}

+ {% trans " Add an alias" %} + {% trans " Delete one or several aliases" %} + {% include "machines/aff_alias.html" with alias_list=alias_list %} +
+
+
{% endblock %} diff --git a/machines/templates/machines/index_extension.html b/machines/templates/machines/index_extension.html index 29c5a0bd..6669d197 100644 --- a/machines/templates/machines/index_extension.html +++ b/machines/templates/machines/index_extension.html @@ -28,57 +28,60 @@ with this program; if not, write to the Free Software Foundation, Inc., {% load acl %} {% load i18n %} -{% block title %}Machines{% endblock %} +{% block title %}{% trans "Machines" %}{% endblock %} {% block content %} -

Liste des extensions

+

{% trans "List of extensions" %}

{% can_create Extension %} - Ajouter une extension + {% trans " Add an extension" %} {% acl_end %} - Supprimer une ou plusieurs extensions + {% trans " Delete one or several extensions" %} {% include "machines/aff_extension.html" with extension_list=extension_list %} -

Liste des enregistrements SOA

+

{% trans "List of SOA records" %}

{% can_create SOA %} - Ajouter un enregistrement SOA + {% trans " Add an SOA record" %} {% acl_end %} - Supprimer un enregistrement SOA + {% trans " Delete one or several SOA records" %} {% include "machines/aff_soa.html" with soa_list=soa_list %} -

Liste des enregistrements MX

+ +

{% trans "List of MX records" %}

{% can_create Mx %} - Ajouter un enregistrement MX + {% trans " Add an MX record" %} {% acl_end %} - Supprimer un enregistrement MX + {% trans " Delete one or several MX records" %} {% include "machines/aff_mx.html" with mx_list=mx_list %} -

Liste des enregistrements NS

+ +

{% trans "List of NS records" %}

{% can_create Ns %} - Ajouter un enregistrement NS + {% trans " Add an NS record" %} {% acl_end %} - Supprimer un enregistrement NS + {% trans " Delete one or several NS records" %} {% include "machines/aff_ns.html" with ns_list=ns_list %} -

Liste des enregistrements TXT

+ +

{% trans "List of TXT records" %}

{% can_create Txt %} - Ajouter un enregistrement TXT + {% trans " Add a TXT record" %} {% acl_end %} - Supprimer un enregistrement TXT + {% trans " Delete one or several TXT records" %} {% include "machines/aff_txt.html" with txt_list=txt_list %} -

DNAME records

+

{% trans "List of DNAME records" %}

{% can_create DName %} - {% trans "Add a DNAME record" %} + {% trans " Add a DNAME record" %} {% acl_end %} - {% trans "Delete DNAME records" %} + {% trans " Delete one or several DNAME records" %} {% include "machines/aff_dname.html" with dname_list=dname_list %} -

Liste des enregistrements SRV

+

{% trans "List of SRV records" %}

{% can_create Srv %} - Ajouter un enregistrement SRV + {% trans " Add an SRV record" %} {% acl_end %} - Supprimer un enregistrement SRV + {% trans " Delete one or several SRV records" %} {% include "machines/aff_srv.html" with srv_list=srv_list %}

diff --git a/machines/templates/machines/index_iptype.html b/machines/templates/machines/index_iptype.html index 4dacf96e..5be4561d 100644 --- a/machines/templates/machines/index_iptype.html +++ b/machines/templates/machines/index_iptype.html @@ -26,15 +26,16 @@ with this program; if not, write to the Free Software Foundation, Inc., {% load bootstrap3 %} {% load acl %} +{% load i18n %} -{% block title %}Ip{% endblock %} +{% block title %}{% trans "Machines" %}{% endblock %} {% block content %} -

Liste des types d'ip

+

{% trans "List of IP types" %}

{% can_create IpType %} - Ajouter un type d'ip + {% trans " Add an IP type" %} {% acl_end %} - Supprimer un ou plusieurs types d'ip + {% trans " Delete one or several IP types" %} {% include "machines/aff_iptype.html" with iptype_list=iptype_list %}

diff --git a/machines/templates/machines/index_ipv6.html b/machines/templates/machines/index_ipv6.html index 584dc00a..06e287e2 100644 --- a/machines/templates/machines/index_ipv6.html +++ b/machines/templates/machines/index_ipv6.html @@ -25,13 +25,14 @@ with this program; if not, write to the Free Software Foundation, Inc., {% load bootstrap3 %} {% load acl %} +{% load i18n %} -{% block title %}Machines{% endblock %} +{% block title %}{% trans "Machines" %}{% endblock %} {% block content %} -

Liste des ipv6 de l'interface

+

{% trans "List of the IPv6 addresses of the interface" %}

{% can_create Ipv6List interface_id %} - Ajouter une ipv6 + {% trans " Add an IPv6 address" %} {% acl_end %} {% include "machines/aff_ipv6.html" with ipv6_list=ipv6_list %}
diff --git a/machines/templates/machines/index_machinetype.html b/machines/templates/machines/index_machinetype.html index a0bfd7e5..de1e2f58 100644 --- a/machines/templates/machines/index_machinetype.html +++ b/machines/templates/machines/index_machinetype.html @@ -26,15 +26,16 @@ with this program; if not, write to the Free Software Foundation, Inc., {% load bootstrap3 %} {% load acl %} +{% load i18n %} -{% block title %}Machines{% endblock %} +{% block title %}{% trans "Machines" %}{% endblock %} {% block content %} -

Liste des types de machines

+

{% trans "List of machine types" %}

{% can_create MachineType %} - Ajouter un type de machine + {% trans " Add a machine type" %} {% acl_end %} - Supprimer un ou plusieurs types de machines + {% trans " Delete one or several machine types" %} {% include "machines/aff_machinetype.html" with machinetype_list=machinetype_list %}

diff --git a/machines/templates/machines/index_nas.html b/machines/templates/machines/index_nas.html index 3f1cb90f..88f68213 100644 --- a/machines/templates/machines/index_nas.html +++ b/machines/templates/machines/index_nas.html @@ -26,17 +26,17 @@ with this program; if not, write to the Free Software Foundation, Inc., {% load bootstrap3 %} {% load acl %} +{% load i18n %} -{% block title %}Machines{% endblock %} +{% block title %}{% trans "Machines" %}{% endblock %} {% block content %} -

Liste des nas

-
La correpondance nas-machinetype relie le type de nas à un type de machine. - Elle est utile pour l'autoenregistrement des macs par radius, et permet de choisir le type de machine à affecter aux machines en fonction du type de nas
+

{% trans "List of NAS devices" %}

+
{% trans "The NAS device type and machine type are linked. It is useful for MAC address auto capture by RADIUS, and allows to choose the machine type to assign to the machines according to the NAS device type." %}
{% can_create Nas %} - Ajouter un type de nas + {% trans " Add a NAS device type" %} {% acl_end %} - Supprimer un ou plusieurs types nas + {% trans " Delete one or several NAS device types" %} {% include "machines/aff_nas.html" with nas_list=nas_list %}

diff --git a/machines/templates/machines/index_portlist.html b/machines/templates/machines/index_portlist.html index e505ad43..0d3d0741 100644 --- a/machines/templates/machines/index_portlist.html +++ b/machines/templates/machines/index_portlist.html @@ -3,23 +3,24 @@ {% load bootstrap3 %} {% load acl %} +{% load i18n %} -{% block title %}Configuration de ports{% endblock %} +{% block title %}{% trans "Machines" %}{% endblock %} {% block content %} -

Liste des configurations de ports

+

{% trans "List of ports configurations" %}

{% can_create OuverturePortList %} - Ajouter une configuration + {% trans " Add a configuration" %} {% acl_end %} - - - - - - + + + + + + @@ -48,13 +49,13 @@ {% endif %} + {% can_delete pl %} + {% include 'buttons/suppr.html' with href='machines:del-portlist' id=pl.id %} + {% acl_end %} + {%endfor%}
NomTCP (entrée)TCP (sortie)UDP (entrée)UDP (sortie)Machines{% trans "Name" %}{% trans "TCP (input)" %}{% trans "TCP (output)" %}{% trans "UDP (input)" %}{% trans "UDP (output)" %}{% trans "Machines" %}
- {% can_delete pl %} - {% include 'buttons/suppr.html' with href='machines:del-portlist' id=pl.id %} - {% acl_end %} {% can_edit pl %} {% include 'buttons/edit.html' with href='machines:edit-portlist' id=pl.id %} {% acl_end %} -
@@ -63,3 +64,4 @@
{% endblock %} + diff --git a/machines/templates/machines/index_role.html b/machines/templates/machines/index_role.html index 86c36a09..ddc2ea8b 100644 --- a/machines/templates/machines/index_role.html +++ b/machines/templates/machines/index_role.html @@ -27,14 +27,14 @@ with this program; if not, write to the Free Software Foundation, Inc., {% load acl %} {% load i18n %} -{% block title %}Machines{% endblock %} +{% block title %}{% trans "Machines" %}{% endblock %} {% block content %} -

{% trans "Roles list" %}

+

{% trans "List of roles" %}

{% can_create Role %} - {% trans "Add role"%} + {% trans " Add a role"%} {% acl_end %} - {% trans "Delete one or several roles" %} + {% trans " Delete one or several roles" %} {% include "machines/aff_role.html" with role_list=role_list %}

diff --git a/machines/templates/machines/index_service.html b/machines/templates/machines/index_service.html index 3bc88189..9dec7032 100644 --- a/machines/templates/machines/index_service.html +++ b/machines/templates/machines/index_service.html @@ -25,17 +25,18 @@ with this program; if not, write to the Free Software Foundation, Inc., {% load bootstrap3 %} {% load acl %} +{% load i18n %} -{% block title %}Machines{% endblock %} +{% block title %}{% trans "Machines" %}{% endblock %} {% block content %} -

Liste des services

+

{% trans "List of services" %}

{% can_create machines.Service %} - Ajouter un service + {% trans " Add a service" %} {% acl_end %} - Supprimer un ou plusieurs service + {% trans " Delete one or several services" %} {% include "machines/aff_service.html" with service_list=service_list %} -

Etat des serveurs

+

{% trans "States of servers" %}

{% include "machines/aff_servers.html" with servers_list=servers_list %}

diff --git a/machines/templates/machines/index_sshfp.html b/machines/templates/machines/index_sshfp.html index 2c8d1581..ce16d621 100644 --- a/machines/templates/machines/index_sshfp.html +++ b/machines/templates/machines/index_sshfp.html @@ -23,16 +23,17 @@ with this program; if not, write to the Free Software Foundation, Inc., {% load bootstrap3 %} {% load acl %} +{% load i18n %} -{% block title %}Machines{% endblock %} +{% block title %}{% trans "Machines" %}{% endblock %} {% block content %} -

SSH fingerprints

-{% can_create SshFp machine_id %} - - Add an SSH fingerprint - -{% acl_end %} -{% include "machines/aff_sshfp.html" with sshfp_list=sshfp_list %} +

{% trans "SSH fingerprints" %}

+ {% can_create SshFp machine_id %} + + {% trans " Add an SSH fingerprint" %} + + {% acl_end %} + {% include "machines/aff_sshfp.html" with sshfp_list=sshfp_list %} {% endblock %} diff --git a/machines/templates/machines/index_vlan.html b/machines/templates/machines/index_vlan.html index beb6c80e..7af31fd5 100644 --- a/machines/templates/machines/index_vlan.html +++ b/machines/templates/machines/index_vlan.html @@ -26,15 +26,16 @@ with this program; if not, write to the Free Software Foundation, Inc., {% load bootstrap3 %} {% load acl %} +{% load i18n %} -{% block title %}Machines{% endblock %} +{% block title %}{% trans "Machines" %}{% endblock %} {% block content %} -

Liste des vlans

+

{% trans "List of VLANs" %}

{% can_create Vlan %} - Ajouter un vlan + {% trans " Add a VLAN" %} {% acl_end %} - Supprimer un ou plusieurs vlan + {% trans " Delete one or several VLANs" %} {% include "machines/aff_vlan.html" with vlan_list=vlan_list %}

diff --git a/machines/templates/machines/machine.html b/machines/templates/machines/machine.html index d6c0f522..432d11f8 100644 --- a/machines/templates/machines/machine.html +++ b/machines/templates/machines/machine.html @@ -26,8 +26,9 @@ with this program; if not, write to the Free Software Foundation, Inc., {% load bootstrap3 %} {% load massive_bootstrap_form %} +{% load i18n %} -{% block title %}Création et modification de machines{% endblock %} +{% block title %}{% trans "Machines" %}{% endblock %} {% block content %} {% if machineform %} @@ -88,11 +89,11 @@ with this program; if not, write to the Free Software Foundation, Inc.,
{% csrf_token %} {% if machineform %} -

Machine

+

{% trans "Machine" %}

{% massive_bootstrap_form machineform 'user' %} {% endif %} {% if interfaceform %} -

Interface

+

{% trans "Interface" %}

{% if i_mbf_param %} {% massive_bootstrap_form interfaceform 'ipv4,machine' mbf_param=i_mbf_param %} {% else %} @@ -100,55 +101,55 @@ with this program; if not, write to the Free Software Foundation, Inc., {% endif %} {% endif %} {% if domainform %} -

Domaine

+

{% trans "Domain" %}

{% bootstrap_form domainform %} {% endif %} {% if iptypeform %} -

Type d'IP

+

{% trans "IP type" %}

{% bootstrap_form iptypeform %} {% endif %} {% if machinetypeform %} -

Type de machine

+

{% trans "Machine type" %}

{% bootstrap_form machinetypeform %} {% endif %} {% if extensionform %} -

Extension

+

{% trans "Extension" %}

{% massive_bootstrap_form extensionform 'origin' %} {% endif %} {% if soaform %} -

Enregistrement SOA

+

{% trans "SOA record" %}

{% bootstrap_form soaform %} {% endif %} {% if mxform %} -

Enregistrement MX

+

{% trans "MX record" %}

{% massive_bootstrap_form mxform 'name' %} {% endif %} {% if nsform %} -

Enregistrement NS

+

{% trans "NS record" %}

{% massive_bootstrap_form nsform 'ns' %} {% endif %} {% if txtform %} -

Enregistrement TXT

+

{% trans "TXT record" %}

{% bootstrap_form txtform %} {% endif %} {% if dnameform %} -

DNAME record

+

{% trans "DNAME record" %}

{% bootstrap_form dnameform %} {% endif %} {% if srvform %} -

Enregistrement SRV

+

{% trans "SRV record" %}

{% massive_bootstrap_form srvform 'target' %} {% endif %} {% if sshfpform %} -

SSHFP record

+

{% trans "SSHFP record" %}

{% bootstrap_form sshfpform %} {% endif %} {% if aliasform %} -

Alias

+

{% trans "Alias" %}

{% bootstrap_form aliasform %} {% endif %} {% if serviceform %} -

Service

+

{% trans "Service" %}

{% massive_bootstrap_form serviceform 'servers' %} {% endif %} {% if roleform %} @@ -156,15 +157,15 @@ with this program; if not, write to the Free Software Foundation, Inc., {% massive_bootstrap_form roleform 'servers' %} {% endif %} {% if vlanform %} -

Vlan

+

{% trans "VLAN" %}

{% bootstrap_form vlanform %} {% endif %} {% if nasform %} -

NAS

+

{% trans "NAS device" %}

{% bootstrap_form nasform %} {% endif %} {% if ipv6form %} -

Ipv6

+

{% trans "IPv6 address" %}

{% bootstrap_form ipv6form %} {% endif %} {% bootstrap_button action_name button_type="submit" icon="star" %} @@ -173,3 +174,4 @@ with this program; if not, write to the Free Software Foundation, Inc.,

{% endblock %} + diff --git a/machines/templates/machines/sidebar.html b/machines/templates/machines/sidebar.html index 75badb6b..68e14ae0 100644 --- a/machines/templates/machines/sidebar.html +++ b/machines/templates/machines/sidebar.html @@ -30,43 +30,43 @@ with this program; if not, write to the Free Software Foundation, Inc., {% can_view_all Machine %} - Machines + {% trans "Machines" %} {% acl_end %} {% can_view_all MachineType %} - Types de machines + {% trans "Machine types" %} {% acl_end %} {% can_view_all Extension %} - Extensions et zones + {% trans "Extensions and zones" %} {% acl_end %} {% can_view_all IpType %} - Plages d'IP + {% trans "IP ranges" %} {% acl_end %} {% can_view_all Vlan %} - Vlans + {% trans "VLANs" %} {% acl_end %} {% can_view_all Nas %} - Gestion des nas + {% trans "NAS devices" %} {% acl_end %} {% can_view_all machines.Service %} - Services (dhcp, dns...) + {% trans "Services (DHCP, DNS, ...)" %} {% acl_end %} {% can_view_all Role %} @@ -78,7 +78,8 @@ with this program; if not, write to the Free Software Foundation, Inc., {% can_view_all OuverturePortList %} - Ouverture de ports + {% trans "Ports openings" %} {% acl_end %} {% endblock %} + diff --git a/machines/views.py b/machines/views.py index f7d138be..3d71acab 100644 --- a/machines/views.py +++ b/machines/views.py @@ -153,7 +153,7 @@ def generate_ipv4_choices(form_obj): """ f_ipv4 = form_obj.fields['ipv4'] used_mtype_id = [] - choices = '{"":[{key:"",value:"Choisissez d\'abord un type de machine"},' + choices = '{"":[{key:"",value:'+_("Select a machine type first.},") mtype_id = -1 for ip in (f_ipv4.queryset @@ -255,7 +255,7 @@ def new_machine(request, user, **_kwargs): new_interface_obj.save() new_domain.interface_parent = new_interface_obj new_domain.save() - messages.success(request, "La machine a été créée") + messages.success(request, _("The machine was created.")) return redirect(reverse( 'users:profil', kwargs={'userid': str(user.id)} @@ -267,7 +267,7 @@ def new_machine(request, user, **_kwargs): 'interfaceform': interface, 'domainform': domain, 'i_mbf_param': i_mbf_param, - 'action_name': 'Créer une machine' + 'action_name': _("Create a machine") }, 'machines/machine.html', request @@ -307,7 +307,7 @@ def edit_interface(request, interface_instance, **_kwargs): new_interface_obj.save() if domain_form.changed_data: new_domain_obj.save() - messages.success(request, "La machine a été modifiée") + messages.success(request, _("The machine was edited.")) return redirect(reverse( 'users:profil', kwargs={'userid': str(interface_instance.machine.user.id)} @@ -319,7 +319,7 @@ def edit_interface(request, interface_instance, **_kwargs): 'interfaceform': interface_form, 'domainform': domain_form, 'i_mbf_param': i_mbf_param, - 'action_name': 'Editer une interface' + 'action_name': _("Edit") }, 'machines/machine.html', request @@ -332,7 +332,7 @@ def del_machine(request, machine, **_kwargs): """ Supprime une machine, interfaces en mode cascade""" if request.method == "POST": machine.delete() - messages.success(request, "La machine a été détruite") + messages.success(request, _("The machine was deleted.")) return redirect(reverse( 'users:profil', kwargs={'userid': str(machine.user.id)} @@ -361,7 +361,7 @@ def new_interface(request, machine, **_kwargs): new_interface_obj.save() new_domain_obj.interface_parent = new_interface_obj new_domain_obj.save() - messages.success(request, "L'interface a été ajoutée") + messages.success(request, _("The interface was created.")) return redirect(reverse( 'users:profil', kwargs={'userid': str(machine.user.id)} @@ -372,7 +372,7 @@ def new_interface(request, machine, **_kwargs): 'interfaceform': interface_form, 'domainform': domain_form, 'i_mbf_param': i_mbf_param, - 'action_name': 'Créer une interface' + 'action_name': _("Create an interface") }, 'machines/machine.html', request @@ -388,7 +388,7 @@ def del_interface(request, interface, **_kwargs): interface.delete() if not machine.interface_set.all(): machine.delete() - messages.success(request, "L'interface a été détruite") + messages.success(request, _("The interface was deleted.")) return redirect(reverse( 'users:profil', kwargs={'userid': str(request.user.id)} @@ -413,13 +413,13 @@ def new_ipv6list(request, interface, **_kwargs): ) if ipv6.is_valid(): ipv6.save() - messages.success(request, "Ipv6 ajoutée") + messages.success(request, _("The IPv6 addresses list was created.")) return redirect(reverse( 'machines:index-ipv6', kwargs={'interfaceid': str(interface.id)} )) return form( - {'ipv6form': ipv6, 'action_name': 'Créer'}, + {'ipv6form': ipv6, 'action_name': _("Create an IPv6 addresses list")}, 'machines/machine.html', request ) @@ -437,13 +437,13 @@ def edit_ipv6list(request, ipv6list_instance, **_kwargs): if ipv6.is_valid(): if ipv6.changed_data: ipv6.save() - messages.success(request, "Ipv6 modifiée") + messages.success(request, _("The IPv6 addresses list was edited.")) return redirect(reverse( 'machines:index-ipv6', kwargs={'interfaceid': str(ipv6list_instance.interface.id)} )) return form( - {'ipv6form': ipv6, 'action_name': 'Editer'}, + {'ipv6form': ipv6, 'action_name': _("Edit")}, 'machines/machine.html', request ) @@ -456,7 +456,7 @@ def del_ipv6list(request, ipv6list, **_kwargs): if request.method == "POST": interfaceid = ipv6list.interface.id ipv6list.delete() - messages.success(request, "L'ipv6 a été détruite") + messages.success(request, _("The IPv6 addresses list was deleted.")) return redirect(reverse( 'machines:index-ipv6', kwargs={'interfaceid': str(interfaceid)} @@ -480,13 +480,13 @@ def new_sshfp(request, machine, **_kwargs): ) if sshfp.is_valid(): sshfp.save() - messages.success(request, "The SSHFP record was added") + messages.success(request, _("The SSHFP record was created.")) return redirect(reverse( 'machines:index-sshfp', kwargs={'machineid': str(machine.id)} )) return form( - {'sshfpform': sshfp, 'action_name': 'Create'}, + {'sshfpform': sshfp, 'action_name': _("Create a SSHFP record")}, 'machines/machine.html', request ) @@ -503,13 +503,13 @@ def edit_sshfp(request, sshfp_instance, **_kwargs): if sshfp.is_valid(): if sshfp.changed_data: sshfp.save() - messages.success(request, "The SSHFP record was edited") + messages.success(request, _("The SSHFP record was edited.")) return redirect(reverse( 'machines:index-sshfp', kwargs={'machineid': str(sshfp_instance.machine.id)} )) return form( - {'sshfpform': sshfp, 'action_name': 'Edit'}, + {'sshfpform': sshfp, 'action_name': _("Edit")}, 'machines/machine.html', request ) @@ -522,7 +522,7 @@ def del_sshfp(request, sshfp, **_kwargs): if request.method == "POST": machineid = sshfp.machine.id sshfp.delete() - messages.success(request, "The SSHFP record was deleted") + messages.success(request, _("The SSHFP record was deleted.")) return redirect(reverse( 'machines:index-sshfp', kwargs={'machineid': str(machineid)} @@ -543,10 +543,10 @@ def add_iptype(request): iptype = IpTypeForm(request.POST or None) if iptype.is_valid(): iptype.save() - messages.success(request, "Ce type d'ip a été ajouté") + messages.success(request, _("The IP type was created.")) return redirect(reverse('machines:index-iptype')) return form( - {'iptypeform': iptype, 'action_name': 'Créer'}, + {'iptypeform': iptype, 'action_name': _("Create an IP type")}, 'machines/machine.html', request ) @@ -562,10 +562,10 @@ def edit_iptype(request, iptype_instance, **_kwargs): if iptype.is_valid(): if iptype.changed_data: iptype.save() - messages.success(request, "Type d'ip modifié") + messages.success(request, _("The IP type was edited.")) return redirect(reverse('machines:index-iptype')) return form( - {'iptypeform': iptype, 'action_name': 'Editer'}, + {'iptypeform': iptype, 'action_name': _("Edit")}, 'machines/machine.html', request ) @@ -581,16 +581,16 @@ def del_iptype(request, instances): for iptype_del in iptype_dels: try: iptype_del.delete() - messages.success(request, "Le type d'ip a été supprimé") + messages.success(request, _("The IP type was deleted.")) except ProtectedError: messages.error( request, - ("Le type d'ip %s est affectée à au moins une machine, " - "vous ne pouvez pas le supprimer" % iptype_del) + (_("The IP type %s is assigned to at least one machine," + " you can't delete it.") % iptype_del) ) return redirect(reverse('machines:index-iptype')) return form( - {'iptypeform': iptype, 'action_name': 'Supprimer'}, + {'iptypeform': iptype, 'action_name': _("Delete")}, 'machines/machine.html', request ) @@ -603,10 +603,11 @@ def add_machinetype(request): machinetype = MachineTypeForm(request.POST or None) if machinetype.is_valid(): machinetype.save() - messages.success(request, "Ce type de machine a été ajouté") + messages.success(request, _("The machine type was created.")) return redirect(reverse('machines:index-machinetype')) return form( - {'machinetypeform': machinetype, 'action_name': 'Créer'}, + {'machinetypeform': machinetype, 'action_name': _("Create a machine" + " type")}, 'machines/machine.html', request ) @@ -623,10 +624,10 @@ def edit_machinetype(request, machinetype_instance, **_kwargs): if machinetype.is_valid(): if machinetype.changed_data: machinetype.save() - messages.success(request, "Type de machine modifié") + messages.success(request, _("The machine type was edited.")) return redirect(reverse('machines:index-machinetype')) return form( - {'machinetypeform': machinetype, 'action_name': 'Editer'}, + {'machinetypeform': machinetype, 'action_name': _("Edit")}, 'machines/machine.html', request ) @@ -642,17 +643,16 @@ def del_machinetype(request, instances): for machinetype_del in machinetype_dels: try: machinetype_del.delete() - messages.success(request, "Le type de machine a été supprimé") + messages.success(request, _("The machine type was deleted.")) except ProtectedError: messages.error( request, - ("Le type de machine %s est affectée à au moins une " - "machine, vous ne pouvez pas le supprimer" - % machinetype_del) + (_("The machine type %s is assigned to at least one" + " machine, you can't delete it.") % machinetype_del) ) return redirect(reverse('machines:index-machinetype')) return form( - {'machinetypeform': machinetype, 'action_name': 'Supprimer'}, + {'machinetypeform': machinetype, 'action_name': _("Delete")}, 'machines/machine.html', request ) @@ -665,10 +665,10 @@ def add_extension(request): extension = ExtensionForm(request.POST or None) if extension.is_valid(): extension.save() - messages.success(request, "Cette extension a été ajoutée") + messages.success(request, _("The extension was created.")) return redirect(reverse('machines:index-extension')) return form( - {'extensionform': extension, 'action_name': 'Créer'}, + {'extensionform': extension, 'action_name': _("Create an extension")}, 'machines/machine.html', request ) @@ -685,10 +685,10 @@ def edit_extension(request, extension_instance, **_kwargs): if extension.is_valid(): if extension.changed_data: extension.save() - messages.success(request, "Extension modifiée") + messages.success(request, _("The extension was edited.")) return redirect(reverse('machines:index-extension')) return form( - {'extensionform': extension, 'action_name': 'Editer'}, + {'extensionform': extension, 'action_name': _("Edit")}, 'machines/machine.html', request ) @@ -704,17 +704,16 @@ def del_extension(request, instances): for extension_del in extension_dels: try: extension_del.delete() - messages.success(request, "L'extension a été supprimée") + messages.success(request, _("The extension was deleted.")) except ProtectedError: messages.error( request, - ("L'extension %s est affectée à au moins un type de " - "machine, vous ne pouvez pas la supprimer" - % extension_del) + (_("The extension %s is assigned to at least one machine" + " type, you can't delete it." % extension_del)) ) return redirect(reverse('machines:index-extension')) return form( - {'extensionform': extension, 'action_name': 'Supprimer'}, + {'extensionform': extension, 'action_name': _("Delete")}, 'machines/machine.html', request ) @@ -727,10 +726,10 @@ def add_soa(request): soa = SOAForm(request.POST or None) if soa.is_valid(): soa.save() - messages.success(request, "Cet enregistrement SOA a été ajouté") + messages.success(request, _("The SOA record was created.")) return redirect(reverse('machines:index-extension')) return form( - {'soaform': soa, 'action_name': 'Créer'}, + {'soaform': soa, 'action_name': _("Create an SOA record")}, 'machines/machine.html', request ) @@ -744,10 +743,10 @@ def edit_soa(request, soa_instance, **_kwargs): if soa.is_valid(): if soa.changed_data: soa.save() - messages.success(request, "SOA modifié") + messages.success(request, _("The SOA record was edited.")) return redirect(reverse('machines:index-extension')) return form( - {'soaform': soa, 'action_name': 'Editer'}, + {'soaform': soa, 'action_name': _("Edit")}, 'machines/machine.html', request ) @@ -763,16 +762,15 @@ def del_soa(request, instances): for soa_del in soa_dels: try: soa_del.delete() - messages.success(request, "Le SOA a été supprimée") + messages.success(request, _("The SOA record was deleted.")) except ProtectedError: messages.error( request, - ("Erreur le SOA suivant %s ne peut être supprimé" - % soa_del) + (_("Error: the SOA record %s can't be deleted.") % soa_del) ) return redirect(reverse('machines:index-extension')) return form( - {'soaform': soa, 'action_name': 'Supprimer'}, + {'soaform': soa, 'action_name': _("Delete")}, 'machines/machine.html', request ) @@ -785,10 +783,10 @@ def add_mx(request): mx = MxForm(request.POST or None) if mx.is_valid(): mx.save() - messages.success(request, "Cet enregistrement mx a été ajouté") + messages.success(request, _("The MX record was created.")) return redirect(reverse('machines:index-extension')) return form( - {'mxform': mx, 'action_name': 'Créer'}, + {'mxform': mx, 'action_name': _("Create an MX record")}, 'machines/machine.html', request ) @@ -802,10 +800,10 @@ def edit_mx(request, mx_instance, **_kwargs): if mx.is_valid(): if mx.changed_data: mx.save() - messages.success(request, "Mx modifié") + messages.success(request, _("The MX record was edited.")) return redirect(reverse('machines:index-extension')) return form( - {'mxform': mx, 'action_name': 'Editer'}, + {'mxform': mx, 'action_name': _("Edit")}, 'machines/machine.html', request ) @@ -821,16 +819,15 @@ def del_mx(request, instances): for mx_del in mx_dels: try: mx_del.delete() - messages.success(request, "L'mx a été supprimée") + messages.success(request, _("The MX record was deleted.")) except ProtectedError: messages.error( request, - ("Erreur le Mx suivant %s ne peut être supprimé" - % mx_del) + (_("Error: the MX record %s can't be deleted.") % mx_del) ) return redirect(reverse('machines:index-extension')) return form( - {'mxform': mx, 'action_name': 'Supprimer'}, + {'mxform': mx, 'action_name': _("Delete")}, 'machines/machine.html', request ) @@ -843,10 +840,10 @@ def add_ns(request): ns = NsForm(request.POST or None) if ns.is_valid(): ns.save() - messages.success(request, "Cet enregistrement ns a été ajouté") + messages.success(request, _("The NS record was created.")) return redirect(reverse('machines:index-extension')) return form( - {'nsform': ns, 'action_name': 'Créer'}, + {'nsform': ns, 'action_name': _("Create an NS record")}, 'machines/machine.html', request ) @@ -860,10 +857,10 @@ def edit_ns(request, ns_instance, **_kwargs): if ns.is_valid(): if ns.changed_data: ns.save() - messages.success(request, "Ns modifié") + messages.success(request, _("The NS record was edited.")) return redirect(reverse('machines:index-extension')) return form( - {'nsform': ns, 'action_name': 'Editer'}, + {'nsform': ns, 'action_name': _("Edit")}, 'machines/machine.html', request ) @@ -879,16 +876,15 @@ def del_ns(request, instances): for ns_del in ns_dels: try: ns_del.delete() - messages.success(request, "Le ns a été supprimée") + messages.success(request, _("The NS record was deleted.")) except ProtectedError: messages.error( request, - ("Erreur le Ns suivant %s ne peut être supprimé" - % ns_del) + (_("Error: the NS record %s can't be deleted.") % ns_del) ) return redirect(reverse('machines:index-extension')) return form( - {'nsform': ns, 'action_name': 'Supprimer'}, + {'nsform': ns, 'action_name': _("Delete")}, 'machines/machine.html', request ) @@ -900,10 +896,10 @@ def add_dname(request): dname = DNameForm(request.POST or None) if dname.is_valid(): dname.save() - messages.success(request, "This DNAME record has been added") + messages.success(request, _("The DNAME record was created.")) return redirect(reverse('machines:index-extension')) return form( - {'dnameform': dname, 'action_name': "Create"}, + {'dnameform': dname, 'action_name': _("Create a DNAME record")}, 'machines/machine.html', request ) @@ -917,10 +913,10 @@ def edit_dname(request, dname_instance, **_kwargs): if dname.is_valid(): if dname.changed_data: dname.save() - messages.success(request, "DName successfully edited") + messages.success(request, _("The DNAME record was edited.")) return redirect(reverse('machines:index-extension')) return form( - {'dnameform': dname, 'action_name': "Edit"}, + {'dnameform': dname, 'action_name': _("Edit")}, 'machines/machine.html', request ) @@ -936,16 +932,16 @@ def del_dname(request, instances): for dname_del in dname_dels: try: dname_del.delete() - messages.success(request, - "The DNAME %s has been deleted" % dname_del) + messages.success(request, _("The DNAME record was deleted.")) except ProtectedError: messages.error( - request, - "The DNAME %s can not be deleted" % dname_del + request, + _("Error: the DNAME record %s can't be deleted.") + % dname_del ) return redirect(reverse('machines:index-extension')) return form( - {'dnameform': dname, 'action_name': 'Delete'}, + {'dnameform': dname, 'action_name': _("Delete")}, 'machines/machine.html', request ) @@ -958,10 +954,10 @@ def add_txt(request): txt = TxtForm(request.POST or None) if txt.is_valid(): txt.save() - messages.success(request, "Cet enregistrement text a été ajouté") + messages.success(request, _("The TXT record was created.")) return redirect(reverse('machines:index-extension')) return form( - {'txtform': txt, 'action_name': 'Créer'}, + {'txtform': txt, 'action_name': _("Create a TXT record")}, 'machines/machine.html', request ) @@ -975,10 +971,10 @@ def edit_txt(request, txt_instance, **_kwargs): if txt.is_valid(): if txt.changed_data: txt.save() - messages.success(request, "Txt modifié") + messages.success(request, _("The TXT record was edited.")) return redirect(reverse('machines:index-extension')) return form( - {'txtform': txt, 'action_name': 'Editer'}, + {'txtform': txt, 'action_name': _("Edit")}, 'machines/machine.html', request ) @@ -994,16 +990,15 @@ def del_txt(request, instances): for txt_del in txt_dels: try: txt_del.delete() - messages.success(request, "Le txt a été supprimé") + messages.success(request, _("The TXT record was deleted.")) except ProtectedError: messages.error( request, - ("Erreur le Txt suivant %s ne peut être supprimé" - % txt_del) + (_("Error: the TXT record %s can't be deleted.") % txt_del) ) return redirect(reverse('machines:index-extension')) return form( - {'txtform': txt, 'action_name': 'Supprimer'}, + {'txtform': txt, 'action_name': _("Delete")}, 'machines/machine.html', request ) @@ -1016,10 +1011,10 @@ def add_srv(request): srv = SrvForm(request.POST or None) if srv.is_valid(): srv.save() - messages.success(request, "Cet enregistrement srv a été ajouté") + messages.success(request, _("The SRV record was created.")) return redirect(reverse('machines:index-extension')) return form( - {'srvform': srv, 'action_name': 'Créer'}, + {'srvform': srv, 'action_name': _("Create an SRV record")}, 'machines/machine.html', request ) @@ -1033,10 +1028,10 @@ def edit_srv(request, srv_instance, **_kwargs): if srv.is_valid(): if srv.changed_data: srv.save() - messages.success(request, "Srv modifié") - return redirect(reverse('machines:index-extension')) + messages.success(request, _("The SRV record was edited.")) + return redirect(reverse('machines:1index-extension')) return form( - {'srvform': srv, 'action_name': 'Editer'}, + {'srvform': srv, 'action_name': _("Edit")}, 'machines/machine.html', request ) @@ -1052,16 +1047,15 @@ def del_srv(request, instances): for srv_del in srv_dels: try: srv_del.delete() - messages.success(request, "L'srv a été supprimée") + messages.success(request, _("The SRV record was deleted.")) except ProtectedError: messages.error( request, - ("Erreur le Srv suivant %s ne peut être supprimé" - % srv_del) + (_("Error: the SRV record %s can't be deleted.") % srv_del) ) return redirect(reverse('machines:index-extension')) return form( - {'srvform': srv, 'action_name': 'Supprimer'}, + {'srvform': srv, 'action_name': _("Delete")}, 'machines/machine.html', request ) @@ -1077,13 +1071,13 @@ def add_alias(request, interface, interfaceid): alias = alias.save(commit=False) alias.cname = interface.domain alias.save() - messages.success(request, "Cet alias a été ajouté") + messages.success(request, _("The alias was created.")) return redirect(reverse( 'machines:index-alias', kwargs={'interfaceid': str(interfaceid)} )) return form( - {'aliasform': alias, 'action_name': 'Créer'}, + {'aliasform': alias, 'action_name': _("Create an alias")}, 'machines/machine.html', request ) @@ -1101,7 +1095,7 @@ def edit_alias(request, domain_instance, **_kwargs): if alias.is_valid(): if alias.changed_data: domain_instance = alias.save() - messages.success(request, "Alias modifié") + messages.success(request, _("The alias was edited.")) return redirect(reverse( 'machines:index-alias', kwargs={ @@ -1109,7 +1103,7 @@ def edit_alias(request, domain_instance, **_kwargs): } )) return form( - {'aliasform': alias, 'action_name': 'Editer'}, + {'aliasform': alias, 'action_name': _("Edit")}, 'machines/machine.html', request ) @@ -1127,20 +1121,19 @@ def del_alias(request, interface, interfaceid): alias_del.delete() messages.success( request, - "L'alias %s a été supprimé" % alias_del + _("The alias %s was deleted.") % alias_del ) except ProtectedError: messages.error( request, - ("Erreur l'alias suivant %s ne peut être supprimé" - % alias_del) + (_("Error: the alias %s can't be deleted.") % alias_del) ) return redirect(reverse( 'machines:index-alias', kwargs={'interfaceid': str(interfaceid)} )) return form( - {'aliasform': alias, 'action_name': 'Supprimer'}, + {'aliasform': alias, 'action_name': _("Delete")}, 'machines/machine.html', request ) @@ -1153,10 +1146,10 @@ def add_role(request): role = RoleForm(request.POST or None) if role.is_valid(): role.save() - messages.success(request, "Cet enregistrement role a été ajouté") + messages.success(request, _("The role was created.")) return redirect(reverse('machines:index-role')) return form( - {'roleform': role, 'action_name': 'Créer'}, + {'roleform': role, 'action_name': _("Create a role")}, 'machines/machine.html', request ) @@ -1170,10 +1163,10 @@ def edit_role(request, role_instance, **_kwargs): if role.is_valid(): if role.changed_data: role.save() - messages.success(request, _("Role updated")) + messages.success(request, _("The role was edited.")) return redirect(reverse('machines:index-role')) return form( - {'roleform': role, 'action_name': _('Edit')}, + {'roleform': role, 'action_name': _("Edit")}, 'machines/machine.html', request ) @@ -1189,17 +1182,15 @@ def del_role(request, instances): for role_del in role_dels: try: role_del.delete() - messages.success(request, _("The role has been deleted.")) + messages.success(request, _("The role was deleted.")) except ProtectedError: messages.error( request, - (_("Error: The following role cannot be deleted: %(role)") - % {'role': role_del} - ) + (_("Error: the role %s can't be deleted.") % role_del) ) return redirect(reverse('machines:index-role')) return form( - {'roleform': role, 'action_name': _('Delete')}, + {'roleform': role, 'action_name': _("Delete")}, 'machines/machine.html', request ) @@ -1212,10 +1203,10 @@ def add_service(request): service = ServiceForm(request.POST or None) if service.is_valid(): service.save() - messages.success(request, "Cet enregistrement service a été ajouté") + messages.success(request, _("The service was created.")) return redirect(reverse('machines:index-service')) return form( - {'serviceform': service, 'action_name': 'Créer'}, + {'serviceform': service, 'action_name': _("Create a service")}, 'machines/machine.html', request ) @@ -1229,10 +1220,10 @@ def edit_service(request, service_instance, **_kwargs): if service.is_valid(): if service.changed_data: service.save() - messages.success(request, "Service modifié") + messages.success(request, _("The service was edited.")) return redirect(reverse('machines:index-service')) return form( - {'serviceform': service, 'action_name': 'Editer'}, + {'serviceform': service, 'action_name': _("Edit")}, 'machines/machine.html', request ) @@ -1248,16 +1239,15 @@ def del_service(request, instances): for service_del in service_dels: try: service_del.delete() - messages.success(request, "Le service a été supprimée") + messages.success(request, _("The service was deleted.")) except ProtectedError: messages.error( request, - ("Erreur le service suivant %s ne peut être supprimé" - % service_del) + (_("Error: the service %s can't be deleted.") % service_del) ) return redirect(reverse('machines:index-service')) return form( - {'serviceform': service, 'action_name': 'Supprimer'}, + {'serviceform': service, 'action_name': _("Delete")}, 'machines/machine.html', request ) @@ -1279,10 +1269,10 @@ def add_vlan(request): vlan = VlanForm(request.POST or None) if vlan.is_valid(): vlan.save() - messages.success(request, "Cet enregistrement vlan a été ajouté") + messages.success(request, _("The VLAN was created.")) return redirect(reverse('machines:index-vlan')) return form( - {'vlanform': vlan, 'action_name': 'Créer'}, + {'vlanform': vlan, 'action_name': _("Create a VLAN")}, 'machines/machine.html', request ) @@ -1296,10 +1286,10 @@ def edit_vlan(request, vlan_instance, **_kwargs): if vlan.is_valid(): if vlan.changed_data: vlan.save() - messages.success(request, "Vlan modifié") + messages.success(request, _("The VLAN was edited.")) return redirect(reverse('machines:index-vlan')) return form( - {'vlanform': vlan, 'action_name': 'Editer'}, + {'vlanform': vlan, 'action_name': _("Edit")}, 'machines/machine.html', request ) @@ -1315,16 +1305,15 @@ def del_vlan(request, instances): for vlan_del in vlan_dels: try: vlan_del.delete() - messages.success(request, "Le vlan a été supprimée") + messages.success(request, _("The VLAN was deleted.")) except ProtectedError: messages.error( request, - ("Erreur le Vlan suivant %s ne peut être supprimé" - % vlan_del) + (_("Error: the VLAN %s can't be deleted.") % vlan_del) ) return redirect(reverse('machines:index-vlan')) return form( - {'vlanform': vlan, 'action_name': 'Supprimer'}, + {'vlanform': vlan, 'action_name': _("Delete")}, 'machines/machine.html', request ) @@ -1337,10 +1326,10 @@ def add_nas(request): nas = NasForm(request.POST or None) if nas.is_valid(): nas.save() - messages.success(request, "Cet enregistrement nas a été ajouté") + messages.success(request, _("The NAS device was created.")) return redirect(reverse('machines:index-nas')) return form( - {'nasform': nas, 'action_name': 'Créer'}, + {'nasform': nas, 'action_name': _("Create a NAS device")}, 'machines/machine.html', request ) @@ -1354,10 +1343,10 @@ def edit_nas(request, nas_instance, **_kwargs): if nas.is_valid(): if nas.changed_data: nas.save() - messages.success(request, "Nas modifié") + messages.success(request, _("The NAS device was edited.")) return redirect(reverse('machines:index-nas')) return form( - {'nasform': nas, 'action_name': 'Editer'}, + {'nasform': nas, 'action_name': _("Edit")}, 'machines/machine.html', request ) @@ -1373,16 +1362,15 @@ def del_nas(request, instances): for nas_del in nas_dels: try: nas_del.delete() - messages.success(request, "Le nas a été supprimé") + messages.success(request, _("The NAS device was deleted.")) except ProtectedError: messages.error( request, - ("Erreur le Nas suivant %s ne peut être supprimé" - % nas_del) + (_("Error: the NAS device %s can't be deleted.") % nas_del) ) return redirect(reverse('machines:index-nas')) return form( - {'nasform': nas, 'action_name': 'Supprimer'}, + {'nasform': nas, 'action_name': _("Delete")}, 'machines/machine.html', request ) @@ -1634,7 +1622,7 @@ def edit_portlist(request, ouvertureportlist_instance, **_kwargs): for port in instances: port.port_list = pl port.save() - messages.success(request, "Liste de ports modifiée") + messages.success(request, _("The ports list was edited.")) return redirect(reverse('machines:index-portlist')) return form( {'port_list': port_list, 'ports': port_formset}, @@ -1648,7 +1636,7 @@ def edit_portlist(request, ouvertureportlist_instance, **_kwargs): def del_portlist(request, port_list_instance, **_kwargs): """ View used to delete a port policy """ port_list_instance.delete() - messages.success(request, "La liste de ports a été supprimée") + messages.success(request, _("The ports list was deleted.")) return redirect(reverse('machines:index-portlist')) @@ -1673,7 +1661,7 @@ def add_portlist(request): for port in instances: port.port_list = pl port.save() - messages.success(request, "Liste de ports créée") + messages.success(request, _("The ports list was created.")) return redirect(reverse('machines:index-portlist')) return form( {'port_list': port_list, 'ports': port_formset}, @@ -1691,8 +1679,8 @@ def configure_ports(request, interface_instance, **_kwargs): if not interface_instance.may_have_port_open(): messages.error( request, - ("Attention, l'ipv4 n'est pas publique, l'ouverture n'aura pas " - "d'effet en v4") + (_("Warning: the IPv4 isn't public, the opening won't have effect" + " in v4.")) ) interface = EditOuverturePortConfigForm( request.POST or None, @@ -1701,10 +1689,11 @@ def configure_ports(request, interface_instance, **_kwargs): if interface.is_valid(): if interface.changed_data: interface.save() - messages.success(request, "Configuration des ports mise à jour.") + messages.success(request, _("The ports configuration was edited.")) return redirect(reverse('machines:index')) return form( - {'interfaceform': interface, 'action_name': 'Editer la configuration'}, + {'interfaceform': interface, 'action_name': _("Edit the" + " configuration")}, 'machines/machine.html', request ) @@ -1950,3 +1939,4 @@ def regen_achieved(request): if obj: obj.first().done_regen() return HttpResponse("Ok") +