From 2ecf6b86f1d4cf72886b19b0f95ed820f7d189b2 Mon Sep 17 00:00:00 2001 From: Laouen Fernet Date: Sun, 5 Aug 2018 18:48:56 +0200 Subject: [PATCH] Translation of topologie/ (front) --- topologie/acl.py | 5 +- topologie/forms.py | 4 +- topologie/locale/fr/LC_MESSAGES/django.mo | Bin 0 -> 14067 bytes topologie/locale/fr/LC_MESSAGES/django.po | 842 ++++++++++++++++++ .../migrations/0062_auto_20180815_1918.py | 146 +++ topologie/models.py | 146 +-- topologie/templates/topologie/aff_ap.html | 58 +- .../templates/topologie/aff_building.html | 13 +- .../templates/topologie/aff_chambres.html | 17 +- .../topologie/aff_constructor_switch.html | 13 +- .../templates/topologie/aff_model_switch.html | 18 +- topologie/templates/topologie/aff_port.html | 123 +-- .../templates/topologie/aff_port_profile.html | 25 +- topologie/templates/topologie/aff_stacks.html | 55 +- topologie/templates/topologie/aff_switch.html | 78 +- .../templates/topologie/aff_switch_bay.html | 56 +- topologie/templates/topologie/delete.html | 9 +- .../templates/topologie/edit_stack_sw.html | 48 +- topologie/templates/topologie/index.html | 10 +- topologie/templates/topologie/index_ap.html | 8 +- .../topologie/index_model_switch.html | 12 +- topologie/templates/topologie/index_p.html | 12 +- .../topologie/index_physical_grouping.html | 16 +- .../topologie/index_portprofile.html | 3 +- topologie/templates/topologie/index_room.html | 8 +- topologie/templates/topologie/sidebar.html | 14 +- topologie/templates/topologie/switch.html | 11 +- topologie/templates/topologie/topo.html | 6 +- topologie/templates/topologie/topo_more.html | 13 +- topologie/views.py | 148 +-- 30 files changed, 1507 insertions(+), 410 deletions(-) create mode 100644 topologie/locale/fr/LC_MESSAGES/django.mo create mode 100644 topologie/locale/fr/LC_MESSAGES/django.po create mode 100644 topologie/migrations/0062_auto_20180815_1918.py diff --git a/topologie/acl.py b/topologie/acl.py index ebef17c9..62e51d8a 100644 --- a/topologie/acl.py +++ b/topologie/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('topologie') - 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/topologie/forms.py b/topologie/forms.py index 86b5c541..fa089507 100644 --- a/topologie/forms.py +++ b/topologie/forms.py @@ -176,8 +176,8 @@ class EditRoomForm(FormRevMixin, ModelForm): class CreatePortsForm(forms.Form): """Permet de créer une liste de ports pour un switch.""" - begin = forms.IntegerField(label="Début :", min_value=0) - end = forms.IntegerField(label="Fin :", min_value=0) + begin = forms.IntegerField(label=_("Start:"), min_value=0) + end = forms.IntegerField(label=_("End:"), min_value=0) class EditModelSwitchForm(FormRevMixin, ModelForm): diff --git a/topologie/locale/fr/LC_MESSAGES/django.mo b/topologie/locale/fr/LC_MESSAGES/django.mo new file mode 100644 index 0000000000000000000000000000000000000000..c7ef4c2e7db3ddb76a90e85db64b2c6fa05bc545 GIT binary patch literal 14067 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\n" +"Language-Team: \n" +"Language: \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:179 +msgid "Start:" +msgstr "Début :" + +#: forms.py:180 +msgid "End:" +msgstr "Fin :" + +#: models.py:69 +msgid "Can view a stack object" +msgstr "Peut voir un objet pile" + +#: models.py:71 +msgid "switches stack" +msgstr "pile de commutateurs réseau" + +#: models.py:72 +msgid "switches stacks" +msgstr "piles de commutateurs réseau" + +#: models.py:87 +msgid "The maximum ID is less than the minimum ID." +msgstr "L'ID maximum est inférieur l'ID minimum." + +#: models.py:100 +msgid "Details about the AP's location" +msgstr "Détails sur l'emplacement du point d'accès sans fil" + +#: models.py:107 +msgid "Can view an access point object" +msgstr "Peut voir un objet point d'accès sans fil" + +#: models.py:109 +msgid "access point" +msgstr "point d'accès sans fil" + +#: models.py:110 +msgid "access points" +msgstr "points d'accès sans fil" + +#: models.py:206 +msgid "Number of ports" +msgstr "Nombre de ports" + +#: models.py:223 templates/topologie/aff_switch.html:48 views.py:803 +msgid "Switch model" +msgstr "Modèle de commutateur réseau" + +#: models.py:235 +msgid "Can view a switch object" +msgstr "Peut voir un objet commutateur réseau" + +#: models.py:237 +msgid "switch" +msgstr "commutateur réseau" + +#: models.py:238 +msgid "switches" +msgstr "commutateurs réseau" + +#: models.py:249 +msgid "The switch ID exceeds the limits allowed by the stack." +msgstr "L'ID du commutateur réseau dépasse les bornes autorisées par la pile." + +#: models.py:254 +msgid "The stack member ID can't be void." +msgstr "L'ID de membre dans la pile ne peut-être vide." + +#: models.py:270 +msgid "The end port is less than the start port." +msgstr "Le port de fin est inférieur au port de début." + +#: models.py:273 +msgid "This switch can't have that many ports." +msgstr "Ce commutateur réseau ne peut pas avoir autant de ports." + +#: models.py:283 +msgid "Creation" +msgstr "Création" + +#: models.py:285 +msgid "Creation of an existing port." +msgstr "Création d'un port existant." + +#: models.py:310 +msgid "Can view a switch model object" +msgstr "Peut voir un objet modèle de commutateur réseau" + +#: models.py:312 +msgid "switch model" +msgstr "modèle de commutateur réseau" + +#: models.py:313 +msgid "switch models" +msgstr "modèles de commutateur réseau" + +#: models.py:326 +msgid "Can view a switch constructor object" +msgstr "Peut voir un objet constructeur de commutateur réseau" + +#: models.py:329 +msgid "switch constructor" +msgstr "constructeur de commutateur réseau" + +#: models.py:352 +msgid "Can view a switch bay object" +msgstr "Peut voir un objet baie de brassage" + +#: models.py:354 +msgid "switch bay" +msgstr "baie de brassage" + +#: models.py:355 +msgid "switch bays" +msgstr "baies de brassage" + +#: models.py:368 +msgid "Can view a building object" +msgstr "Peut voir un objet bâtiment" + +#: models.py:370 +msgid "building" +msgstr "bâtiment" + +#: models.py:371 +msgid "buildings" +msgstr "bâtiments" + +#: models.py:427 +msgid "Port state Active" +msgstr "État du port Actif" + +#: models.py:434 +msgid "Can view a port object" +msgstr "Peut voir un objet port" + +#: models.py:436 +msgid "port" +msgstr "port" + +#: models.py:437 +msgid "ports" +msgstr "ports" + +#: models.py:504 +msgid "The port can't exist, its number is too great." +msgstr "Le port ne peut pas exister, son numéro est trop grand." + +#: models.py:510 +msgid "Room, interface and related port are mutually exclusive." +msgstr "Chambre, interface et port relié sont mutuellement exclusifs." + +#: models.py:513 +msgid "A port can't be related to itself." +msgstr "Un port ne peut être relié à lui-même." + +#: models.py:517 +msgid "" +"The related port is already used, please clear it before creating the " +"relation." +msgstr "" +"Le port relié est déjà utilisé, veuillez le modifier avant de créer la " +"relation." + +#: models.py:538 +msgid "Can view a room object" +msgstr "Peut voir un objet chambre" + +#: models.py:540 +msgid "room" +msgstr "chambre" + +#: models.py:541 +msgid "rooms" +msgstr "chambres" + +#: models.py:575 templates/topologie/aff_port_profile.html:37 +msgid "Name" +msgstr "Nom" + +#: models.py:582 +msgid "Default profile" +msgstr "Profil par défaut" + +#: models.py:590 +msgid "VLAN untagged" +msgstr "VLAN untagged" + +#: models.py:596 +msgid "VLAN(s) tagged" +msgstr "VLAN(s) tagged" + +#: models.py:601 +msgid "Type of RADIUS authentication : inactive, MAC-address or 802.1X" +msgstr "Type d'authentification RADIUS : inactive, MAC-address ou 802.1X" + +#: models.py:603 +msgid "RADIUS type" +msgstr "Type de RADIUS" + +#: models.py:609 +msgid "In case of MAC-authentication : mode COMMON or STRICT on this port" +msgstr "" +"Dans le cas d'authentification par adresse MAC : mode COMMON ou STRICT sur " +"ce port" + +#: models.py:611 +msgid "RADIUS mode" +msgstr "Mode de RADIUS" + +#: models.py:617 +msgid "Port speed limit" +msgstr "Limite de vitesse du port" + +#: models.py:622 +msgid "Limit of MAC-address on this port" +msgstr "Limite de MAC-address sur ce port" + +#: models.py:623 +msgid "MAC limit" +msgstr "Limite MAC" + +#: models.py:627 +msgid "Flow control" +msgstr "Contrôle du flux" + +#: models.py:631 +msgid "Protect against rogue DHCP" +msgstr "Protège contre les DHCP pirates" + +#: models.py:632 +msgid "DHCP snooping" +msgstr "DHCP snooping" + +#: models.py:636 +msgid "Protect against rogue DHCPv6" +msgstr "Protège contre les DHCPv6 pirates" + +#: models.py:637 +msgid "DHCPv6 snooping" +msgstr "DHCPv6 snooping" + +#: models.py:641 +msgid "Check if IP adress is DHCP assigned" +msgstr "Vérifie si l'adresse IP est attribuée par DHCP" + +#: models.py:642 +msgid "ARP protection" +msgstr "Protection ARP" + +#: models.py:646 +msgid "Protect against rogue RA" +msgstr "Protège contre les RA pirates" + +#: models.py:647 +msgid "RA guard" +msgstr "RA guard" + +#: models.py:651 +msgid "Protect against loop" +msgstr "Protège contre un boucle" + +#: models.py:652 +msgid "Loop protection" +msgstr "Protection contre une boucle" + +#: models.py:657 +msgid "Can view a port profile object" +msgstr "Peut voir un objet profil de port" + +#: models.py:659 +msgid "port profile" +msgstr "profil de port" + +#: models.py:660 +msgid "port profiles" +msgstr "profils de port" + +#: templates/topologie/aff_ap.html:36 +msgid "Access point" +msgstr "Point d'accès sans fil" + +#: templates/topologie/aff_ap.html:38 +msgid "MAC address" +msgstr "Adresse MAC" + +#: templates/topologie/aff_ap.html:40 templates/topologie/aff_switch.html:39 +msgid "IPv4 address" +msgstr "Adresse IPv4" + +#: templates/topologie/aff_ap.html:42 templates/topologie/aff_chambres.html:38 +#: templates/topologie/aff_port.html:43 templates/topologie/aff_stacks.html:36 +#: templates/topologie/aff_switch.html:49 +#: templates/topologie/edit_stack_sw.html:34 +msgid "Details" +msgstr "Détails" + +#: templates/topologie/aff_ap.html:43 +msgid "Location" +msgstr "Emplacement" + +#: templates/topologie/aff_ap.html:56 templates/topologie/aff_building.html:46 +#: templates/topologie/aff_chambres.html:48 +#: templates/topologie/aff_constructor_switch.html:46 +#: templates/topologie/aff_model_switch.html:49 +#: templates/topologie/aff_port.html:91 templates/topologie/aff_stacks.html:55 +#: templates/topologie/aff_switch_bay.html:59 +#: templates/topologie/edit_stack_sw.html:44 views.py:357 views.py:411 +#: views.py:722 views.py:781 views.py:836 views.py:891 views.py:950 +#: views.py:1005 +msgid "Edit" +msgstr "Modifier" + +#: templates/topologie/aff_ap.html:62 templates/topologie/aff_building.html:52 +#: templates/topologie/aff_chambres.html:54 +#: templates/topologie/aff_constructor_switch.html:52 +#: templates/topologie/aff_model_switch.html:55 +#: templates/topologie/aff_port.html:97 templates/topologie/aff_stacks.html:61 +#: templates/topologie/aff_switch_bay.html:65 +#: templates/topologie/edit_stack_sw.html:50 +msgid "Delete" +msgstr "Supprimer" + +#: templates/topologie/aff_building.html:36 +#: templates/topologie/aff_switch_bay.html:38 views.py:913 +msgid "Building" +msgstr "Bâtiment" + +#: templates/topologie/aff_chambres.html:36 +#: templates/topologie/aff_port.html:35 views.py:744 +msgid "Room" +msgstr "Chambre" + +#: templates/topologie/aff_constructor_switch.html:36 +#: templates/topologie/aff_model_switch.html:38 views.py:973 +msgid "Switch constructor" +msgstr "Constructeur de commutateur réseau" + +#: templates/topologie/aff_model_switch.html:36 +msgid "Reference" +msgstr "Référence" + +#: templates/topologie/aff_port.html:33 +msgid "Port" +msgstr "Port" + +#: templates/topologie/aff_port.html:37 +msgid "Interface" +msgstr "Interface" + +#: templates/topologie/aff_port.html:39 +msgid "Related port" +msgstr "Port relié" + +#: templates/topologie/aff_port.html:41 +msgid "Port state" +msgstr "État du port" + +#: templates/topologie/aff_port.html:42 views.py:1025 +msgid "Port profile" +msgstr "Profil de port" + +#: templates/topologie/aff_port.html:77 +msgid "Active" +msgstr "Actif" + +#: templates/topologie/aff_port.html:79 +msgid "Disabled" +msgstr "Désactivé" + +#: templates/topologie/aff_port.html:84 +msgid "Default: " +msgstr "Par défaut : " + +#: templates/topologie/aff_port_profile.html:38 +msgid "Default for" +msgstr "Par défaut pour" + +#: templates/topologie/aff_port_profile.html:39 +msgid "VLANs" +msgstr "VLANs" + +#: templates/topologie/aff_port_profile.html:40 +msgid "RADIUS settings" +msgstr "Paramètres RADIUS" + +#: templates/topologie/aff_port_profile.html:41 +msgid "Speed limit" +msgstr "Limite de vitesse" + +#: templates/topologie/aff_port_profile.html:42 +msgid "MAC address limit" +msgstr "Limite d'adresse MAC" + +#: templates/topologie/aff_port_profile.html:43 +msgid "Security" +msgstr "Sécurité" + +#: templates/topologie/aff_port_profile.html:53 +msgid "Untagged: " +msgstr "Untagged :" + +#: templates/topologie/aff_port_profile.html:57 +msgid "Tagged: " +msgstr "Tagged : " + +#: templates/topologie/aff_port_profile.html:61 +msgid "RADIUS type: " +msgstr "Type de RADIUS : " + +#: templates/topologie/aff_port_profile.html:64 +msgid "RADIUS mode: " +msgstr "Mode de RADIUS : " + +#: templates/topologie/aff_stacks.html:32 +#: templates/topologie/aff_switch.html:45 +#: templates/topologie/edit_stack_sw.html:32 +msgid "Stack" +msgstr "Pile" + +#: templates/topologie/aff_stacks.html:34 +msgid "ID" +msgstr "ID" + +#: templates/topologie/aff_stacks.html:37 +msgid "Members" +msgstr "Membres" + +#: templates/topologie/aff_switch.html:37 templates/topologie/topo_more.html:56 +msgid "DNS name" +msgstr "Nom DNS" + +#: templates/topologie/aff_switch.html:41 +#: templates/topologie/aff_switch_bay.html:36 views.py:858 +msgid "Switch bay" +msgstr "Baie de brassage" + +#: templates/topologie/aff_switch.html:43 +msgid "Ports" +msgstr "Ports" + +#: templates/topologie/aff_switch.html:47 +#: templates/topologie/edit_stack_sw.html:33 +msgid "Stack ID" +msgstr "ID de la pile" + +#: templates/topologie/aff_switch.html:76 +msgid "Creation of ports" +msgstr "Création de ports" + +#: templates/topologie/aff_switch_bay.html:40 +msgid "Information" +msgstr "Informations" + +#: templates/topologie/aff_switch_bay.html:41 +msgid "Switches of the bay" +msgstr "Commutateurs réseau de la baie" + +#: templates/topologie/delete.html:29 templates/topologie/index.html:30 +#: templates/topologie/index_ap.html:30 +#: templates/topologie/index_model_switch.html:30 +#: templates/topologie/index_p.html:30 +#: templates/topologie/index_physical_grouping.html:30 +#: templates/topologie/index_portprofile.html:29 +#: templates/topologie/index_room.html:30 templates/topologie/switch.html:30 +#: templates/topologie/topo.html:30 templates/topologie/topo_more.html:30 +msgid "Topology" +msgstr "Topologie" + +#: templates/topologie/delete.html:35 +#, python-format +msgid "" +"Warning: are you sure you want to delete this %(objet_name)s object " +"( %(objet)s )?" +msgstr "" +"Attention : voulez-vous vraiment supprimer cet objet %(objet_name)s " +"( %(objet)s ) ?" + +#: templates/topologie/delete.html:36 +msgid "Confirm" +msgstr "Confirmer" + +#: templates/topologie/index.html:55 +msgid "Topology of the switches" +msgstr "Topologie des commutateurs réseau" + +#: templates/topologie/index.html:66 templates/topologie/sidebar.html:35 +msgid "Switches" +msgstr "Commutateurs réseau" + +#: templates/topologie/index.html:68 +msgid " Add a switch" +msgstr " Ajouter un commutateur réseau" + +#: templates/topologie/index_ap.html:33 templates/topologie/sidebar.html:43 +msgid "Access points" +msgstr "Points d'accès sans fil" + +#: templates/topologie/index_ap.html:35 +msgid " Add an access point" +msgstr " Ajouter un point d'accès sans fil" + +#: templates/topologie/index_model_switch.html:33 +msgid "Switch models" +msgstr "Modèles de commutateur réseau" + +#: templates/topologie/index_model_switch.html:36 +msgid " Add a switch model" +msgstr " Ajouter un modèle de commutateur réseau" + +#: templates/topologie/index_model_switch.html:42 +msgid "Switch constructors" +msgstr "Constructeurs de commutateur réseau" + +#: templates/topologie/index_model_switch.html:45 +msgid " Add a switch constructor" +msgstr " Ajouter un constructeur de commutateur réseau" + +#: templates/topologie/index_p.html:33 +msgid "Switch:" +msgstr "Commutateur réseau :" + +#: templates/topologie/index_p.html:34 +msgid " Edit" +msgstr " Modifier" + +#: templates/topologie/index_p.html:36 +msgid " Add a port" +msgstr " Ajouter un port" + +#: templates/topologie/index_p.html:37 +msgid " Add ports" +msgstr " Ajouter des ports" + +#: templates/topologie/index_physical_grouping.html:33 +msgid "Stacks" +msgstr "Piles" + +#: templates/topologie/index_physical_grouping.html:36 +msgid " Add a stack" +msgstr " Ajouter une pile" + +#: templates/topologie/index_physical_grouping.html:41 +msgid "Switch bays" +msgstr "Baies de brassage" + +#: templates/topologie/index_physical_grouping.html:44 +msgid " Add a switch bay" +msgstr " Ajouter une baie de brassage" + +#: templates/topologie/index_physical_grouping.html:50 +msgid "Buildings" +msgstr "Bâtiments" + +#: templates/topologie/index_physical_grouping.html:53 +msgid " Add a building" +msgstr " Ajouter un bâtiment" + +#: templates/topologie/index_portprofile.html:33 +#: templates/topologie/sidebar.html:39 +msgid "Port profiles" +msgstr "Profils de port" + +#: templates/topologie/index_portprofile.html:35 +msgid " Add a port profile" +msgstr " Ajouter un profil de port" + +#: templates/topologie/index_room.html:33 +msgid "Rooms" +msgstr "Chambres" + +#: templates/topologie/index_room.html:35 +msgid " Add a room" +msgstr " Ajouter une chambre" + +#: templates/topologie/sidebar.html:31 +msgid "Rooms and premises" +msgstr "Chambres et locaux" + +#: templates/topologie/sidebar.html:47 +msgid "Physical grouping" +msgstr "Groupements physiques" + +#: templates/topologie/sidebar.html:51 +msgid "Switch models and constructors" +msgstr "Modèles et constructeurs de commutateur réseau" + +#: templates/topologie/switch.html:39 templates/topologie/topo.html:36 +msgid " Go to the ports list" +msgstr " Aller à la liste des ports" + +#: templates/topologie/switch.html:43 +msgid "Specific settings for the switch" +msgstr "Réglages spécifiques pour le commutateur réseau" + +#: templates/topologie/switch.html:46 views.py:395 views.py:987 +msgid "Create" +msgstr "Créer" + +#: templates/topologie/topo_more.html:48 +#, python-format +msgid "Specific settings for the %(device)s object" +msgstr "Réglages spécifiques pour l'objet %(device)s" + +#: templates/topologie/topo_more.html:52 +#, python-format +msgid "General settings for the machine linked to the %(device)s object" +msgstr "Réglages généraux pour la machine liée à l'objet %(device)s" + +#: templates/topologie/topo_more.html:59 +msgid "Create or edit" +msgstr "Créer ou modifier" + +#: views.py:317 +msgid "Nonexistent switch." +msgstr "Commutateur réseau inexistant." + +#: views.py:325 +msgid "The port was added." +msgstr "Le port a été ajouté." + +#: views.py:327 +msgid "The port already exists." +msgstr "Le port existe déjà." + +#: views.py:333 views.py:705 views.py:760 views.py:819 views.py:874 +#: views.py:929 +msgid "Add" +msgstr "Ajouter" + +#: views.py:348 +msgid "The port was edited." +msgstr "Le port a été modifié." + +#: views.py:371 +msgid "The port was deleted." +msgstr "Le port a été supprimé." + +#: views.py:375 +#, python-format +msgid "The port %s is used by another object, impossible to delete it." +msgstr "Le port %s est utilisé par un autre objet, impossible de le supprimer." + +#: views.py:392 +msgid "The stack was created." +msgstr "La pile a été créée." + +#: views.py:424 +msgid "The stack was deleted." +msgstr "La pile a été supprimée." + +#: views.py:428 +#, python-format +msgid "The stack %s is used by another object, impossible to deleted it." +msgstr "" +"La pile %s est utilisée par un autre objet, impossible de la supprimer." + +#: views.py:470 views.py:611 views.py:666 +msgid "" +"The organisation's user doesn't exist yet, please create or link it in the " +"preferences." +msgstr "" +"L'utilisateur de l'association n'existe pas encore, veuillez le créer ou le " +"relier dans les préférences." + +#: views.py:485 +msgid "The switch was created." +msgstr "Le commutateur réseau a été créé." + +#: views.py:508 +msgid "Nonexistent switch" +msgstr "Commutateur réseau inexistant." + +#: views.py:528 +msgid "The ports were created." +msgstr "Les ports ont été créés." + +#: views.py:572 +msgid "The switch was edited." +msgstr "Le commutateur réseau a été modifié." + +#: views.py:626 +msgid "The access point was created." +msgstr "Le point d'accès sans fil a été créé." + +#: views.py:679 +msgid "The access point was edited." +msgstr "Le point d'accès sans fil a été modifié." + +#: views.py:702 +msgid "The room was created." +msgstr "La chambre a été créée." + +#: views.py:719 +msgid "The room was edited." +msgstr "La chambre a été modifiée." + +#: views.py:735 +msgid "The room was deleted." +msgstr "La chambre a été supprimée." + +#: views.py:739 +#, python-format +msgid "The room %s is used by another object, impossible to deleted it." +msgstr "" +"La chambre %s est utilisée par un autre objet, impossible de la supprimer." + +#: views.py:757 +msgid "The swich model was created." +msgstr "Le modèle de commutateur réseau a été créé." + +#: views.py:778 +msgid "The switch model was edited." +msgstr "Le modèle de commutateur réseau a été modifié." + +#: views.py:794 +msgid "The switch model was deleted." +msgstr "Le modèle de commutateur réseau a été supprimé." + +#: views.py:798 +#, python-format +msgid "The switch model %s is used by another object, impossible to delete it." +msgstr "" +"Le modèle de commutateur réseau %s est utilisé par un autre objet, " +"impossible de le supprimer." + +#: views.py:816 +msgid "The switch bay was created." +msgstr "La baie de brassage a été créée." + +#: views.py:833 +msgid "The switch bay was edited." +msgstr "La baie de brassage a été modifiée." + +#: views.py:849 +msgid "The switch bay was deleted." +msgstr "La baie de brassage a été supprimée." + +#: views.py:853 +#, python-format +msgid "The switch bay %s is used by another object, impossible to delete it." +msgstr "" +"La baie de brassage %s est utilisée par un autre objet, impossible de la " +"supprimer." + +#: views.py:871 +msgid "The building was created." +msgstr "Le bâtiment a été créé." + +#: views.py:888 +msgid "The building was edited." +msgstr "Le bâtiment a été modifié." + +#: views.py:904 +msgid "The building was deleted." +msgstr "Le bâtiment a été supprimé." + +#: views.py:908 +#, python-format +msgid "The building %s is used by another object, impossible to delete it." +msgstr "" +"Le bâtiment %s est utilisé par un autre objet, impossible de le supprimer." + +#: views.py:926 +msgid "The switch constructor was created." +msgstr "Le constructeur de commutateur réseau a été créé." + +#: views.py:947 +msgid "The switch constructor was edited." +msgstr "Le constructeur de commutateur réseau a été modifié." + +#: views.py:963 +msgid "The switch constructor was deleted." +msgstr "Le constructeur de commutateur réseau a été supprimé." + +#: views.py:967 +#, python-format +msgid "" +"The switch constructor %s is used by another object, impossible to delete it." +msgstr "" +"Le constructeur de commutateur réseau %s est utilisé par un autre objet, " +"impossible de le supprimer." + +#: views.py:984 +msgid "The port profile was created." +msgstr "Le profil de port a été créé." + +#: views.py:1002 +msgid "The port profile was edited." +msgstr "Le profil de port a été modifié." + +#: views.py:1019 +msgid "The port profile was deleted." +msgstr "Le profil de port a été supprimé." + +#: views.py:1022 +msgid "Impossible to delete the port profile." +msgstr "Impossible de supprimer le profil de port." + +#: views.py:1142 +msgid "" +"The default Django template isn't used. This can lead to rendering errors. " +"Check the parameters." +msgstr "" +"Le gabarit par défaut de Django n'est pas utilisé. Cela peut entraîner des " +"erreurs de rendu. Vérifiez les paramètres." diff --git a/topologie/migrations/0062_auto_20180815_1918.py b/topologie/migrations/0062_auto_20180815_1918.py new file mode 100644 index 00000000..fc100258 --- /dev/null +++ b/topologie/migrations/0062_auto_20180815_1918.py @@ -0,0 +1,146 @@ +# -*- coding: utf-8 -*- +# Generated by Django 1.10.7 on 2018-08-15 17:18 +from __future__ import unicode_literals + +from django.db import migrations, models +import django.db.models.deletion + + +class Migration(migrations.Migration): + + dependencies = [ + ('topologie', '0061_portprofile'), + ] + + operations = [ + migrations.AlterModelOptions( + name='accesspoint', + options={'permissions': (('view_accesspoint', 'Can view an access point object'),), 'verbose_name': 'access point', 'verbose_name_plural': 'access points'}, + ), + migrations.AlterModelOptions( + name='building', + options={'permissions': (('view_building', 'Can view a building object'),), 'verbose_name': 'building', 'verbose_name_plural': 'buildings'}, + ), + migrations.AlterModelOptions( + name='constructorswitch', + options={'permissions': (('view_constructorswitch', 'Can view a switch constructor object'),), 'verbose_name': 'switch constructor', 'verbose_name_plural': 'switch constructors'}, + ), + migrations.AlterModelOptions( + name='modelswitch', + options={'permissions': (('view_modelswitch', 'Can view a switch model object'),), 'verbose_name': 'switch model', 'verbose_name_plural': 'switch models'}, + ), + migrations.AlterModelOptions( + name='port', + options={'permissions': (('view_port', 'Can view a port object'),), 'verbose_name': 'port', 'verbose_name_plural': 'ports'}, + ), + migrations.AlterModelOptions( + name='portprofile', + options={'permissions': (('view_port_profile', 'Can view a port profile object'),), 'verbose_name': 'port profile', 'verbose_name_plural': 'port profiles'}, + ), + migrations.AlterModelOptions( + name='room', + options={'ordering': ['name'], 'permissions': (('view_room', 'Can view a room object'),), 'verbose_name': 'room', 'verbose_name_plural': 'rooms'}, + ), + migrations.AlterModelOptions( + name='stack', + options={'permissions': (('view_stack', 'Can view a stack object'),), 'verbose_name': 'switches stack', 'verbose_name_plural': 'switches stacks'}, + ), + migrations.AlterModelOptions( + name='switch', + options={'permissions': (('view_switch', 'Can view a switch object'),), 'verbose_name': 'switch', 'verbose_name_plural': 'switches'}, + ), + migrations.AlterModelOptions( + name='switchbay', + options={'permissions': (('view_switchbay', 'Can view a switch bay object'),), 'verbose_name': 'switch bay', 'verbose_name_plural': 'switch bays'}, + ), + migrations.AlterField( + model_name='accesspoint', + name='location', + field=models.CharField(blank=True, help_text="Details about the AP's location", max_length=255, null=True), + ), + migrations.AlterField( + model_name='port', + name='state', + field=models.BooleanField(default=True, help_text='Port state Active', verbose_name='Port state Active'), + ), + migrations.AlterField( + model_name='portprofile', + name='arp_protect', + field=models.BooleanField(default=False, help_text='Check if IP adress is DHCP assigned', verbose_name='ARP protection'), + ), + migrations.AlterField( + model_name='portprofile', + name='dhcp_snooping', + field=models.BooleanField(default=False, help_text='Protect against rogue DHCP', verbose_name='DHCP snooping'), + ), + migrations.AlterField( + model_name='portprofile', + name='dhcpv6_snooping', + field=models.BooleanField(default=False, help_text='Protect against rogue DHCPv6', verbose_name='DHCPv6 snooping'), + ), + migrations.AlterField( + model_name='portprofile', + name='flow_control', + field=models.BooleanField(default=False, help_text='Flow control'), + ), + migrations.AlterField( + model_name='portprofile', + name='loop_protect', + field=models.BooleanField(default=False, help_text='Protect against loop', verbose_name='Loop protection'), + ), + migrations.AlterField( + model_name='portprofile', + name='mac_limit', + field=models.IntegerField(blank=True, help_text='Limit of MAC-address on this port', null=True, verbose_name='MAC limit'), + ), + migrations.AlterField( + model_name='portprofile', + name='profil_default', + field=models.CharField(blank=True, choices=[('room', 'room'), ('accespoint', 'accesspoint'), ('uplink', 'uplink'), ('asso_machine', 'asso_machine'), ('nothing', 'nothing')], max_length=32, null=True, unique=True, verbose_name='Default profile'), + ), + migrations.AlterField( + model_name='portprofile', + name='ra_guard', + field=models.BooleanField(default=False, help_text='Protect against rogue RA', verbose_name='RA guard'), + ), + migrations.AlterField( + model_name='portprofile', + name='radius_mode', + field=models.CharField(choices=[('STRICT', 'STRICT'), ('COMMON', 'COMMON')], default='COMMON', help_text='In case of MAC-authentication : mode COMMON or STRICT on this port', max_length=32, verbose_name='RADIUS mode'), + ), + migrations.AlterField( + model_name='portprofile', + name='radius_type', + field=models.CharField(choices=[('NO', 'NO'), ('802.1X', '802.1X'), ('MAC-radius', 'MAC-radius')], help_text='Type of RADIUS authentication : inactive, MAC-address or 802.1X', max_length=32, verbose_name='RADIUS type'), + ), + migrations.AlterField( + model_name='portprofile', + name='speed', + field=models.CharField(choices=[('10-half', '10-half'), ('100-half', '100-half'), ('10-full', '10-full'), ('100-full', '100-full'), ('1000-full', '1000-full'), ('auto', 'auto'), ('auto-10', 'auto-10'), ('auto-100', 'auto-100')], default='auto', help_text='Port speed limit', max_length=32), + ), + migrations.AlterField( + model_name='switch', + name='model', + field=models.ForeignKey(blank=True, help_text='Switch model', null=True, on_delete=django.db.models.deletion.SET_NULL, to='topologie.ModelSwitch'), + ), + migrations.AlterField( + model_name='switch', + name='number', + field=models.PositiveIntegerField(help_text='Number of ports'), + ), + migrations.AlterField( + model_name='switch', + name='stack_member_id', + field=models.PositiveIntegerField(blank=True, null=True), + ), + migrations.AlterField( + model_name='switch', + name='switchbay', + field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, to='topologie.SwitchBay'), + ), + migrations.AlterField( + model_name='switchbay', + name='info', + field=models.CharField(blank=True, max_length=255, null=True), + ), + ] diff --git a/topologie/models.py b/topologie/models.py index 89b3e6a9..b63bece6 100644 --- a/topologie/models.py +++ b/topologie/models.py @@ -57,7 +57,6 @@ class Stack(AclMixin, RevMixin, models.Model): """Un objet stack. Regrouppe des switchs en foreign key ,contient une id de stack, un switch id min et max dans le stack""" - PRETTY_NAME = "Stack de switchs" name = models.CharField(max_length=32, blank=True, null=True) stack_id = models.CharField(max_length=32, unique=True) @@ -67,8 +66,10 @@ class Stack(AclMixin, RevMixin, models.Model): class Meta: permissions = ( - ("view_stack", "Peut voir un objet stack"), + ("view_stack", _("Can view a stack object")), ) + verbose_name = _("switches stack") + verbose_name_plural = _("switches stacks") def __str__(self): return " ".join([self.name, self.stack_id]) @@ -82,8 +83,10 @@ class Stack(AclMixin, RevMixin, models.Model): def clean(self): """ Verification que l'id_max < id_min""" if self.member_id_max < self.member_id_min: - raise ValidationError({'member_id_max': "L'id maximale est\ - inférieure à l'id minimale"}) + raise ValidationError( + {'member_id_max': _("The maximum ID is less than the" + " minimum ID.")} + ) class AccessPoint(AclMixin, Machine): @@ -91,19 +94,20 @@ class AccessPoint(AclMixin, Machine): Definition pour une borne wifi , hérite de machines.interfaces """ - PRETTY_NAME = "Borne WiFi" location = models.CharField( max_length=255, - help_text="Détails sur la localisation de l'AP", + help_text=_("Details about the AP's location"), blank=True, null=True ) class Meta: permissions = ( - ("view_accesspoint", "Peut voir une borne"), + ("view_accesspoint", _("Can view an access point object")), ) + verbose_name = _("access point") + verbose_name_plural = _("access points") def port(self): """Return the queryset of ports for this device""" @@ -197,10 +201,9 @@ class Switch(AclMixin, Machine): Validation au save que l'id du stack est bien dans le range id_min id_max de la stack parente""" - PRETTY_NAME = "Switch / Commutateur" number = models.PositiveIntegerField( - help_text="Nombre de ports" + help_text=_("Number of ports") ) stack = models.ForeignKey( 'topologie.Stack', @@ -210,29 +213,29 @@ class Switch(AclMixin, Machine): ) stack_member_id = models.PositiveIntegerField( blank=True, - null=True, - help_text="Baie de brassage du switch" + null=True ) model = models.ForeignKey( 'topologie.ModelSwitch', blank=True, null=True, on_delete=models.SET_NULL, - help_text="Modèle du switch" + help_text=_("Switch model") ) switchbay = models.ForeignKey( 'topologie.SwitchBay', blank=True, null=True, on_delete=models.SET_NULL, - help_text="Baie de brassage du switch" ) class Meta: unique_together = ('stack', 'stack_member_id') permissions = ( - ("view_switch", "Peut voir un objet switch"), + ("view_switch", _("Can view a switch object")), ) + verbose_name = _("switch") + verbose_name_plural = _("switches") def clean(self): """ Verifie que l'id stack est dans le bon range @@ -243,12 +246,14 @@ class Switch(AclMixin, Machine): if (self.stack_member_id > self.stack.member_id_max) or\ (self.stack_member_id < self.stack.member_id_min): raise ValidationError( - {'stack_member_id': "L'id de ce switch est en\ - dehors des bornes permises pas la stack"} - ) + {'stack_member_id': _("The switch ID exceeds the" + " limits allowed by the stack.")} + ) else: - raise ValidationError({'stack_member_id': "L'id dans la stack\ - ne peut être nul"}) + raise ValidationError( + {'stack_member_id': _("The stack member ID can't be" + " void.")} + ) def create_ports(self, begin, end): """ Crée les ports de begin à end si les valeurs données @@ -262,9 +267,10 @@ class Switch(AclMixin, Machine): s_end = ports.last().get('port') if end < begin: - raise ValidationError("Port de fin inférieur au port de début !") + raise ValidationError(_("The end port is less than the start" + " port.")) if end - begin > self.number: - raise ValidationError("Ce switch ne peut avoir autant de ports.") + raise ValidationError(_("This switch can't have that many ports.")) begin_range = range(begin, s_begin) end_range = range(s_end+1, end+1) for i in itertools.chain(begin_range, end_range): @@ -274,9 +280,9 @@ class Switch(AclMixin, Machine): try: with transaction.atomic(), reversion.create_revision(): port.save() - reversion.set_comment("Création") + reversion.set_comment(_("Creation")) except IntegrityError: - ValidationError("Création d'un port existant.") + ValidationError(_("Creation of an existing port.")) def main_interface(self): """ Returns the 'main' interface of the switch """ @@ -292,7 +298,7 @@ class Switch(AclMixin, Machine): class ModelSwitch(AclMixin, RevMixin, models.Model): """Un modèle (au sens constructeur) de switch""" - PRETTY_NAME = "Modèle de switch" + reference = models.CharField(max_length=255) constructor = models.ForeignKey( 'topologie.ConstructorSwitch', @@ -301,8 +307,10 @@ class ModelSwitch(AclMixin, RevMixin, models.Model): class Meta: permissions = ( - ("view_modelswitch", "Peut voir un objet modelswitch"), + ("view_modelswitch", _("Can view a switch model object")), ) + verbose_name = _("switch model") + verbose_name_plural = _("switch models") def __str__(self): return str(self.constructor) + ' ' + self.reference @@ -310,13 +318,16 @@ class ModelSwitch(AclMixin, RevMixin, models.Model): class ConstructorSwitch(AclMixin, RevMixin, models.Model): """Un constructeur de switch""" - PRETTY_NAME = "Constructeur de switch" + name = models.CharField(max_length=255) class Meta: permissions = ( - ("view_constructorswitch", "Peut voir un objet constructorswitch"), + ("view_constructorswitch", _("Can view a switch constructor" + " object")), ) + verbose_name = _("switch constructor") + verbose_name_plural = ("switch constructors") def __str__(self): return self.name @@ -324,7 +335,7 @@ class ConstructorSwitch(AclMixin, RevMixin, models.Model): class SwitchBay(AclMixin, RevMixin, models.Model): """Une baie de brassage""" - PRETTY_NAME = "Baie de brassage" + name = models.CharField(max_length=255) building = models.ForeignKey( 'Building', @@ -333,14 +344,15 @@ class SwitchBay(AclMixin, RevMixin, models.Model): info = models.CharField( max_length=255, blank=True, - null=True, - help_text="Informations particulières" + null=True ) class Meta: permissions = ( - ("view_switchbay", "Peut voir un objet baie de brassage"), + ("view_switchbay", _("Can view a switch bay object")), ) + verbose_name = _("switch bay") + verbose_name_plural = _("switch bays") def __str__(self): return self.name @@ -348,13 +360,15 @@ class SwitchBay(AclMixin, RevMixin, models.Model): class Building(AclMixin, RevMixin, models.Model): """Un batiment""" - PRETTY_NAME = "Batiment" + name = models.CharField(max_length=255) class Meta: permissions = ( - ("view_building", "Peut voir un objet batiment"), + ("view_building", _("Can view a building object")), ) + verbose_name = _("building") + verbose_name_plural = _("buildings") def __str__(self): return self.name @@ -376,7 +390,6 @@ class Port(AclMixin, RevMixin, models.Model): - vlan_force : override la politique générale de placement vlan, permet de forcer un port sur un vlan particulier. S'additionne à la politique RADIUS""" - PRETTY_NAME = "Port de switch" switch = models.ForeignKey( 'Switch', @@ -411,15 +424,17 @@ class Port(AclMixin, RevMixin, models.Model): state = models.BooleanField( default=True, help_text='Port state Active', - verbose_name=_("Port State Active") + verbose_name=_("Port state Active") ) details = models.CharField(max_length=255, blank=True) class Meta: unique_together = ('switch', 'port') permissions = ( - ("view_port", "Peut voir un objet port"), + ("view_port", _("Can view a port object")), ) + verbose_name = _("port") + verbose_name_plural = _("ports") @cached_property def get_port_profile(self): @@ -486,22 +501,21 @@ class Port(AclMixin, RevMixin, models.Model): if hasattr(self, 'switch'): if self.port > self.switch.number: raise ValidationError( - "Ce port ne peut exister, numero trop élevé" + _("The port can't exist, its number is too great.") ) if (self.room and self.machine_interface or self.room and self.related or self.machine_interface and self.related): raise ValidationError( - "Chambre, interface et related_port sont mutuellement " - "exclusifs" + _("Room, interface and related port are mutually exclusive.") ) if self.related == self: - raise ValidationError("On ne peut relier un port à lui même") + raise ValidationError(_("A port can't be related to itself.")) if self.related and not self.related.related: if self.related.machine_interface or self.related.room: raise ValidationError( - "Le port relié est déjà occupé, veuillez le libérer " - "avant de créer une relation" + _("The related port is already used, please clear it" + " before creating the relation.") ) else: self.make_port_related() @@ -514,7 +528,6 @@ class Port(AclMixin, RevMixin, models.Model): class Room(AclMixin, RevMixin, models.Model): """Une chambre/local contenant une prise murale""" - PRETTY_NAME = "Chambre/ Prise murale" name = models.CharField(max_length=255, unique=True) details = models.CharField(max_length=255, blank=True) @@ -522,8 +535,10 @@ class Room(AclMixin, RevMixin, models.Model): class Meta: ordering = ['name'] permissions = ( - ("view_room", "Peut voir un objet chambre"), + ("view_room", _("Can view a room object")), ) + verbose_name = _("room") + verbose_name_plural = _("rooms") def __str__(self): return self.name @@ -564,7 +579,7 @@ class PortProfile(AclMixin, RevMixin, models.Model): blank=True, null=True, unique=True, - verbose_name=_("profil default") + verbose_name=_("Default profile") ) vlan_untagged = models.ForeignKey( 'machines.Vlan', @@ -583,66 +598,66 @@ class PortProfile(AclMixin, RevMixin, models.Model): radius_type = models.CharField( max_length=32, choices=TYPES, - help_text="Type of radius auth : inactive, mac-address or 802.1X", + help_text=_("Type of RADIUS authentication : inactive, MAC-address or" + " 802.1X"), verbose_name=_("RADIUS type") ) radius_mode = models.CharField( max_length=32, choices=MODES, default='COMMON', - help_text="In case of mac-auth : mode common or strict on this port", + help_text=_("In case of MAC-authentication : mode COMMON or STRICT on" + " this port"), verbose_name=_("RADIUS mode") ) speed = models.CharField( max_length=32, choices=SPEED, default='auto', - help_text='Port speed limit', - verbose_name=_("Speed") + help_text=_("Port speed limit"), ) mac_limit = models.IntegerField( null=True, blank=True, - help_text='Limit of mac-address on this port', - verbose_name=_("Mac limit") + help_text=_("Limit of MAC-address on this port"), + verbose_name=_("MAC limit") ) flow_control = models.BooleanField( default=False, - help_text='Flow control', - verbose_name=_("Flow control") + help_text=_("Flow control"), ) dhcp_snooping = models.BooleanField( default=False, - help_text='Protect against rogue dhcp', - verbose_name=_("Dhcp snooping") + help_text=_("Protect against rogue DHCP"), + verbose_name=_("DHCP snooping") ) dhcpv6_snooping = models.BooleanField( default=False, - help_text='Protect against rogue dhcpv6', - verbose_name=_("Dhcpv6 snooping") + help_text=_("Protect against rogue DHCPv6"), + verbose_name=_("DHCPv6 snooping") ) arp_protect = models.BooleanField( default=False, - help_text='Check if ip is dhcp assigned', - verbose_name=_("Arp protect") + help_text=_("Check if IP adress is DHCP assigned"), + verbose_name=_("ARP protection") ) ra_guard = models.BooleanField( default=False, - help_text='Protect against rogue ra', - verbose_name=_("Ra guard") + help_text=_("Protect against rogue RA"), + verbose_name=_("RA guard") ) loop_protect = models.BooleanField( default=False, - help_text='Protect again loop', - verbose_name=_("Loop Protect") + help_text=_("Protect against loop"), + verbose_name=_("Loop protection") ) class Meta: permissions = ( ("view_port_profile", _("Can view a port profile object")), ) - verbose_name = _("Port profile") - verbose_name_plural = _("Port profiles") + verbose_name = _("port profile") + verbose_name_plural = _("port profiles") security_parameters_fields = [ 'loop_protect', @@ -727,3 +742,4 @@ def switch_post_save(**_kwargs): @receiver(post_delete, sender=Switch) def switch_post_delete(**_kwargs): regen("graph_topo") + diff --git a/topologie/templates/topologie/aff_ap.html b/topologie/templates/topologie/aff_ap.html index 18a419d3..4eadfede 100644 --- a/topologie/templates/topologie/aff_ap.html +++ b/topologie/templates/topologie/aff_ap.html @@ -24,50 +24,52 @@ with this program; if not, write to the Free Software Foundation, Inc., {% load acl %} {% load logs_extra %} +{% load i18n %}
{% if ap_list.paginator %} {% include "pagination.html" with list=ap_list %} {% endif %} - - - - - - - + {% trans "Access point" as tr_ap %} + + {% trans "MAC address" as tr_mac %} + + {% trans "IPv4 address" as tr_ip %} + + + {% for ap in ap_list %} - - - - - - - - + + + + + + + + {% endfor %}
{% include "buttons/sort.html" with prefix='ap' col='name' text='Borne' %}{% include "buttons/sort.html" with prefix='ap' col='mac' text='Addresse mac' %}{% include "buttons/sort.html" with prefix='ap' col='ip' text='Ipv4' %}CommentaireLocalisation{% include "buttons/sort.html" with prefix='ap' col='name' text=tr_ap %}{% include "buttons/sort.html" with prefix='ap' col='mac' text=tr_mac %}{% include "buttons/sort.html" with prefix='ap' col='ip' text=tr_ip %}{% trans "Details" %}{% trans "Location" %}
{{ap.interface_set.first}}{{ap.interface_set.first.mac_address}}{{ap.interface_set.first.ipv4}}{{ap.interface_set.first.details}}{{ap.location}} - {% history_button ap %} - {% can_edit ap %} - - - - {% acl_end %} - {% can_delete ap %} - - - - {% acl_end %} -
{{ ap.interface_set.first }}{{ ap.interface_set.first.mac_address }}{{ ap.interface_set.first.ipv4 }}{{ ap.interface_set.first.details }}{{ ap.location }} + {% can_edit ap %} + + + + {% acl_end %} + {% history_button ap %} + {% can_delete ap %} + + + + {% acl_end %} +
- {% if ap_list.paginator %} {% include "pagination.html" with list=ap_list %} {% endif %}
+ diff --git a/topologie/templates/topologie/aff_building.html b/topologie/templates/topologie/aff_building.html index f0e02135..368887f5 100644 --- a/topologie/templates/topologie/aff_building.html +++ b/topologie/templates/topologie/aff_building.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 building_list.paginator %} {% include "pagination.html" with list=building_list %} @@ -32,22 +33,23 @@ with this program; if not, write to the Free Software Foundation, Inc., - + {% trans "Building" as tr_building %} + {% for building in building_list %} - +
{% include "buttons/sort.html" with prefix='building' col='name' text='Bâtiment' %}{% include "buttons/sort.html" with prefix='building' col='name' text=tr_building %}
{{building.name}}{{ building.name }} - {% history_button building %} {% can_edit building %} - + {% acl_end %} + {% history_button building %} {% can_delete building %} - + {% acl_end %} @@ -59,3 +61,4 @@ with this program; if not, write to the Free Software Foundation, Inc., {% if building_list.paginator %} {% include "pagination.html" with list=building_list %} {% endif %} + diff --git a/topologie/templates/topologie/aff_chambres.html b/topologie/templates/topologie/aff_chambres.html index f71d6927..04c010f4 100644 --- a/topologie/templates/topologie/aff_chambres.html +++ b/topologie/templates/topologie/aff_chambres.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 room_list.paginator %} {% include "pagination.html" with list=room_list %} @@ -32,24 +33,25 @@ with this program; if not, write to the Free Software Foundation, Inc., - - + {% trans "Room" as tr_room %} + + {% for room in room_list %} - - + +
{% include "buttons/sort.html" with prefix='room' col='name' text='Chambre' %}Commentaire{% include "buttons/sort.html" with prefix='room' col='name' text=tr_room %}{% trans "Details" %}
{{room.name}}{{room.details}}{{ room.name }}{{ room.details }} - {% history_button room %} {% can_edit room %} - + {% acl_end %} + {% history_button room %} {% can_delete room %} - + {% acl_end %} @@ -61,3 +63,4 @@ with this program; if not, write to the Free Software Foundation, Inc., {% if room_list.paginator %} {% include "pagination.html" with list=room_list %} {% endif %} + diff --git a/topologie/templates/topologie/aff_constructor_switch.html b/topologie/templates/topologie/aff_constructor_switch.html index 1b9f5d19..6298f73d 100644 --- a/topologie/templates/topologie/aff_constructor_switch.html +++ b/topologie/templates/topologie/aff_constructor_switch.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 constructor_switch_list.paginator %} {% include "pagination.html" with list=constructor_switch_list %} @@ -32,22 +33,23 @@ with this program; if not, write to the Free Software Foundation, Inc., - + {% trans "Switch constructor" as tr_constructor %} + {% for constructor_switch in constructor_switch_list %} - +
{% include "buttons/sort.html" with prefix='constructor-switch' col='name' text='Constructeur' %}{% include "buttons/sort.html" with prefix='constructor-switch' col='name' text=tr_constructor %}
{{constructor_switch}}{{ constructor_switch }} - {% history_button constructor_switch %} {% can_edit constructor_switch %} - + {% acl_end %} + {% history_button constructor_switch %} {% can_delete constructor_switch %} - + {% acl_end %} @@ -59,3 +61,4 @@ with this program; if not, write to the Free Software Foundation, Inc., {% if constructor_switch_list.paginator %} {% include "pagination.html" with list=constructor_switch_list %} {% endif %} + diff --git a/topologie/templates/topologie/aff_model_switch.html b/topologie/templates/topologie/aff_model_switch.html index 3a62024f..6b3e7156 100644 --- a/topologie/templates/topologie/aff_model_switch.html +++ b/topologie/templates/topologie/aff_model_switch.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 model_switch_list.paginator %} {% include "pagination.html" with list=model_switch_list %} @@ -32,24 +33,26 @@ with this program; if not, write to the Free Software Foundation, Inc., - - + {% trans "Reference" as tr_ref %} + + {% trans "Switch constructor" as tr_constructor %} + {% for model_switch in model_switch_list %} - - + + - - + + {% for port_profile in port_profile_list %} - - + + + {% trans "RADIUS mode: " %}{{ port_profile.radius_mode }} {% endif %} - - - + + +
{% include "buttons/sort.html" with prefix='model-switch' col='reference' text='Référence' %}{% include "buttons/sort.html" with prefix='model-switch' col='constructor' text='Constructeur' %}{% include "buttons/sort.html" with prefix='model-switch' col='reference' text=tr_ref %}{% include "buttons/sort.html" with prefix='model-switch' col='constructor' text=tr_constructor %}
{{model_switch.reference}}{{model_switch.constructor}}{{ model_switch.reference }}{{ model_switch.constructor }} - {% history_button model_switch %} {% can_edit model_switch %} - + {% acl_end %} + {% history_button model_switch %} {% can_delete model_switch %} - + {% acl_end %} @@ -61,3 +64,4 @@ with this program; if not, write to the Free Software Foundation, Inc., {% if model_switch_list.paginator %} {% include "pagination.html" with list=model_switch_list %} {% endif %} + diff --git a/topologie/templates/topologie/aff_port.html b/topologie/templates/topologie/aff_port.html index ec02bcaa..c7c6a0b4 100644 --- a/topologie/templates/topologie/aff_port.html +++ b/topologie/templates/topologie/aff_port.html @@ -24,62 +24,83 @@ with this program; if not, write to the Free Software Foundation, Inc., {% load acl %} {% load logs_extra %} +{% load i18n %}
- - - - - - - - - - - {% for port in port_list %} - - - - - + {% trans "Port" as tr_port %} + + {% trans "Room" as tr_room %} + + {% trans "Interface" as tr_interface %} + + {% trans "Related port" as tr_related_port %} + + + + + + + + {% for port in port_list %} + + + + + - - - - - + {% acl_end %} + {% endif %} + + + + + + {% endfor %}
{% include "buttons/sort.html" with prefix='port' col='port' text='Port' %}{% include "buttons/sort.html" with prefix='port' col='room' text='Room' %}{% include "buttons/sort.html" with prefix='port' col='interface' text='Interface machine' %}{% include "buttons/sort.html" with prefix='port' col='related' text='Related' %}Etat du portProfil du portDétails
{{ port.port }} - {% if port.room %}{{ port.room }}{% endif %} - - {% if port.machine_interface %} - {% can_view port.machine_interface.machine.user %} - - {{ port.machine_interface }} - {% acl_end %} - {% endif %} - - {% if port.related %} - {% can_view port.related.switch %} - +
{% include "buttons/sort.html" with prefix='port' col='port' text=tr_port %}{% include "buttons/sort.html" with prefix='port' col='room' text=tr_room %}{% include "buttons/sort.html" with prefix='port' col='interface' text=tr_interface %}{% include "buttons/sort.html" with prefix='port' col='related' text=tr_related_port %}{% trans "Port state" %}{% trans "Port profile" %}{% trans "Details" %}
{{ port.port }} + {% if port.room %} + {{ port.room }} + {% endif %} + + {% if port.machine_interface %} + {% can_view port.machine_interface.machine.user %} + + {{ port.machine_interface }} + + {% acl_end %} + {% endif %} + + {% if port.related %} + {% can_view port.related.switch %} + + {{ port.related }} + + {% acl_else %} {{ port.related }} - - {% acl_else %} - {{ port.related }} - {% acl_end %} - {% endif %} - {% if port.state %} Actif{% else %}Désactivé{% endif %}{% if not port.custom_profil %}Par défaut : {% endif %}{{port.get_port_profil}}{{ port.details }} - {% history_button port %} - {% can_edit port %} - - - - {% acl_end %} - {% can_delete port %} - - - - {% acl_end %} -
+ {% if port.state %} + {% trans "Active" %} + {% else %} + {% trans "Disabled" %} + {% endif %} + + {% if not port.custom_profil %} + {% trans "Default: " %} + {% endif %} + {{ port.get_port_profil }} + {{ port.details }} + {% can_edit port %} + + + + {% acl_end %} + {% history_button port %} + {% can_delete port %} + + + + {% acl_end %} +
+ diff --git a/topologie/templates/topologie/aff_port_profile.html b/topologie/templates/topologie/aff_port_profile.html index 4ba59ff5..9714f1d9 100644 --- a/topologie/templates/topologie/aff_port_profile.html +++ b/topologie/templates/topologie/aff_port_profile.html @@ -38,39 +38,39 @@ with this program; if not, write to the Free Software Foundation, Inc.,
{% trans "Default for" %} {% trans "VLANs" %} {% trans "RADIUS settings" %}{% trans "Speed" %}{% trans "Mac address limit" %}{% trans "Speed limit" %}{% trans "MAC address limit" %} {% trans "Security" %}
{{port_profile.name}}{{port_profile.profil_default}}{{ port_profile.name }}{{ port_profile.profil_default }} {% if port_profile.vlan_untagged %} - Untagged : {{port_profile.vlan_untagged}} + {% trans "Untagged: " %}{{ port_profile.vlan_untagged }}
{% endif %} {% if port_profile.vlan_tagged.all %} - Tagged : {{port_profile.vlan_tagged.all|join:", "}} + {% trans "Tagged: " %}{{ port_profile.vlan_tagged.all|join:", " }} {% endif %}
- Type : {{port_profile.radius_type}} + {% trans "RADIUS type: " %}{{ port_profile.radius_type }} {% if port_profile.radius_type == "MAC-radius" %}
- Mode : {{port_profile.radius_mode}}
{{port_profile.speed}}{{port_profile.mac_limit}}{{port_profile.security_parameters_enabled|join:"
"}}
{{ port_profile.speed }}{{ port_profile.mac_limit }}{{ port_profile.security_parameters_enabled|join:"
" }}
- {% history_button port_profile %} {% can_edit port_profile %} {% include 'buttons/edit.html' with href='topologie:edit-port-profile' id=port_profile.pk %} {% acl_end %} + {% history_button port_profile %} {% can_delete port_profile %} {% include 'buttons/suppr.html' with href='topologie:del-port-profile' id=port_profile.pk %} {% acl_end %} @@ -84,3 +84,4 @@ with this program; if not, write to the Free Software Foundation, Inc., {% endif %} + diff --git a/topologie/templates/topologie/aff_stacks.html b/topologie/templates/topologie/aff_stacks.html index 4dd0f6ea..c5366cd7 100644 --- a/topologie/templates/topologie/aff_stacks.html +++ b/topologie/templates/topologie/aff_stacks.html @@ -24,37 +24,46 @@ with this program; if not, write to the Free Software Foundation, Inc., {% load acl %} {% load logs_extra %} +{% load i18n %} - - - - + {% trans "Stack" as tr_stack %} + + {% trans "ID" as tr_id %} + + + {% for stack in stack_list %} - - - - - - - + + + + + + + {% endfor %}
{% include "buttons/sort.html" with prefix='stack' col='name' text='Stack' %}{% include "buttons/sort.html" with prefix='stack' col='id' text='ID' %}DétailsMembres{% include "buttons/sort.html" with prefix='stack' col='name' text=tr_stack %}{% include "buttons/sort.html" with prefix='stack' col='id' text=id %}{% trans "Details" %}{% trans "Members" %}
{{ stack.name }}{{stack.stack_id}}{{stack.details}}{% for switch in stack.switch_set.all %}{{switch }} {% endfor %} - {% history_button stack %} - {% can_edit stack %} - - - - {% acl_end %} - {% can_delete stack %} - - - - {% acl_end %} -
{{ stack.name }}{{ stack.stack_id }}{{ stack.details }} + {% for switch in stack.switch_set.all %} + + {{ switch }} + + {% endfor %} + + {% can_edit stack %} + + + + {% acl_end %} + {% history_button stack %} + {% can_delete stack %} + + + + {% acl_end %} +
diff --git a/topologie/templates/topologie/aff_switch.html b/topologie/templates/topologie/aff_switch.html index 1f4dcbcf..d900a1f9 100644 --- a/topologie/templates/topologie/aff_switch.html +++ b/topologie/templates/topologie/aff_switch.html @@ -24,59 +24,65 @@ with this program; if not, write to the Free Software Foundation, Inc., {% load acl %} {% load logs_extra %} +{% load i18n %}
{% if switch_list.paginator %} {% include "pagination.html" with list=switch_list %} {% endif %} - - - - - - - - - + {% trans "DNS name" as tr_dns %} + + {% trans "IPv4 address" as tr_ip %} + + {% trans "Switch bay" as tr_bay %} + + {% trans "Ports" as tr_ports %} + + {% trans "Stack" as tr_stack %} + + + + {% for switch in switch_list %} - - - - - - - - - - - + + + + + + + + + + + {% endfor %}
{% include "buttons/sort.html" with prefix='switch' col='dns' text='Dns' %}{% include "buttons/sort.html" with prefix='switch' col='ip' text='Ipv4' %}{% include "buttons/sort.html" with prefix='switch' col='loc' text='Emplacement' %}{% include "buttons/sort.html" with prefix='switch' col='ports' text='Ports' %}{% include "buttons/sort.html" with prefix='switch' col='stack' text='Stack' %}Id stackModèleDétails{% include "buttons/sort.html" with prefix='switch' col='dns' text=tr_dns %}{% include "buttons/sort.html" with prefix='switch' col='ip' text=tr_ip %}{% include "buttons/sort.html" with prefix='switch' col='loc' text=tr_bay %}{% include "buttons/sort.html" with prefix='switch' col='ports' text=tr_ports %}{% include "buttons/sort.html" with prefix='switch' col='stack' text=tr_stack %}{% trans "Stack ID" %}{% trans "Switch model" %}{% trans "Details" %}
- - {{switch}} - - {{switch.interface_set.first.ipv4}}{{switch.switchbay}}{{switch.number}}{{switch.stack.name}}{{switch.stack_member_id}}{{switch.model}}{{switch.interface_set.first.details}} - {% history_button switch %} - {% can_edit switch %} - {% include 'buttons/edit.html' with href='topologie:edit-switch' id=switch.pk %} - {% acl_end %} - {% can_delete switch %} - {% include 'buttons/suppr.html' with href='machines:del-machine' id=switch.id %} - {% acl_end %} - {% can_create Port %} - {% include 'buttons/add.html' with href='topologie:create-ports' id=switch.pk desc='Création de ports'%} - {% acl_end %} -
+ + {{ switch }} + + {{ switch.interface_set.first.ipv4 }}{{ switch.switchbay }}{{ switch.number }}{{ switch.stack.name }}{{ switch.stack_member_id }}{{ switch.model }}{{ switch.interface_set.first.details }} + {% can_edit switch %} + {% include 'buttons/edit.html' with href='topologie:edit-switch' id=switch.pk %} + {% acl_end %} + {% history_button switch %} + {% can_delete switch %} + {% include 'buttons/suppr.html' with href='machines:del-machine' id=switch.id %} + {% acl_end %} + {% can_create Port %} + {% trans "Creation of ports" as tr_creation %} + {% include 'buttons/add.html' with href='topologie:create-ports' id=switch.pk desc=tr_creation %} + {% acl_end %} +
{% if switch_list.paginator %} {% include "pagination.html" with list=switch_list %} {% endif %} -
+ diff --git a/topologie/templates/topologie/aff_switch_bay.html b/topologie/templates/topologie/aff_switch_bay.html index c73bdf5f..0909c264 100644 --- a/topologie/templates/topologie/aff_switch_bay.html +++ b/topologie/templates/topologie/aff_switch_bay.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 switch_bay_list.paginator %} {% include "pagination.html" with list=switch_bay_list %} @@ -32,36 +33,45 @@ with this program; if not, write to the Free Software Foundation, Inc., - - - - + {% trans "Switch bay" as tr_bay %} + + {% trans "Building" as tr_building %} + + + {% for switch_bay in switch_bay_list %} - - - - - - - + + + + + + + {% endfor %}
{% include "buttons/sort.html" with prefix='switch-bay' col='name' text='Baie' %}{% include "buttons/sort.html" with prefix='switch-bay' col='building' text='Bâtiment' %}Info particulièresSwitchs de la baie{% include "buttons/sort.html" with prefix='switch-bay' col='name' text=tr_bay %}{% include "buttons/sort.html" with prefix='switch-bay' col='building' text=tr_building %}{% trans "Information" %}{% trans "Switches of the bay" %}
{{switch_bay.name}}{{switch_bay.building}}{{switch_bay.info}}{% for switch in switch_bay.switch_set.all %}{{switch }} {% endfor %} - {% history_button switch_bay %} - {% can_edit switch_bay %} - - - - {% acl_end %} - {% can_delete switch_bay %} - - - - {% acl_end %} -
{{ switch_bay.name }}{{ switch_bay.building }}{{ switch_bay.info }} + {% for switch in switch_bay.switch_set.all %} + + {{ switch }} + + {% endfor %} + + {% can_edit switch_bay %} + + + + {% acl_end %} + {% history_button switch_bay %} + {% can_delete switch_bay %} + + + + {% acl_end %} +
{% if switch_bay_list.paginator %} {% include "pagination.html" with list=switch_bay_list %} {% endif %} + diff --git a/topologie/templates/topologie/delete.html b/topologie/templates/topologie/delete.html index ce277647..97834564 100644 --- a/topologie/templates/topologie/delete.html +++ b/topologie/templates/topologie/delete.html @@ -24,17 +24,20 @@ with this program; if not, write to the Free Software Foundation, Inc., {% endcomment %} {% load bootstrap3 %} +{% load i18n %} -{% block title %}Création et modification de machines{% endblock %} +{% block title %}{% trans "Topology" %}{% endblock %} {% block content %}
{% csrf_token %} -

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

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

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

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



{% endblock %} + diff --git a/topologie/templates/topologie/edit_stack_sw.html b/topologie/templates/topologie/edit_stack_sw.html index 37a25cd0..8c29c85c 100644 --- a/topologie/templates/topologie/edit_stack_sw.html +++ b/topologie/templates/topologie/edit_stack_sw.html @@ -24,33 +24,35 @@ with this program; if not, write to the Free Software Foundation, Inc., {% load acl %} {% load logs_extra %} +{% load i18n %} - - - + + + + + + {% for stack in stack_list %} + + + + + - - {% for stack in stack_list %} - - - - - - {% endfor %}
StackIDDetails{% trans "Stack" %}{% trans "Stack ID" %}{% trans "Details" %}
{{ stack.name }}{{ stack.stack_id }}{{ stack.details }} + {% can_edit stack %} + + + + {% acl_end %} + {% history_button stack %} + {% can_delete stack %} + + + + {% acl_end %} +
{{stack.name}}{{stack.stack_id}}{{stack.details}} - {% history_button stack %} - {% can_edit stack %} - - - - {% acl_end %} - {% can_delete stack %} - - - - {% acl_end %} -
+ diff --git a/topologie/templates/topologie/index.html b/topologie/templates/topologie/index.html index f596e6a5..1c13b928 100644 --- a/topologie/templates/topologie/index.html +++ b/topologie/templates/topologie/index.html @@ -25,8 +25,9 @@ with this program; if not, write to the Free Software Foundation, Inc., {% load bootstrap3 %} {% load acl %} +{% load i18n %} -{% block title %}Switchs{% endblock %} +{% block title %}{% trans "Topology" %}{% endblock %} {% block content %} @@ -51,7 +52,7 @@ function toggle_graph() { @@ -62,9 +63,9 @@ Topologie des Switchs -

Switchs

+

{% trans "Switches" %}

{% can_create Switch %} -
Ajouter un switch +{% trans " Add a switch" %}
{% acl_end %} {% include "topologie/aff_switch.html" with switch_list=switch_list %} @@ -73,3 +74,4 @@ Topologie des Switchs
{% endblock %} + diff --git a/topologie/templates/topologie/index_ap.html b/topologie/templates/topologie/index_ap.html index 19499998..e1292bb9 100644 --- a/topologie/templates/topologie/index_ap.html +++ b/topologie/templates/topologie/index_ap.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 %}Bornes WiFi{% endblock %} +{% block title %}{% trans "Topology" %}{% endblock %} {% block content %} -

Points d'accès WiFi

+

{% trans "Access points" %}

{% can_create AccessPoint %} - Ajouter une borne +{% trans " Add an access point" %}
{% acl_end %} {% include "topologie/aff_ap.html" with ap_list=ap_list %} @@ -39,3 +40,4 @@ with this program; if not, write to the Free Software Foundation, Inc.,

{% endblock %} + diff --git a/topologie/templates/topologie/index_model_switch.html b/topologie/templates/topologie/index_model_switch.html index 7c1a15f8..b89b7415 100644 --- a/topologie/templates/topologie/index_model_switch.html +++ b/topologie/templates/topologie/index_model_switch.html @@ -25,25 +25,27 @@ with this program; if not, write to the Free Software Foundation, Inc., {% load bootstrap3 %} {% load acl %} +{% load i18n %} -{% block title %}Modèles de switches{% endblock %} +{% block title %}{% trans "Topology" %}{% endblock %} {% block content %} -

Modèles de switches

+

{% trans "Switch models" %}

{% can_create ModelSwitch %} - Ajouter un modèle + {% trans " Add a switch model" %}
{% acl_end %} {% include "topologie/aff_model_switch.html" with model_switch_list=model_switch_list %} -

Constructeurs de switches

+

{% trans "Switch constructors" %}

{% can_create ConstructorSwitch %} - Ajouter un constructeur + {% trans " Add a switch constructor" %}
{% acl_end %} {% include "topologie/aff_constructor_switch.html" with constructor_switch_list=constructor_switch_list %} {% endblock %} + diff --git a/topologie/templates/topologie/index_p.html b/topologie/templates/topologie/index_p.html index 138cc62c..aabb9e21 100644 --- a/topologie/templates/topologie/index_p.html +++ b/topologie/templates/topologie/index_p.html @@ -25,15 +25,16 @@ with this program; if not, write to the Free Software Foundation, Inc., {% load bootstrap3 %} {% load acl %} +{% load i18n %} -{% block title %}Ports du switch{% endblock %} +{% block title %}{% trans "Topology" %}{% endblock %} {% block content %} -

Switch {{ nom_switch }}

- Editer +

{% trans "Switch:"%} {{ nom_switch }}

+{% trans " Edit" %} {% can_create Port %} - Ajouter un port - Ajouter des ports +{% trans " Add a port" %} +{% trans " Add ports" %} {% acl_end %}
{% include "topologie/aff_repr_switch.html" with port_list=port_list %} @@ -42,3 +43,4 @@ with this program; if not, write to the Free Software Foundation, Inc.,

{% endblock %} + diff --git a/topologie/templates/topologie/index_physical_grouping.html b/topologie/templates/topologie/index_physical_grouping.html index 2470c019..763d7820 100644 --- a/topologie/templates/topologie/index_physical_grouping.html +++ b/topologie/templates/topologie/index_physical_grouping.html @@ -25,33 +25,35 @@ with this program; if not, write to the Free Software Foundation, Inc., {% load bootstrap3 %} {% load acl %} +{% load i18n %} -{% block title %}Stacks{% endblock %} +{% block title %}{% trans "Topology" %}{% endblock %} {% block content %} -

Stacks

+

{% trans "Stacks" %}

{% can_create Stack %} - Ajouter une stack + {% trans " Add a stack" %} {% acl_end %} {% include "topologie/aff_stacks.html" with stack_list=stack_list %} -

Baie de brassage

+

{% trans "Switch bays" %}

{% can_create SwitchBay %} - Ajouter une baie de brassage + {% trans " Add a switch bay" %}
{% acl_end %} {% include "topologie/aff_switch_bay.html" with switch_bay_list=switch_bay_list %} -

Batiment

+

{% trans "Buildings" %}

{% can_create Building %} - Ajouter un bâtiment + {% trans " Add a building" %}
{% acl_end %} {% include "topologie/aff_building.html" with building_list=building_list %} {% endblock %} + diff --git a/topologie/templates/topologie/index_portprofile.html b/topologie/templates/topologie/index_portprofile.html index f95415c8..730823f6 100644 --- a/topologie/templates/topologie/index_portprofile.html +++ b/topologie/templates/topologie/index_portprofile.html @@ -26,7 +26,7 @@ with this program; if not, write to the Free Software Foundation, Inc., {% load acl %} {% load i18n %} -{% block title %}Switchs{% endblock %} +{% block title %}{% trans "Topology" %}{% endblock %} {% block content %} @@ -41,3 +41,4 @@ with this program; if not, write to the Free Software Foundation, Inc.,
{% endblock %} + diff --git a/topologie/templates/topologie/index_room.html b/topologie/templates/topologie/index_room.html index 0d586452..ea6ed6f3 100644 --- a/topologie/templates/topologie/index_room.html +++ b/topologie/templates/topologie/index_room.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 %}Chambres{% endblock %} +{% block title %}{% trans "Topology" %}{% endblock %} {% block content %} -

Chambres

+

{% trans "Rooms" %}

{% can_create Room %} - Ajouter une chambre +{% trans " Add a room" %}
{% acl_end %} {% include "topologie/aff_chambres.html" with room_list=room_list %} @@ -39,3 +40,4 @@ with this program; if not, write to the Free Software Foundation, Inc.,

{% endblock %} + diff --git a/topologie/templates/topologie/sidebar.html b/topologie/templates/topologie/sidebar.html index 04ee5202..a35721f9 100644 --- a/topologie/templates/topologie/sidebar.html +++ b/topologie/templates/topologie/sidebar.html @@ -23,30 +23,32 @@ with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. {% endcomment %} +{% load i18n %} {% block sidebar %} - Chambres et locaux + {% trans "Rooms and premises" %} - Switchs + {% trans "Switches" %} - Config des ports switchs + {% trans "Port profiles" %} - Bornes WiFi + {% trans "Access points" %} - Groupements physiques + {% trans "Physical grouping" %} - Modèles switches et constructeurs + {% trans "Switch models and constructors" %} {% endblock %} + diff --git a/topologie/templates/topologie/switch.html b/topologie/templates/topologie/switch.html index 4b334896..0e4995ba 100644 --- a/topologie/templates/topologie/switch.html +++ b/topologie/templates/topologie/switch.html @@ -25,8 +25,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 d'un switch{% endblock %} +{% block title %}{% trans "Topology" %}{% endblock %} {% block content %} {% if topoform %} @@ -35,16 +36,18 @@ with this program; if not, write to the Free Software Foundation, Inc., -{% bootstrap_icon "list" %} Aller à la liste des ports +{% bootstrap_icon "list" %}{% trans " Go to the ports list" %}
{% csrf_token %} {% if topoform %} -

Réglage spécifiques du switch

+

{% trans "Specific settings for the switch" %}

{% massive_bootstrap_form topoform 'switch_interface' %} {% endif %} - {% bootstrap_button "Créer" button_type="submit" icon="ok" %} + {% trans "Create" as tr_create %} + {% bootstrap_button tr_create button_type="submit" icon="ok" %}



{% endblock %} + diff --git a/topologie/templates/topologie/topo.html b/topologie/templates/topologie/topo.html index 7d1662f0..d02d0c37 100644 --- a/topologie/templates/topologie/topo.html +++ b/topologie/templates/topologie/topo.html @@ -25,14 +25,15 @@ with this program; if not, write to the Free Software Foundation, Inc., {% load bootstrap3 %} {% load massive_bootstrap_form %} +{% load i18n %} -{% block title %}Modification de la topologie{% endblock %} +{% block title %}{% trans "Topology" %}{% endblock %} {% block content %} {% bootstrap_form_errors topoform %} {% if id_switch %} -{% bootstrap_icon "list" %} Aller à la liste des ports +{% bootstrap_icon "list" %}{% trans " Go to the ports list" %} {% endif %}
{% csrf_token %} @@ -43,3 +44,4 @@ with this program; if not, write to the Free Software Foundation, Inc.,

{% endblock %} + diff --git a/topologie/templates/topologie/topo_more.html b/topologie/templates/topologie/topo_more.html index d1147ff8..70e71910 100644 --- a/topologie/templates/topologie/topo_more.html +++ b/topologie/templates/topologie/topo_more.html @@ -25,8 +25,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 d'un objet topologie{% endblock %} +{% block title %}{% trans "Topology" %}{% endblock %} {% block content %} {% if topoform %} @@ -44,20 +45,22 @@ with this program; if not, write to the Free Software Foundation, Inc., {% csrf_token %} {% if topoform %} -

Réglage spécifiques du {{ device }}

+

{% blocktrans %}Specific settings for the {{ device }} object{% endblocktrans %}

{% massive_bootstrap_form topoform 'ipv4,machine' mbf_param=i_mbf_param%} {% endif %} {% if machineform %} -

Réglages généraux de la machine associée au {{ device }}

+

{% blocktrans %}General settings for the machine linked to the {{ device }} object{% endblocktrans %}

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

Nom de la machine

+

{% trans "DNS name" %}

{% bootstrap_form domainform %} {% endif %} - {% bootstrap_button "Créer ou modifier" button_type="submit" icon="ok" %} + {% trans "Create or edit" as tr_create_or_edit %} + {% bootstrap_button tr_create_or_edit button_type="submit" icon="ok" %}



{% endblock %} + diff --git a/topologie/views.py b/topologie/views.py index a6c6ab69..1e8bfee4 100644 --- a/topologie/views.py +++ b/topologie/views.py @@ -314,7 +314,7 @@ def new_port(request, switchid): try: switch = Switch.objects.get(pk=switchid) except Switch.DoesNotExist: - messages.error(request, u"Switch inexistant") + messages.error(request, _("Nonexistent switch.")) return redirect(reverse('topologie:index')) port = AddPortForm(request.POST or None) if port.is_valid(): @@ -322,15 +322,15 @@ def new_port(request, switchid): port.switch = switch try: port.save() - messages.success(request, "Port ajouté") + messages.success(request, _("The port was added.")) except IntegrityError: - messages.error(request, "Ce port existe déjà") + messages.error(request, _("The port already exists.")) return redirect(reverse( 'topologie:index-port', kwargs={'switchid': switchid} )) return form( - {'id_switch': switchid, 'topoform': port, 'action_name': 'Ajouter'}, + {'id_switch': switchid, 'topoform': port, 'action_name': _("Add")}, 'topologie/topo.html', request) @@ -345,7 +345,7 @@ def edit_port(request, port_object, **_kwargs): if port.is_valid(): if port.changed_data: port.save() - messages.success(request, "Le port a bien été modifié") + messages.success(request, _("The port was edited.")) return redirect(reverse( 'topologie:index-port', kwargs={'switchid': str(port_object.switch.id)} @@ -354,7 +354,7 @@ def edit_port(request, port_object, **_kwargs): { 'id_switch': str(port_object.switch.id), 'topoform': port, - 'action_name': 'Editer' + 'action_name': _("Edit") }, 'topologie/topo.html', request @@ -368,12 +368,12 @@ def del_port(request, port, **_kwargs): if request.method == "POST": try: port.delete() - messages.success(request, "Le port a été détruit") + messages.success(request, _("The port was deleted.")) except ProtectedError: messages.error( request, - ("Le port %s est affecté à un autre objet, impossible " - "de le supprimer" % port) + (_("The port %s is used by another object, impossible to" + " delete it.") % port) ) return redirect(reverse( 'topologie:index-port', @@ -389,10 +389,10 @@ def new_stack(request): stack = StackForm(request.POST or None) if stack.is_valid(): stack.save() - messages.success(request, "Stack crée") + messages.success(request, _("The stack was created.")) return redirect(reverse('topologie:index-physical-grouping')) return form( - {'topoform': stack, 'action_name': 'Créer'}, + {'topoform': stack, 'action_name': _("Create")}, 'topologie/topo.html', request ) @@ -408,7 +408,7 @@ def edit_stack(request, stack, **_kwargs): stack.save() return redirect(reverse('topologie:index-physical-grouping')) return form( - {'topoform': stack, 'action_name': 'Editer'}, + {'topoform': stack, 'action_name': _("Edit")}, 'topologie/topo.html', request ) @@ -421,12 +421,12 @@ def del_stack(request, stack, **_kwargs): if request.method == "POST": try: stack.delete() - messages.success(request, "La stack a eté détruite") + messages.success(request, _("The stack was deleted.")) except ProtectedError: messages.error( request, - ("La stack %s est affectée à un autre objet, impossible " - "de la supprimer" % stack) + (_("The stack %s is used by another object, impossible to" + " deleted it.") % stack) ) return redirect(reverse('topologie:index-physical-grouping')) return form({'objet': stack}, 'topologie/delete.html', request) @@ -467,8 +467,8 @@ def new_switch(request): if not user: messages.error( request, - ("L'user association n'existe pas encore, veuillez le " - "créer ou le linker dans preferences") + (_("The organisation's user doesn't exist yet, please create" + " or link it in the preferences.")) ) return redirect(reverse('topologie:index')) new_switch_obj = switch.save(commit=False) @@ -482,7 +482,7 @@ def new_switch(request): new_interface_obj.save() new_domain_obj.interface_parent = new_interface_obj new_domain_obj.save() - messages.success(request, "Le switch a été créé") + messages.success(request, _("The switch was created.")) return redirect(reverse('topologie:index')) i_mbf_param = generate_ipv4_mbf_param(interface, False) return form( @@ -505,7 +505,7 @@ def create_ports(request, switchid): try: switch = Switch.objects.get(pk=switchid) except Switch.DoesNotExist: - messages.error(request, u"Switch inexistant") + messages.error(request, _("Nonexistent switch")) return redirect(reverse('topologie:index')) s_begin = s_end = 0 @@ -525,7 +525,7 @@ def create_ports(request, switchid): end = port_form.cleaned_data['end'] try: switch.create_ports(begin, end) - messages.success(request, "Ports créés.") + messages.success(request, _("The ports were created.")) except ValidationError as e: messages.error(request, ''.join(e)) return redirect(reverse( @@ -569,7 +569,7 @@ def edit_switch(request, switch, switchid): new_interface_obj.save() if domain_form.changed_data: new_domain_obj.save() - messages.success(request, "Le switch a bien été modifié") + messages.success(request, _("The switch was edited.")) return redirect(reverse('topologie:index')) i_mbf_param = generate_ipv4_mbf_param(interface_form, False) return form( @@ -608,8 +608,8 @@ def new_ap(request): if not user: messages.error( request, - ("L'user association n'existe pas encore, veuillez le " - "créer ou le linker dans preferences") + (_("The organisation's user doesn't exist yet, please create" + " or link it in the preferences.")) ) return redirect(reverse('topologie:index')) new_ap_obj = ap.save(commit=False) @@ -623,7 +623,7 @@ def new_ap(request): new_interface_obj.save() new_domain_obj.interface_parent = new_interface_obj new_domain_obj.save() - messages.success(request, "La borne a été créé") + messages.success(request, _("The access point was created.")) return redirect(reverse('topologie:index-ap')) i_mbf_param = generate_ipv4_mbf_param(interface, False) return form( @@ -663,8 +663,8 @@ def edit_ap(request, ap, **_kwargs): if not user: messages.error( request, - ("L'user association n'existe pas encore, veuillez le " - "créer ou le linker dans preferences") + (_("The organisation's user doesn't exist yet, please create" + " or link it in the preferences.")) ) return redirect(reverse('topologie:index-ap')) new_ap_obj = ap_form.save(commit=False) @@ -676,7 +676,7 @@ def edit_ap(request, ap, **_kwargs): new_interface_obj.save() if domain_form.changed_data: new_domain_obj.save() - messages.success(request, "La borne a été modifiée") + messages.success(request, _("The access point was edited.")) return redirect(reverse('topologie:index-ap')) i_mbf_param = generate_ipv4_mbf_param(interface_form, False) return form( @@ -699,10 +699,10 @@ def new_room(request): room = EditRoomForm(request.POST or None) if room.is_valid(): room.save() - messages.success(request, "La chambre a été créé") + messages.success(request, _("The room was created.")) return redirect(reverse('topologie:index-room')) return form( - {'topoform': room, 'action_name': 'Ajouter'}, + {'topoform': room, 'action_name': _("Add")}, 'topologie/topo.html', request ) @@ -716,10 +716,10 @@ def edit_room(request, room, **_kwargs): if room.is_valid(): if room.changed_data: room.save() - messages.success(request, "La chambre a bien été modifiée") + messages.success(request, _("The room was edited.")) return redirect(reverse('topologie:index-room')) return form( - {'topoform': room, 'action_name': 'Editer'}, + {'topoform': room, 'action_name': _("Edit")}, 'topologie/topo.html', request ) @@ -732,16 +732,16 @@ def del_room(request, room, **_kwargs): if request.method == "POST": try: room.delete() - messages.success(request, "La chambre/prise a été détruite") + messages.success(request, _("The room was deleted.")) except ProtectedError: messages.error( request, - ("La chambre %s est affectée à un autre objet, impossible " - "de la supprimer (switch ou user)" % room) + (_("The room %s is used by another object, impossible to" + " deleted it.") % room) ) return redirect(reverse('topologie:index-room')) return form( - {'objet': room, 'objet_name': 'Chambre'}, + {'objet': room, 'objet_name': _("Room")}, 'topologie/delete.html', request ) @@ -754,10 +754,10 @@ def new_model_switch(request): model_switch = EditModelSwitchForm(request.POST or None) if model_switch.is_valid(): model_switch.save() - messages.success(request, "Le modèle a été créé") + messages.success(request, _("The swich model was created.")) return redirect(reverse('topologie:index-model-switch')) return form( - {'topoform': model_switch, 'action_name': 'Ajouter'}, + {'topoform': model_switch, 'action_name': _("Add")}, 'topologie/topo.html', request ) @@ -775,10 +775,10 @@ def edit_model_switch(request, model_switch, **_kwargs): if model_switch.is_valid(): if model_switch.changed_data: model_switch.save() - messages.success(request, "Le modèle a bien été modifié") + messages.success(request, _("The switch model was edited.")) return redirect(reverse('topologie:index-model-switch')) return form( - {'topoform': model_switch, 'action_name': 'Editer'}, + {'topoform': model_switch, 'action_name': _("Edit")}, 'topologie/topo.html', request ) @@ -791,16 +791,16 @@ def del_model_switch(request, model_switch, **_kwargs): if request.method == "POST": try: model_switch.delete() - messages.success(request, "Le modèle a été détruit") + messages.success(request, _("The switch model was deleted.")) except ProtectedError: messages.error( request, - ("Le modèle %s est affectée à un autre objet, impossible " - "de la supprimer (switch ou user)" % model_switch) + (_("The switch model %s is used by another object," + " impossible to delete it.") % model_switch) ) return redirect(reverse('topologie:index-model-switch')) return form( - {'objet': model_switch, 'objet_name': 'Modèle de switch'}, + {'objet': model_switch, 'objet_name': _("Switch model")}, 'topologie/delete.html', request ) @@ -813,10 +813,10 @@ def new_switch_bay(request): switch_bay = EditSwitchBayForm(request.POST or None) if switch_bay.is_valid(): switch_bay.save() - messages.success(request, "La baie a été créé") + messages.success(request, _("The switch bay was created.")) return redirect(reverse('topologie:index-physical-grouping')) return form( - {'topoform': switch_bay, 'action_name': 'Ajouter'}, + {'topoform': switch_bay, 'action_name': _("Add")}, 'topologie/topo.html', request ) @@ -830,10 +830,10 @@ def edit_switch_bay(request, switch_bay, **_kwargs): if switch_bay.is_valid(): if switch_bay.changed_data: switch_bay.save() - messages.success(request, "Le switch a bien été modifié") + messages.success(request, _("The switch bay was edited.")) return redirect(reverse('topologie:index-physical-grouping')) return form( - {'topoform': switch_bay, 'action_name': 'Editer'}, + {'topoform': switch_bay, 'action_name': _("Edit")}, 'topologie/topo.html', request ) @@ -846,16 +846,16 @@ def del_switch_bay(request, switch_bay, **_kwargs): if request.method == "POST": try: switch_bay.delete() - messages.success(request, "La baie a été détruite") + messages.success(request, _("The switch bay was deleted.")) except ProtectedError: messages.error( request, - ("La baie %s est affecté à un autre objet, impossible " - "de la supprimer (switch ou user)" % switch_bay) + (_("The switch bay %s is used by another object," + " impossible to delete it.") % switch_bay) ) return redirect(reverse('topologie:index-physical-grouping')) return form( - {'objet': switch_bay, 'objet_name': 'Baie de switch'}, + {'objet': switch_bay, 'objet_name': _("Switch bay")}, 'topologie/delete.html', request ) @@ -868,10 +868,10 @@ def new_building(request): building = EditBuildingForm(request.POST or None) if building.is_valid(): building.save() - messages.success(request, "Le batiment a été créé") + messages.success(request, _("The building was created.")) return redirect(reverse('topologie:index-physical-grouping')) return form( - {'topoform': building, 'action_name': 'Ajouter'}, + {'topoform': building, 'action_name': _("Add")}, 'topologie/topo.html', request ) @@ -885,10 +885,10 @@ def edit_building(request, building, **_kwargs): if building.is_valid(): if building.changed_data: building.save() - messages.success(request, "Le batiment a bien été modifié") + messages.success(request, _("The building was edited.")) return redirect(reverse('topologie:index-physical-grouping')) return form( - {'topoform': building, 'action_name': 'Editer'}, + {'topoform': building, 'action_name': _("Edit")}, 'topologie/topo.html', request ) @@ -901,16 +901,16 @@ def del_building(request, building, **_kwargs): if request.method == "POST": try: building.delete() - messages.success(request, "La batiment a été détruit") + messages.success(request, _("The building was deleted.")) except ProtectedError: messages.error( request, - ("Le batiment %s est affecté à un autre objet, impossible " - "de la supprimer (switch ou user)" % building) + (_("The building %s is used by another object, impossible" + " to delete it.") % building) ) return redirect(reverse('topologie:index-physical-grouping')) return form( - {'objet': building, 'objet_name': 'Bâtiment'}, + {'objet': building, 'objet_name': _("Building")}, 'topologie/delete.html', request ) @@ -923,10 +923,10 @@ def new_constructor_switch(request): constructor_switch = EditConstructorSwitchForm(request.POST or None) if constructor_switch.is_valid(): constructor_switch.save() - messages.success(request, "Le constructeur a été créé") + messages.success(request, _("The switch constructor was created.")) return redirect(reverse('topologie:index-model-switch')) return form( - {'topoform': constructor_switch, 'action_name': 'Ajouter'}, + {'topoform': constructor_switch, 'action_name': _("Add")}, 'topologie/topo.html', request ) @@ -944,10 +944,10 @@ def edit_constructor_switch(request, constructor_switch, **_kwargs): if constructor_switch.is_valid(): if constructor_switch.changed_data: constructor_switch.save() - messages.success(request, "Le modèle a bien été modifié") + messages.success(request, _("The switch constructor was edited.")) return redirect(reverse('topologie:index-model-switch')) return form( - {'topoform': constructor_switch, 'action_name': 'Editer'}, + {'topoform': constructor_switch, 'action_name': _("Edit")}, 'topologie/topo.html', request ) @@ -960,17 +960,17 @@ def del_constructor_switch(request, constructor_switch, **_kwargs): if request.method == "POST": try: constructor_switch.delete() - messages.success(request, "Le constructeur a été détruit") + messages.success(request, _("The switch constructor was deleted.")) except ProtectedError: messages.error( request, - ("Le constructeur %s est affecté à un autre objet, impossible " - "de la supprimer (switch ou user)" % constructor_switch) + (_("The switch constructor %s is used by another object," + " impossible to delete it.") % constructor_switch) ) return redirect(reverse('topologie:index-model-switch')) return form({ 'objet': constructor_switch, - 'objet_name': 'Constructeur de switch' + 'objet_name': _("Switch constructor") }, 'topologie/delete.html', request) @@ -981,7 +981,7 @@ def new_port_profile(request): port_profile = EditPortProfileForm(request.POST or None) if port_profile.is_valid(): port_profile.save() - messages.success(request, _("Port profile created")) + messages.success(request, _("The port profile was created.")) return redirect(reverse('topologie:index')) return form( {'topoform': port_profile, 'action_name': _("Create")}, @@ -999,7 +999,7 @@ def edit_port_profile(request, port_profile, **_kwargs): if port_profile.is_valid(): if port_profile.changed_data: port_profile.save() - messages.success(request, _("Port profile modified")) + messages.success(request, _("The port profile was edited.")) return redirect(reverse('topologie:index')) return form( {'topoform': port_profile, 'action_name': _("Edit")}, @@ -1016,10 +1016,10 @@ def del_port_profile(request, port_profile, **_kwargs): try: port_profile.delete() messages.success(request, - _("The port profile was successfully deleted")) + _("The port profile was deleted.")) except ProtectedError: messages.success(request, - _("Impossible to delete the port profile")) + _("Impossible to delete the port profile.")) return redirect(reverse('topologie:index')) return form( {'objet': port_profile, 'objet_name': _("Port profile")}, @@ -1139,9 +1139,8 @@ def generate_dot(data, template): t = loader.get_template(template) if not isinstance(t, Template) and \ not (hasattr(t, 'template') and isinstance(t.template, Template)): - raise Exception("Le template par défaut de Django n'est pas utilisé." - "Cela peut mener à des erreurs de rendu." - "Vérifiez les paramètres") + raise Exception(_("The default Django template isn't used. This can" + " lead to rendering errors. Check the parameters.")) c = Context(data).flatten() dot = t.render(c) return(dot) @@ -1183,3 +1182,4 @@ def recursive_switchs(switch_start, switch_before, detected): if link: links_return.append(link) return (links_return, detected) +