mirror of
https://gitlab2.federez.net/re2o/re2o
synced 2024-12-23 15:33:45 +00:00
Translation of search/ (front)
This commit is contained in:
parent
c3b3146f39
commit
e27625dd80
6 changed files with 210 additions and 38 deletions
|
@ -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,10 +56,10 @@ 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
|
||||
)
|
||||
|
||||
|
|
BIN
search/locale/fr/LC_MESSAGES/django.mo
Normal file
BIN
search/locale/fr/LC_MESSAGES/django.mo
Normal file
Binary file not shown.
163
search/locale/fr/LC_MESSAGES/django.po
Normal file
163
search/locale/fr/LC_MESSAGES/django.po
Normal file
|
@ -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 <laouen.fernet@supelec.fr>\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"
|
|
@ -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 %}
|
||||
<h2>Résultats dans les utilisateurs</h2>
|
||||
<h2>{% trans "Results among users:" %}</h2>
|
||||
{% include "users/aff_users.html" with users_list=users %}
|
||||
{% endif%}
|
||||
{% if clubs %}
|
||||
<h2>Résultats dans les clubs</h2>
|
||||
<h2>{% trans "Results among clubs:" %}</h2>
|
||||
{% include "users/aff_clubs.html" with clubs_list=clubs %}
|
||||
{% endif%}
|
||||
{% if machines %}
|
||||
<h2>Résultats dans les machines : </h2>
|
||||
<h2>{% trans "Results among machines:" %}</h2>
|
||||
{% include "machines/aff_machines.html" with machines_list=machines %}
|
||||
{% endif %}
|
||||
{% if factures %}
|
||||
<h2>Résultats dans les factures : </h2>
|
||||
<h2>{% trans "Results among invoices:" %}</h2>
|
||||
{% include "cotisations/aff_cotisations.html" with facture_list=factures %}
|
||||
{% endif %}
|
||||
{% if whitelists %}
|
||||
<h2>Résultats dans les accès à titre gracieux : </h2>
|
||||
<h2>{% trans "Results among whitelists:" %}</h2>
|
||||
{% include "users/aff_whitelists.html" with white_list=whitelists %}
|
||||
{% endif %}
|
||||
{% if bans %}
|
||||
<h2>Résultats dans les banissements : </h2>
|
||||
<h2>{% trans "Results among bans:" %}</h2>
|
||||
{% include "users/aff_bans.html" with ban_list=bans %}
|
||||
{% endif %}
|
||||
{% if rooms %}
|
||||
<h2>Résultats dans les chambres : </h2>
|
||||
<h2>{% trans "Results among rooms:" %}</h2>
|
||||
{% include "topologie/aff_chambres.html" with room_list=rooms %}
|
||||
{% endif %}
|
||||
{% if ports %}
|
||||
<h2>Résultats dans les ports : </h2>
|
||||
<h2>{% trans "Results among ports" %}</h2>
|
||||
{% include "topologie/aff_port.html" with port_list=ports %}
|
||||
{% endif %}
|
||||
{% if switches %}
|
||||
<h2>Résultats dans les switchs : </h2>
|
||||
<h2>{% trans "Results among switches" %}</h2>
|
||||
{% 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 %}
|
||||
<h3>Aucun résultat</h3>
|
||||
<h3>{% trans "No result" %}</h3>
|
||||
{% else %}
|
||||
<h6>(Seulement les {{ max_result }} premiers résultats sont affichés dans chaque catégorie)</h6>
|
||||
<h6>{% blocktrans %}(Only the first {{ max_result }} results are displayed in each category){% endblocktrans %}</h6>
|
||||
{% endif %}
|
||||
<br />
|
||||
<br />
|
||||
<br />
|
||||
{% endblock %}
|
||||
|
||||
|
|
|
@ -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" %}
|
||||
</form>
|
||||
<br />
|
||||
<br />
|
||||
|
@ -52,3 +54,4 @@ with this program; if not, write to the Free Software Foundation, Inc.,
|
|||
<br />
|
||||
<br />
|
||||
{% endblock %}
|
||||
|
||||
|
|
|
@ -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 %}
|
||||
<a class="list-group-item list-group-item-warning" href="{% url "search:search" %}">
|
||||
<i class="fa fa-search"></i>
|
||||
Recherche simple
|
||||
{% trans "Simple search" %}
|
||||
</a>
|
||||
<a class="list-group-item list-group-item-warning" href="{% url "search:searchp" %}">
|
||||
<i class="fa fa-search-plus"></i>
|
||||
Recherche avancée
|
||||
{% trans "Advanced search" %}
|
||||
</a>
|
||||
{% endblock %}
|
||||
|
||||
|
|
Loading…
Reference in a new issue