diff --git a/search/forms.py b/search/forms.py index 8cdb1cc1..6065e799 100644 --- a/search/forms.py +++ b/search/forms.py @@ -26,23 +26,24 @@ from __future__ import unicode_literals from django import forms from django.forms import Form +from django.utils.translation import ugettext_lazy as _ from re2o.utils import get_input_formats_help_text CHOICES_USER = ( - ('0', 'Actifs'), - ('1', 'Désactivés'), - ('2', 'Archivés'), + ('0', _("Active")), + ('1', _("Disabled")), + ('2', _("Archived")), ) CHOICES_AFF = ( - ('0', 'Utilisateurs'), - ('1', 'Machines'), - ('2', 'Factures'), - ('3', 'Bannissements'), - ('4', 'Accès à titre gracieux'), - ('5', 'Chambres'), - ('6', 'Ports'), - ('7', 'Switchs'), + ('0', _("Users")), + ('1', _("Machines")), + ('2', _("Invoices")), + ('3', _("Bans")), + ('4', _("Whitelists")), + ('5', _("Rooms")), + ('6', _("Ports")), + ('7', _("Switches")), ) @@ -55,11 +56,11 @@ def initial_choices(choice_set): class SearchForm(Form): """The form for a simple search""" q = forms.CharField( - label='Recherche', + label=_("Search"), help_text=( - 'Utilisez « » et «,» pour spécifier différents mots, «"query"» ' - 'pour une recherche exacte et «\\» pour échapper un caractère.' - ), + _("Use « » and «,» to specify distinct words, «\"query\"» for" + " an exact search and «\\» to escape a character.") + ), max_length=100 ) @@ -67,23 +68,23 @@ class SearchForm(Form): class SearchFormPlus(Form): """The form for an advanced search (with filters)""" q = forms.CharField( - label='Recherche', + label=_("Search"), help_text=( - 'Utilisez « » et «,» pour spécifier différents mots, «"query"» ' - 'pour une recherche exacte et «\\» pour échapper un caractère.' + _("Use « » and «,» to specify distinct words, «\"query\"» for" + " an exact search and «\\» to escape a character.") ), max_length=100, required=False ) u = forms.MultipleChoiceField( - label="Filtre utilisateurs", + label=_("Users filter"), required=False, widget=forms.CheckboxSelectMultiple, choices=CHOICES_USER, initial=initial_choices(CHOICES_USER) ) a = forms.MultipleChoiceField( - label="Filtre affichage", + label=_("Display filter"), required=False, widget=forms.CheckboxSelectMultiple, choices=CHOICES_AFF, @@ -91,11 +92,11 @@ class SearchFormPlus(Form): ) s = forms.DateField( required=False, - label="Date de début", + label=_("Start date"), ) e = forms.DateField( required=False, - label="Date de fin" + label=_("End date") ) def __init__(self, *args, **kwargs): @@ -106,3 +107,4 @@ class SearchFormPlus(Form): self.fields['e'].help_text = get_input_formats_help_text( self.fields['e'].input_formats ) + diff --git a/search/locale/fr/LC_MESSAGES/django.mo b/search/locale/fr/LC_MESSAGES/django.mo new file mode 100644 index 00000000..94a44104 Binary files /dev/null and b/search/locale/fr/LC_MESSAGES/django.mo differ diff --git a/search/locale/fr/LC_MESSAGES/django.po b/search/locale/fr/LC_MESSAGES/django.po new file mode 100644 index 00000000..dd0b63a3 --- /dev/null +++ b/search/locale/fr/LC_MESSAGES/django.po @@ -0,0 +1,163 @@ +# Re2o est un logiciel d'administration développé initiallement au rezometz. Il +# se veut agnostique au réseau considéré, de manière à être installable en +# quelques clics. +# +# Copyright © 2018 Maël Kervella +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License along +# with this program; if not, write to the Free Software Foundation, Inc., +# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +msgid "" +msgstr "" +"Project-Id-Version: 2.5\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2018-08-15 18:15+0200\n" +"PO-Revision-Date: 2018-06-24 20:10+0200\n" +"Last-Translator: Laouen Fernet \n" +"Language-Team: \n" +"Language: fr_FR\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" + +#: forms.py:33 +msgid "Active" +msgstr "Actifs" + +#: forms.py:34 +msgid "Disabled" +msgstr "Désactivés" + +#: forms.py:35 +msgid "Archived" +msgstr "Archivés" + +#: forms.py:39 +msgid "Users" +msgstr "Utilisateurs" + +#: forms.py:40 +msgid "Machines" +msgstr "Machines" + +#: forms.py:41 +msgid "Invoices" +msgstr "Factures" + +#: forms.py:42 +msgid "Bans" +msgstr "Bannissements" + +#: forms.py:43 +msgid "Whitelists" +msgstr "Accès gracieux" + +#: forms.py:44 +msgid "Rooms" +msgstr "Chambres" + +#: forms.py:45 +msgid "Ports" +msgstr "Ports" + +#: forms.py:46 +msgid "Switches" +msgstr "Commutateurs réseau" + +#: forms.py:59 forms.py:71 templates/search/search.html:29 +#: templates/search/search.html:48 +msgid "Search" +msgstr "Rechercher" + +#: forms.py:61 forms.py:73 +msgid "" +"Use « » and «,» to specify distinct words, «\"query\"» for an exact search " +"and «\\» to escape a character." +msgstr "" +"Utilisez « » et «,» pour spécifier différents mots, «\"query\"» pour une " +"recherche exacte et «\\» pour échapper un caractère." + +#: forms.py:80 +msgid "Users filter" +msgstr "Filtre utilisateurs" + +#: forms.py:87 +msgid "Display filter" +msgstr "Filtre affichage" + +#: forms.py:95 +msgid "Start date" +msgstr "Date de début" + +#: forms.py:99 +msgid "End date" +msgstr "Date de fin" + +#: templates/search/index.html:29 +msgid "Search results" +msgstr "Résultats de la recherche" + +#: templates/search/index.html:33 +msgid "Results among users:" +msgstr "Résultats parmi les utilisateurs :" + +#: templates/search/index.html:37 +msgid "Results among clubs:" +msgstr "Résultats parmi les clubs :" + +#: templates/search/index.html:41 +msgid "Results among machines:" +msgstr "Résultats parmi les machines :" + +#: templates/search/index.html:45 +msgid "Results among invoices:" +msgstr "Résultats parmi les factures :" + +#: templates/search/index.html:49 +msgid "Results among whitelists:" +msgstr "Résultats parmi les accès à titre gracieux :" + +#: templates/search/index.html:53 +msgid "Results among bans:" +msgstr "Résultats parmi les bannissements :" + +#: templates/search/index.html:57 +msgid "Results among rooms:" +msgstr "Résultats parmi les chambres :" + +#: templates/search/index.html:61 +msgid "Results among ports" +msgstr "Résultats parmi les ports :" + +#: templates/search/index.html:65 +msgid "Results among switches" +msgstr "Résultats parmi les commutateurs réseau :" + +#: templates/search/index.html:69 +msgid "No result" +msgstr "Pas de résultat" + +#: templates/search/index.html:71 +#, python-format +msgid "(Only the first %(max_result)s results are displayed in each category)" +msgstr "" +"(Seulement les %(max_result)s premiers résultats sont affichés dans chaque " +"catégorie)" + +#: templates/search/sidebar.html:31 +msgid "Simple search" +msgstr "Recherche simple" + +#: templates/search/sidebar.html:35 +msgid "Advanced search" +msgstr "Recherche avancée" diff --git a/search/templates/search/index.html b/search/templates/search/index.html index 2fad0c89..23b57cce 100644 --- a/search/templates/search/index.html +++ b/search/templates/search/index.html @@ -24,52 +24,54 @@ with this program; if not, write to the Free Software Foundation, Inc., {% endcomment %} {% load bootstrap3 %} +{% load i18n %} -{% block title %}Résultats de la recherche{% endblock %} +{% block title %}{% trans "Search results" %}{% endblock %} {% block content %} {% if users %} -

Résultats dans les utilisateurs

+

{% trans "Results among users:" %}

{% include "users/aff_users.html" with users_list=users %} {% endif%} {% if clubs %} -

Résultats dans les clubs

+

{% trans "Results among clubs:" %}

{% include "users/aff_clubs.html" with clubs_list=clubs %} {% endif%} {% if machines %} -

Résultats dans les machines :

+

{% trans "Results among machines:" %}

{% include "machines/aff_machines.html" with machines_list=machines %} {% endif %} {% if factures %} -

Résultats dans les factures :

+

{% trans "Results among invoices:" %}

{% include "cotisations/aff_cotisations.html" with facture_list=factures %} {% endif %} {% if whitelists %} -

Résultats dans les accès à titre gracieux :

+

{% trans "Results among whitelists:" %}

{% include "users/aff_whitelists.html" with white_list=whitelists %} {% endif %} {% if bans %} -

Résultats dans les banissements :

+

{% trans "Results among bans:" %}

{% include "users/aff_bans.html" with ban_list=bans %} {% endif %} {% if rooms %} -

Résultats dans les chambres :

+

{% trans "Results among rooms:" %}

{% include "topologie/aff_chambres.html" with room_list=rooms %} {% endif %} {% if ports %} -

Résultats dans les ports :

+

{% trans "Results among ports" %}

{% include "topologie/aff_port.html" with port_list=ports %} {% endif %} {% if switches %} -

Résultats dans les switchs :

+

{% trans "Results among switches" %}

{% include "topologie/aff_switch.html" with switch_list=switches %} {% endif %} {% if not users and not machines and not factures and not whitelists and not bans and not rooms and not ports and not switches %} -

Aucun résultat

+

{% trans "No result" %}

{% else %} -
(Seulement les {{ max_result }} premiers résultats sont affichés dans chaque catégorie)
+
{% blocktrans %}(Only the first {{ max_result }} results are displayed in each category){% endblocktrans %}
{% endif %}


{% endblock %} + diff --git a/search/templates/search/search.html b/search/templates/search/search.html index 7ae5d56d..42012339 100644 --- a/search/templates/search/search.html +++ b/search/templates/search/search.html @@ -24,8 +24,9 @@ with this program; if not, write to the Free Software Foundation, Inc., {% endcomment %} {% load bootstrap3 %} +{% load i18n %} -{% block title %}Recherche{% endblock %} +{% block title %}{% trans "Search" %}{% endblock %} {% block content %} {% bootstrap_form_errors search_form %} @@ -44,7 +45,8 @@ with this program; if not, write to the Free Software Foundation, Inc., {% if search_form.e %} {% bootstrap_field search_form.e %} {% endif %} - {% bootstrap_button "Search" button_type="submit" icon="search" %} + {% trans "Search" as tr_search %} + {% bootstrap_button tr_search button_type="submit" icon="search" %}

@@ -52,3 +54,4 @@ with this program; if not, write to the Free Software Foundation, Inc.,

{% endblock %} + diff --git a/search/templates/search/sidebar.html b/search/templates/search/sidebar.html index 8e29d379..a445ef41 100644 --- a/search/templates/search/sidebar.html +++ b/search/templates/search/sidebar.html @@ -23,14 +23,16 @@ 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 %} - Recherche simple + {% trans "Simple search" %} - Recherche avancée + {% trans "Advanced search" %} {% endblock %} +