Commit 038a11fb authored by Laouen Fernet's avatar Laouen Fernet Committed by chirac

Mark strings for translation in preferences

parent a745e8cc
......@@ -41,6 +41,7 @@ def can_view(user):
can = user.has_module_perms("preferences")
return (
can,
None if can else _("You don't have the right to view this" " application."),
None if can else _("You don't have the right to view this"
" application."),
("preferences",),
)
......@@ -81,13 +81,13 @@ class EditOptionalMachineForm(ModelForm):
prefix = kwargs.pop("prefix", self.Meta.model.__name__)
super(EditOptionalMachineForm, self).__init__(*args, prefix=prefix, **kwargs)
self.fields["password_machine"].label = _(
"Possibility to set a" " password per machine"
"Possibility to set a password per machine"
)
self.fields["max_lambdauser_interfaces"].label = _(
"Maximum number of" " interfaces" " allowed for a" " standard user"
"Maximum number of interfaces allowed for a standard user"
)
self.fields["max_lambdauser_aliases"].label = _(
"Maximum number of DNS" " aliases allowed for" " a standard user"
"Maximum number of DNS aliases allowed for a standard user"
)
self.fields["ipv6_mode"].label = _("IPv6 mode")
self.fields["create_machine"].label = _("Can create a machine")
......@@ -136,20 +136,20 @@ class EditGeneralOptionForm(ModelForm):
self.fields["general_message_fr"].label = _("General message in French")
self.fields["general_message_en"].label = _("General message in English")
self.fields["search_display_page"].label = _(
"Number of results" " displayed when" " searching"
"Number of results displayed when searching"
)
self.fields["pagination_number"].label = _(
"Number of items per page," " standard size (e.g." " users)"
"Number of items per page, standard size (e.g. users)"
)
self.fields["pagination_large_number"].label = _(
"Number of items per" " page, large size" " (e.g. machines)"
"Number of items per page, large size (e.g. machines)"
)
self.fields["req_expire_hrs"].label = _(
"Time before expiration of the" " reset password link (in" " hours)"
"Time before expiration of the reset password link (in hours)"
)
self.fields["site_name"].label = _("Website name")
self.fields["email_from"].label = _("Email address for automatic" " emailing")
self.fields["GTU_sum_up"].label = _("Summary of the General Terms of" " Use")
self.fields["email_from"].label = _("Email address for automatic emailing")
self.fields["GTU_sum_up"].label = _("Summary of the General Terms of Use")
self.fields["GTU"].label = _("General Terms of Use")
......@@ -171,7 +171,7 @@ class EditAssoOptionForm(ModelForm):
self.fields["telephone"].label = _("Telephone number")
self.fields["pseudo"].label = _("Usual name")
self.fields["utilisateur_asso"].label = _(
"Account used for editing" " from /admin"
"Account used for editing from /admin"
)
self.fields["description"].label = _("Description")
......@@ -187,10 +187,10 @@ class EditMailMessageOptionForm(ModelForm):
prefix = kwargs.pop("prefix", self.Meta.model.__name__)
super(EditMailMessageOptionForm, self).__init__(*args, prefix=prefix, **kwargs)
self.fields["welcome_mail_fr"].label = _(
"Message for the French" " welcome email"
"Message for the French welcome email"
)
self.fields["welcome_mail_en"].label = _(
"Message for the English" " welcome email"
"Message for the English welcome email"
)
......@@ -451,7 +451,7 @@ class DelDocumentTemplateForm(FormRevMixin, Form):
document_templates = forms.ModelMultipleChoiceField(
queryset=DocumentTemplate.objects.none(),
label=_("Available document templates"),
label=_("Current document templates"),
widget=forms.CheckboxSelectMultiple,
)
......
This diff is collapsed.
......@@ -35,7 +35,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
{% for mandate in mandate_list %}
<tr>
<td>{{mandate.start_date|date:"d/m/Y"}}</td>
<td>{% if mandate.end_date %}{{mandate.end_date|date:"d/m/Y"}}{% else %}{% trans "In progress." %}{% endif %}</td>
<td>{% if mandate.end_date %}{{mandate.end_date|date:"d/m/Y"}}{% else %}{% trans "In progress" %}{% endif %}</td>
<td><a href="{% url 'users:profil' userid=mandate.president.id %}">{{mandate.president.name}} {{mandate.president.surname}}</a></td>
<td class="text-right">
{% can_edit mandate%}
......
......@@ -31,7 +31,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
<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>{% trans "Switches using the RADIUS key" %}</th>
<th></th>
<th></th>
</tr>
......
......@@ -27,7 +27,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
<tr>
<th>{% trans "General policy for VLAN setting" %}</th>
<td>{{ radiusoptions.radius_general_policy }}</td>
<td>{% trans "This setting defines the VLAN policy after acceptance by RADIUS: either on the IP range's VLAN of the machine, or a VLAN preset in 'VLAN for machines accepted by RADIUS'" %}</td>
<td>{% blocktrans %}This setting defines the VLAN policy after acceptance by RADIUS: either on the IP range's VLAN of the machine, or a VLAN preset in "VLAN for machines accepted by RADIUS".{% endblocktrans %}</td>
</tr>
<tr>
<th>{% trans "VLAN for machines accepted by RADIUS" %}</th>
......
......@@ -42,7 +42,7 @@ 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%}
{% can_edit service %}
{% include 'buttons/edit.html' with href='preferences:edit-service' id=service.id %}
{% acl_end %}
{% can_delete service %}
......
......@@ -30,7 +30,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
<tr>
<th>{% trans "Switch login" %}</th>
<th>{% trans "Default switch management credentials" %}</th>
<th>{% trans "Management credentials used by the switches" %}</th>
<th>{% trans "Switches using the management credentials" %}</th>
<th></th>
<th></th>
</tr>
......
......@@ -125,7 +125,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
<tr>
<th>{% trans "All users are active by default" %}</th>
<td>{{ useroptions.all_users_active|tick }}</td>
<th>{% trans "Allow archived users to log-in" %}</th>
<th>{% trans "Allow archived users to log in" %}</th>
<td>{{ useroptions.allow_archived_connexion|tick }}</td>
</tr>
</table>
......@@ -156,7 +156,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
<div class="panel panel-default" id="machines">
<div class="panel-heading" data-toggle="collapse" href="#collapse_machines">
<h4 class ="panel-title">
<a><i class="fa fa-desktop"></i> {% trans "Machines preferences" %}</a>
<a><i class="fa fa-desktop"></i> {% trans "Machine preferences" %}</a>
</h4>
</div>
......@@ -177,7 +177,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
<tr>
<th>{% trans "Maximum number of DNS aliases allowed for a standard user" %}</th>
<td>{{ machineoptions.max_lambdauser_aliases }}</td>
<th>{% trans "Default Time To Live (TTL) for CNAME, A and AAA records." %}</th>
<th>{% trans "Default Time To Live (TTL) for CNAME, A and AAAA records." %}</th>
<td>{{ machineoptions.default_dns_ttl }}</td>
</tr>
<tr>
......@@ -200,7 +200,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
<h4>{% trans "RADIUS keys" %}</h4>
{% can_create RadiusKey%}
<a class="btn btn-primary btn-sm" role="button" href="{% url 'preferences:add-radiuskey' %}"><i class="fa fa-plus"></i>{% trans " Add a RADIUS key" %}</a>
<a class="btn btn-primary btn-sm" role="button" href="{% url 'preferences:add-radiuskey' %}"><i class="fa fa-plus"></i>{% trans "Add a RADIUS key" %}</a>
{% acl_end %}
{% include 'preferences/aff_radiuskey.html' with radiuskey_list=radiuskey_list %}
......@@ -262,7 +262,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
<h6>{% trans "Switch management credentials" %}</h6>
{% can_create SwitchManagementCred%}
<a class="btn btn-primary btn-sm" role="button" href="{% url 'preferences:add-switchmanagementcred' %}"><i class="fa fa-plus"></i>{% trans " Add switch management credentials" %}</a>
<a class="btn btn-primary btn-sm" role="button" href="{% url 'preferences:add-switchmanagementcred' %}"><i class="fa fa-plus"></i>{% trans "Add switch management credentials" %}</a>
{% acl_end %}
<p>
</p>
......@@ -282,8 +282,8 @@ with this program; if not, write to the Free Software Foundation, Inc.,
{% trans "Edit" %}
</a>
{% include 'preferences/aff_radiusoptions.html' %}
<h5>{% trans "Available RADIUS attributes"%}</h5>
<a class="btn btn-primary btn-sm" role="button" href="{% url 'preferences:add-radiusattribute' %}"><i class="fa fa-plus"></i>{% trans " Add an attribute" %}</a>
<h5>{% trans "Current RADIUS attributes"%}</h5>
<a class="btn btn-primary btn-sm" role="button" href="{% url 'preferences:add-radiusattribute' %}"><i class="fa fa-plus"></i>{% trans "Add an attribute" %}</a>
{% include 'preferences/aff_radiusattributes.html' %}
</div>
</div>
......@@ -346,7 +346,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
<div id="collapse_templates" class="panel-collapse panel-body collapse">
{% can_create DocumentTemplate %}
<a class="btn btn-primary btn-sm" role="button" href="{% url 'preferences:add-document-template' %}">
<i class="fa fa-cart-plus"></i> {% trans "Add a document template" %}
<i class="fa fa-plus"></i> {% trans "Add a document template" %}
</a>
{% acl_end %}
<a class="btn btn-danger btn-sm" role="button" href="{% url 'preferences:del-document-template' %}">
......@@ -359,7 +359,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
<div class="panel panel-default" id="cotisation">
<div class="panel-heading" data-toggle="collapse" href="#collapse_cotisation">
<h4 class="panel-title">
<a><i class="fa fa-eur"></i> {% trans "Cotisation's options" %}</a>
<a><i class="fa fa-eur"></i> {% trans "Subscription preferences" %}</a>
</h4>
</div>
<div id="collapse_cotisation" class="panel-collapse panel-body collapse">
......@@ -414,13 +414,13 @@ with this program; if not, write to the Free Software Foundation, Inc.,
<div class="panel panel-default" id="rappels">
<div class="panel-heading" data-toggle="collapse" href="#collapse_rappels">
<h4 class="panel-title">
<a><i class="fa fa-bell"></i> {% trans "Options for the membership's end email" %}</a>
<a><i class="fa fa-bell"></i> {% trans "Preferences for the membership's end email" %}</a>
</h4>
</div>
<div id="collapse_rappels" class="panel-collapse panel-body collapse">
{% can_create preferences.Reminder%}
<a class="btn btn-primary btn-sm" role="button" href="{% url 'preferences:add-reminder' %}"><i class="fa fa-plus"></i>{% trans " Add a reminder" %}</a>
<a class="btn btn-primary btn-sm" role="button" href="{% url 'preferences:add-reminder' %}"><i class="fa fa-plus"></i>{% trans "Add a reminder" %}</a>
<p></p>
{% acl_end %}
{% include 'preferences/aff_reminder.html' with reminder_list=reminder_list %}
......@@ -437,7 +437,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
<div id="collapse_services" class="panel-collapse panel-body collapse">
{% can_create preferences.Service%}
<a class="btn btn-primary btn-sm" role="button" href="{% url 'preferences:add-service' %}"><i class="fa fa-plus"></i>{% trans " Add a service" %}</a>
<a class="btn btn-primary btn-sm" role="button" href="{% url 'preferences:add-service' %}"><i class="fa fa-plus"></i>{% trans "Add a service" %}</a>
<p></p>
{% acl_end %}
{% include 'preferences/aff_service.html' with service_list=service_list %}
......@@ -454,9 +454,9 @@ with this program; if not, write to the Free Software Foundation, Inc.,
<div id="collapse_contact" class="panel-collapse panel-body collapse">
{% can_create preferences.MailContact %}
<a class="btn btn-primary btn-sm" role="button" href="{% url 'preferences:add-mailcontact' %}"><i class="fa fa-plus"></i>{% trans " Add an address" %}</a>
<a class="btn btn-primary btn-sm" role="button" href="{% url 'preferences:add-mailcontact' %}"><i class="fa fa-plus"></i>{% trans "Add an address" %}</a>
{% acl_end %}
<a class="btn btn-danger btn-sm" role="button" href="{% url 'preferences:del-mailcontact' %}"><i class="fa fa-trash"></i>{% trans " Delete one or several addresses" %}</a>
<a class="btn btn-danger btn-sm" role="button" href="{% url 'preferences:del-mailcontact' %}"><i class="fa fa-trash"></i>{% trans "Delete one or several addresses" %}</a>
<p></p>
{% include 'preferences/aff_mailcontact.html' with mailcontact_list=mailcontact_list %}
</div>
......@@ -465,7 +465,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
<div class="panel panel-default" id="social">
<div class="panel-heading" data-toggle="collapse" href="#collapse_social">
<h4 class="panel-title">
<i class="fa fa-twitter"></i> {% trans "Social networks" %}</a>
<a><i class="fa fa-twitter"></i> {% trans "Social networks" %}</a>
</h4>
</div>
<div id="collapse_social" class="panel-collapse panel-body collapse">
......
......@@ -191,7 +191,7 @@ def add_service(request):
messages.success(request, _("The service was added."))
return redirect(reverse("preferences:display-options"))
return form(
{"preferenceform": service, "action_name": _("Add a service")},
{"preferenceform": service, "action_name": _("Add")},
"preferences/preferences.html",
request,
)
......@@ -224,7 +224,7 @@ def del_service(request, service_instance, **_kwargs):
messages.success(request, _("The service was deleted."))
return redirect(reverse("preferences:display-options"))
return form(
{"objet": service_instance, "objet_name": "service"},
{"objet": service_instance, "objet_name": _("service")},
"preferences/delete.html",
request,
)
......@@ -240,7 +240,7 @@ def add_reminder(request):
messages.success(request, _("The reminder was added."))
return redirect(reverse("preferences:display-options"))
return form(
{"preferenceform": reminder, "action_name": _("Add a reminder")},
{"preferenceform": reminder, "action_name": _("Add")},
"preferences/preferences.html",
request,
)
......@@ -273,7 +273,7 @@ def del_reminder(request, reminder_instance, **_kwargs):
messages.success(request, _("The reminder was deleted."))
return redirect(reverse("preferences:display-options"))
return form(
{"objet": reminder_instance, "objet_name": "reminder"},
{"objet": reminder_instance, "objet_name": _("reminder")},
"preferences/delete.html",
request,
)
......@@ -289,7 +289,7 @@ def add_radiuskey(request):
messages.success(request, _("The RADIUS key was added."))
return redirect(reverse("preferences:display-options"))
return form(
{"preferenceform": radiuskey, "action_name": _("Add a RADIUS key")},
{"preferenceform": radiuskey, "action_name": _("Add")},
"preferences/preferences.html",
request,
)
......@@ -328,7 +328,7 @@ def del_radiuskey(request, radiuskey_instance, **_kwargs):
)
return redirect(reverse("preferences:display-options"))
return form(
{"objet": radiuskey_instance, "objet_name": "radiuskey"},
{"objet": radiuskey_instance, "objet_name": _("RADIUS key")},
"preferences/delete.html",
request,
)
......@@ -346,7 +346,7 @@ def add_switchmanagementcred(request):
return form(
{
"preferenceform": switchmanagementcred,
"action_name": _("Add switch management credentials"),
"action_name": _("Add"),
},
"preferences/preferences.html",
request,
......@@ -391,7 +391,7 @@ def del_switchmanagementcred(request, switchmanagementcred_instance, **_kwargs):
)
return redirect(reverse("preferences:display-options"))
return form(
{"objet": switchmanagementcred_instance, "objet_name": "switchmanagementcred"},
{"objet": switchmanagementcred_instance, "objet_name": _("switch management credentials")},
"preferences/delete.html",
request,
)
......@@ -409,7 +409,7 @@ def add_mailcontact(request):
return form(
{
"preferenceform": mailcontact,
"action_name": _("Add a contact email address"),
"action_name": _("Add"),
},
"preferences/preferences.html",
request,
......@@ -524,8 +524,8 @@ def del_document_template(request, instances):
messages.error(
request,
_(
"The document template %(document_template)s can't be deleted \
because it is currently being used."
"The document template %(document_template)s can't be"
" deleted because it is currently being used."
)
% {"document_template": document_template},
)
......@@ -551,7 +551,7 @@ def add_radiusattribute(request):
messages.success(request, _("The attribute was added."))
return redirect(reverse("preferences:display-options"))
return form(
{"preferenceform": attribute, "action_name": _("Add a RADIUS attribute")},
{"preferenceform": attribute, "action_name": _("Add")},
"preferences/preferences.html",
request,
)
......@@ -584,7 +584,7 @@ def del_radiusattribute(request, radiusattribute_instance, **_kwargs):
messages.success(request, _("The attribute was deleted."))
return redirect(reverse("preferences:display-options"))
return form(
{"objet": radiusattribute_instance, "objet_name": "attribute"},
{"objet": radiusattribute_instance, "objet_name": _("attribute")},
"preferences/delete.html",
request,
)
......@@ -600,7 +600,7 @@ def add_mandate(request):
messages.success(request, _("The mandate was added."))
return redirect(reverse("preferences:display-options"))
return form(
{"preferenceform": mandate, "action_name": _("Add a mandate")},
{"preferenceform": mandate, "action_name": _("Add")},
"preferences/preferences.html",
request,
)
......@@ -631,7 +631,7 @@ def del_mandate(request, mandate_instance, **_kwargs):
messages.success(request, _("The mandate was deleted."))
return redirect(reverse("preferences:display-options"))
return form(
{"objet": mandate_instance, "objet_name": "attribute"},
{"objet": mandate_instance, "objet_name": _("mandate")},
"preferences/delete.html",
request,
)
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