Commit 77e62df3 authored by Laouen Fernet's avatar Laouen Fernet

add translations for preferences/

parent 62d09760
......@@ -359,7 +359,7 @@ class DelMailContactForm(Form):
"""Delete contact email adress"""
mailcontacts = forms.ModelMultipleChoiceField(
queryset=MailContact.objects.none(),
label="Enregistrements adresses actuels",
label=_("Current email addresses"),
widget=forms.CheckboxSelectMultiple
)
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
......@@ -23,35 +23,35 @@ with this program; if not, write to the Free Software Foundation, Inc.,
{% endcomment %}
{% load acl %}
{% load logs_extra %}
<table class="table table-striped">
<thead>
<tr>
<th>Id Clef</th>
<th>Commentaire</th>
<th>Clef par default des switchs</th>
<th>Clef utilisée par les switchs</th>
<th></th>
<th></th>
{% load i18n %}
<table class="table table-striped">
<thead>
<tr>
<th>{% trans "RADIUS key ID" %}</th>
<th>{% trans "Comment" %}</th>
<th>{% trans "Default RADIUS key for switches" %}</th>
<th>{% trans "RADIUS key used by the swithes" %}</th>
<th></th>
<th></th>
</tr>
</thead>
{% for radiuskey in radiuskey_list %}
</thead>
{% for radiuskey in radiuskey_list %}
<tr>
<td>{{ radiuskey.id }}</td>
<td>{{ radiuskey.comment }}</td>
<td>{{ radiuskey.default_switch }}</td>
<td>{{ radiuskey.switch_set.all|join:", " }}</td>
<td>{{ radiuskey.switch_set.all|join:", " }}</td>
<td class="text-right">
{% can_edit radiuskey %}
{% include 'buttons/edit.html' with href='preferences:edit-radiuskey' id=radiuskey.id %}
{% acl_end %}
{% can_delete radiuskey %}
<a class="btn btn-danger btn-sm" role="button" title="Supprimer" href="{% url 'preferences:del-radiuskey' radiuskey.pk %}">
<i class="fa fa-trash"></i>
</a>
{% can_delete radiuskey %}
{% include 'buttons/suppr.html' with href='preferences:del-radiuskey' id=radiuskey.id %}
{% acl_end %}
{% history_button radiuskey %}
</td>
</tr>
{% endfor %}
</table>
{% endfor %}
</table>
......@@ -31,7 +31,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
</tr>
<tr>
<th>{% trans "VLAN for machines accepted by RADIUS" %}</th>
<td><span class="label label-success">Vlan {{ radiusoptions.vlan_decision_ok }}</span></td>
<td><span class="label label-success">{% blocktrans with vlan_decision_ok=radiusoptions.vlan_decision_ok %}VLAN {{ vlan_decision_ok }}{% endblocktrans %}</span></td>
</tr>
</table>
<hr/>
......@@ -39,7 +39,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
<thead>
<tr>
<th>{% trans "Situation" %}</th>
<th>{% trans "Behavior" %}</th>
<th>{% trans "Behaviour" %}</th>
</tr>
</thead>
<tr>
......@@ -48,7 +48,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
{% if radiusoptions.unknown_machine == 'REJECT' %}
<span class="label label-danger">{% trans "Reject" %}</span>
{% else %}
<span class="label label-success">Vlan {{ radiusoptions.unknown_machine_vlan }}</span>
<span class="label label-success">{% blocktrans with unknown_machine_vlan=radiusoptions.unknown_machine_vlan %}VLAN {{ unknown_machine_vlan }}{% endblocktrans %}</span>
{% endif %}
</td>
</tr>
......@@ -58,7 +58,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
{% if radiusoptions.unknown_port == 'REJECT' %}
<span class="label label-danger">{% trans "Reject" %}</span>
{% else %}
<span class="label label-success">Vlan {{ radiusoptions.unknown_port_vlan }}</span>
<span class="label label-success">{% blocktrans with unknown_port_vlan=radiusoptions.unknown_port_vlan %}VLAN {{ unknown_port_vlan }}{% endblocktrans %}</span>
{% endif %}
</td>
</tr>
......@@ -68,7 +68,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
{% if radiusoptions.unknown_room == 'REJECT' %}
<span class="label label-danger">{% trans "Reject" %}</span>
{% else %}
<span class="label label-success">Vlan {{ radiusoptions.unknown_room_vlan }}</span>
<span class="label label-success">{% blocktrans with unknown_room_vlan=radiusoptions.unknown_room_vlan %}VLAN {{ unknown_room_vlan }}{% endblocktrans %}</span>
{% endif %}
</td>
</tr>
......@@ -78,7 +78,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
{% if radiusoptions.non_member == 'REJECT' %}
<span class="label label-danger">{% trans "Reject" %}</span>
{% else %}
<span class="label label-success">Vlan {{ radiusoptions.non_member_vlan }}</span>
<span class="label label-success">{% blocktrans with non_member_vlan=radiusoptions.non_member_vlan %}VLAN {{ non_member_vlan }}{% endblocktrans %}</span>
{% endif %}
</td>
</tr>
......@@ -88,7 +88,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
{% if radiusoptions.unknown_port == 'REJECT' %}
<span class="label label-danger">{% trans "Reject" %}</span>
{% else %}
<span class="label label-success">Vlan {{ radiusoptions.banned_vlan }}</span>
<span class="label label-success">{% blocktrans with banned_vlan=radiusoptions.banned_vlan %}VLAN {{ banned_vlan }}{% endblocktrans %}</span>
{% endif %}
</td>
</tr>
......
......@@ -23,31 +23,31 @@ with this program; if not, write to the Free Software Foundation, Inc.,
{% endcomment %}
{% load acl %}
{% load logs_extra %}
{% load i18n %}
<table class="table table-striped">
<thead>
<tr>
<th>Nombre de jours avant le rappel</th>
<th>Message custom pour ce rappel</th>
<th></th>
<th>{% trans "Number of days before the reminder" %}</th>
<th>{% trans "Message for this reminder" %}</th>
<th></th>
<th></th>
</tr>
</thead>
{% for reminder in reminder_list %}
<tr>
<td>{{ reminder.days }}</td>
<td>{{ reminder.message }}</td>
<td class="text-right">
{% can_edit reminder %}
{% include 'buttons/edit.html' with href='preferences:edit-reminder' id=reminder.id %}
{% can_delete reminder %}
<a class="btn btn-danger btn-sm" role="button" title="Supprimer" href="{% url 'preferences:del-reminder' reminder.id %}">
<i class="fa fa-trash"></i>
</a>
{% acl_end %}
{% acl_end %}
{% history_button reminder %}
</td>
</tr>
<tr>
<td>{{ reminder.days }}</td>
<td>{{ reminder.message }}</td>
<td class="text-right">
{% can_edit reminder %}
{% include 'buttons/edit.html' with href='preferences:edit-reminder' id=reminder.id %}
{% acl_end %}
{% can_delete reminder %}
{% include 'buttons/suppr.html' with href='preferences:del-reminder' id=reminder.id %}
{% acl_end %}
{% history_button reminder %}
</td>
</tr>
{% endfor %}
</table>
......
......@@ -42,15 +42,13 @@ with this program; if not, write to the Free Software Foundation, Inc.,
<td>{{ service.description }}</td>
<td>{{ service.image }}</td>
<td class="text-right">
{% can_edit service%}
{% include 'buttons/edit.html' with href='preferences:edit-service' id=service.id %}
{% can_delete service %}
<a class="btn btn-danger btn-sm" role="button" title="Supprimer" href="{% url 'preferences:del-service' service.id %}">
<i class="fa fa-trash"></i>
</a>
{% acl_end %}
{% acl_end %}
{% history_button service %}
{% can_edit service%}
{% include 'buttons/edit.html' with href='preferences:edit-service' id=service.id %}
{% acl_end %}
{% can_delete service %}
{% include 'buttons/suppr.html' with href='preferences:del-service' id=service.id %}
{% acl_end %}
{% history_button service %}
</td>
</tr>
{% endfor %}
......
......@@ -23,17 +23,19 @@ with this program; if not, write to the Free Software Foundation, Inc.,
{% endcomment %}
{% load acl %}
{% load logs_extra %}
<table class="table table-striped">
<thead>
<tr>
<th>Identifiant</th>
<th>Creds par default des switchs</th>
<th>Utilisé pour les switchs</th>
<th></th>
<th></th>
</tr>
</thead>
{% for switchmanagementcred in switchmanagementcred_list %}
{% load i18n %}
<table class="table table-striped">
<thead>
<tr>
<th>{% trans "Switch login" %}</th>
<th>{% trans "Default switch management credentials" %}</th>
<th>{% trans "Management credentials used by the switches" %}</th>
<th></th>
<th></th>
</tr>
</thead>
{% for switchmanagementcred in switchmanagementcred_list %}
<tr>
<td>{{ switchmanagementcred.management_id }}</td>
<td>{{ switchmanagementcred.default_switch }}</td>
......@@ -43,13 +45,11 @@ with this program; if not, write to the Free Software Foundation, Inc.,
{% include 'buttons/edit.html' with href='preferences:edit-switchmanagementcred' id=switchmanagementcred.id %}
{% acl_end %}
{% can_delete switchmanagementcred %}
<a class="btn btn-danger btn-sm" role="button" title="Supprimer" href="{% url 'preferences:del-switchmanagementcred' switchmanagementcred.pk %}">
<i class="fa fa-trash"></i>
</a>
{% include 'buttons/suppr.html' with href='preferences:del-switchmanagementcred' id=switchmanagementcred.id %}
{% acl_end %}
{% history_button switchmanagementcred %}
</td>
</tr>
{% endfor %}
</table>
{% endfor %}
</table>
{% extends "topologie/sidebar.html" %}
{% extends 'preferences/sidebar.html' %}
{% comment %}
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
......@@ -24,15 +24,17 @@ 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 "Deletion of preferences" %}{% endblock %}
{% block content %}
<form class="form" method="post">
{% csrf_token %}
<h4>Attention, voulez-vous vraiment supprimer cet objet {{ objet_name }} ( {{ objet }} ) ?</h4>
{% bootstrap_button "Confirmer" button_type="submit" icon="trash" %}
<h4>{% blocktrans %}Warning: are you sure you want to delete this {{ objet_name }} object ( {{ objet }} )?{% endblocktrans %}</h4>
{% trans "Confirm" as tr_confirm %}
{% bootstrap_button tr_confirm button_type="submit" icon="trash" %}
</form>
<br />
<br />
......
{% extends "preferences/sidebar.html" %}
{% extends 'preferences/sidebar.html' %}
{% comment %}
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
......
{% extends "preferences/sidebar.html" %}
{% extends 'preferences/sidebar.html' %}
{% comment %}
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
......
{% extends "base.html" %}
{% extends 'base.html' %}
{% comment %}
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
......
......@@ -111,7 +111,7 @@ def edit_options(request, section):
model = getattr(models, section, None)
form_instance = getattr(forms, 'Edit' + section + 'Form', None)
if not (model or form_instance):
messages.error(request, _("Unknown object"))
messages.error(request, _("Unknown object."))
return redirect(reverse('preferences:display-options'))
options_instance, _created = model.objects.get_or_create()
......@@ -186,7 +186,7 @@ def del_service(request, service_instance, **_kwargs):
"""Suppression d'un service de la page d'accueil"""
if request.method == "POST":
service_instance.delete()
messages.success(request, "Le service a été détruit")
messages.success(request, _("The service was deleted."))
return redirect(reverse('preferences:display-options'))
return form(
{'objet': service_instance, 'objet_name': 'service'},
......@@ -204,7 +204,7 @@ def add_reminder(request):
messages.success(request, _("The reminder was added."))
return redirect(reverse('preferences:display-options'))
return form(
{'preferenceform': reminder, 'action_name': _("Add a service")},
{'preferenceform': reminder, 'action_name': _("Add a reminder")},
'preferences/preferences.html',
request
)
......@@ -220,7 +220,7 @@ def edit_reminder(request, reminder_instance, **_kwargs):
)
if reminder.is_valid():
reminder.save()
messages.success(request, _("The service was edited."))
messages.success(request, _("The reminder was edited."))
return redirect(reverse('preferences:display-options'))
return form(
{'preferenceform': reminder, 'action_name': _("Edit")},
......@@ -236,7 +236,7 @@ def del_reminder(request, reminder_instance, **_kwargs):
"""Destruction d'un reminder"""
if request.method == "POST":
reminder_instance.delete()
messages.success(request, "Le reminder a été détruit")
messages.success(request, _("The reminder was deleted."))
return redirect(reverse('preferences:display-options'))
return form(
{'objet': reminder_instance, 'objet_name': 'reminder'},
......@@ -252,10 +252,10 @@ def add_radiuskey(request):
radiuskey = RadiusKeyForm(request.POST or None)
if radiuskey.is_valid():
radiuskey.save()
messages.success(request, "Cette clef a été ajouté")
messages.success(request, _("The RADIUS key was added."))
return redirect(reverse('preferences:display-options'))
return form(
{'preferenceform': radiuskey, 'action_name': 'Ajouter'},
{'preferenceform': radiuskey, 'action_name': _("Add a RADIUS key")},
'preferences/preferences.html',
request
)
......@@ -266,10 +266,10 @@ def edit_radiuskey(request, radiuskey_instance, **_kwargs):
radiuskey = RadiusKeyForm(request.POST or None, instance=radiuskey_instance)
if radiuskey.is_valid():
radiuskey.save()
messages.success(request, "Radiuskey modifié")
messages.success(request, _("The RADIUS key was edited."))
return redirect(reverse('preferences:display-options'))
return form(
{'preferenceform': radiuskey, 'action_name': 'Editer'},
{'preferenceform': radiuskey, 'action_name': _("Edit")},
'preferences/preferences.html',
request
)
......@@ -282,10 +282,10 @@ def del_radiuskey(request, radiuskey_instance, **_kwargs):
if request.method == "POST":
try:
radiuskey_instance.delete()
messages.success(request, "La radiuskey a été détruite")
messages.success(request, _("The RADIUS key was deleted."))
except ProtectedError:
messages.error(request, "Erreur la\
clef ne peut être supprimé, elle est affectée à des switchs")
messages.error(request, _("The RADIUS key is assigned to at least"
" one switch, you can't delete it."))
return redirect(reverse('preferences:display-options'))
return form(
{'objet': radiuskey_instance, 'objet_name': 'radiuskey'},
......@@ -301,10 +301,10 @@ def add_switchmanagementcred(request):
switchmanagementcred = SwitchManagementCredForm(request.POST or None)
if switchmanagementcred.is_valid():
switchmanagementcred.save()
messages.success(request, "Ces creds ont été ajoutés")
messages.success(request, _("The switch management credentials were added."))
return redirect(reverse('preferences:display-options'))
return form(
{'preferenceform': switchmanagementcred, 'action_name': 'Ajouter'},
{'preferenceform': switchmanagementcred, 'action_name': _("Add switch management credentials")},
'preferences/preferences.html',
request
)
......@@ -315,10 +315,10 @@ def edit_switchmanagementcred(request, switchmanagementcred_instance, **_kwargs)
switchmanagementcred = SwitchManagementCredForm(request.POST or None, instance=switchmanagementcred_instance)
if switchmanagementcred.is_valid():
switchmanagementcred.save()
messages.success(request, "Creds de managament modifié")
messages.success(request, _("The switch management credentials were edited."))
return redirect(reverse('preferences:display-options'))
return form(
{'preferenceform': switchmanagementcred, 'action_name': 'Editer'},
{'preferenceform': switchmanagementcred, 'action_name': _("Edit")},
'preferences/preferences.html',
request
)
......@@ -331,10 +331,11 @@ def del_switchmanagementcred(request, switchmanagementcred_instance, **_kwargs):
if request.method == "POST":
try:
switchmanagementcred_instance.delete()
messages.success(request, "Ces creds ont été détruits")
messages.success(request, _("The switch management credentials were deleted."))
except ProtectedError:
messages.error(request, "Erreur ces\
creds ne peuvent être supprimés, ils sont affectés à des switchs")
messages.error(request, _("The switch management credentials are"
" assigned to at least one switch, you"
" can't delete them."))
return redirect(reverse('preferences:display-options'))
return form(
{'objet': switchmanagementcred_instance, 'objet_name': 'switchmanagementcred'},
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment