Fin de la traduction

This commit is contained in:
Tom Hubrecht 2021-01-28 01:04:10 +01:00
parent 3fd0eb5929
commit 89e5260027
7 changed files with 66 additions and 61 deletions

View file

@ -1,6 +1,8 @@
from django import forms
from django.forms.models import inlineformset_factory
from fiches.models import Profile, Department, Phone, Social, Mail, Address
from django.utils.translation import gettext_lazy as _
from fiches.models import Address, Department, Mail, Phone, Profile, Social
class ProfileForm(forms.ModelForm):
@ -10,8 +12,8 @@ class ProfileForm(forms.ModelForm):
class SearchForm(forms.Form):
name = forms.CharField(label="Nom/Surnom", max_length=1023, required=False)
year = forms.IntegerField(label="Promotion", required=False)
name = forms.CharField(label=_("Nom/Surnom"), max_length=1023, required=False)
year = forms.IntegerField(label=_("Promotion"), required=False)
department = forms.ModelMultipleChoiceField(
queryset=Department.objects.all(), required=False
)
@ -23,7 +25,7 @@ class SearchForm(forms.Form):
and not cleaned_data["year"]
and not cleaned_data["department"]
):
raise forms.ValidationError(("Tous les champs sont vides"), code="invalid")
raise forms.ValidationError(_("Tous les champs sont vides"), code="invalid")
PhoneFormSet = inlineformset_factory(Profile, Phone, exclude=[])

View file

@ -1,7 +1,7 @@
from django.db import models
from django.core.validators import MinValueValidator
from django.utils.translation import ugettext_lazy as _
from django.contrib.auth.models import User
from django.core.validators import MinValueValidator
from django.db import models
from django.utils.translation import gettext_lazy as _
class Profile(models.Model):

View file

@ -27,7 +27,7 @@
<form id="search-area" method="post" action='{% url "home" %}'>
{% csrf_token %}
<input id="id_name" name="name" type="search" placeholder="Recherche Rapide">
<input id="id_name" name="name" type="search" placeholder="{% trans "Recherche Rapide" %}">
<button type="submit">{% trans "Rechercher" %}</button>
</form>

View file

@ -63,39 +63,23 @@
<label for="id_thurne">{% trans "Thurne :" %}</label>
{{ form.thurne }}
</div>
<div
class="form-entry multi-entry"
data-type-placeholder="{% trans "Personnel" %}"
data-value-placeholder="{% trans "0612345678" %}"
>
<label for="id_phone">{% trans "Numéro(s) de téléphone :" %}</label>
<div class="form-entry multi-entry" data-type-placeholder="{% trans "Personnel" %}" data-value-placeholder="{% trans "0612345678" %}">
<label for="id_phone">{% trans "Numéro(s) de téléphone :" %}</label>
{% trans "Ajouter un numéro" as add_number %}
{% include "fiches/multientry.html" with formset=phone_form new_entry_text=add_number %}
</div>
<div
class="form-entry multi-entry"
data-type-placeholder="{% trans "InstaTok" %}"
data-value-placeholder="{% trans "mon_profil_instatok" %}"
>
<div class="form-entry multi-entry" data-type-placeholder="{% trans "InstaTok" %}" data-value-placeholder="{% trans "mon_profil_instatok" %}">
<label for="id_social">{% trans "Réseaux sociaux :" %}</label>
{% trans "Ajouter un réseau social" as add_social %}
{% include "fiches/multientry.html" with formset=social_form new_entry_text=add_social %}
</div>
<div
class="form-entry multi-entry"
data-type-placeholder="{% trans "Professionelle" %}"
data-value-placeholder="{% trans "moi@ens.fr" %}"
>
<label for="id_mail">{% trans "Mail(s):" %}</label>
<div class="form-entry multi-entry" data-type-placeholder="{% trans "Professionelle" %}" data-value-placeholder="{% trans "moi@ens.fr" %}">
<label for="id_mail">{% trans "Mail(s) :" %}</label>
{% trans "Ajouter un email" as add_mail %}
{% include "fiches/multientry.html" with formset=mail_form new_entry_text=add_mail %}
</div>
<div
class="form-entry multi-entry"
data-type-placeholder="{% trans "Bureau" %}"
data-value-placeholder="{% trans "45 rue d'Ulm" %}"
>
<label for="id_address">{% trans "Adresse(s):" %}</label>
<div class="form-entry multi-entry" data-type-placeholder="{% trans "Bureau" %}" data-value-placeholder="{% trans "45 rue d'Ulm" %}">
<label for="id_address">{% trans "Adresse(s) :" %}</label>
{% trans "Ajouter une adresse" as add_address %}
{% include "fiches/multientry.html" with formset=address_form new_entry_text=add_address %}
</div>
@ -120,5 +104,5 @@
{% endblock %}
{% block extra_js %}
<script type="text/javascript" src="{% static "fiches/js/forms.js" %}"></script>
<script type="text/javascript" src="{% static "fiches/js/forms.js" %}"></script>
{% endblock %}

View file

@ -14,7 +14,7 @@
<label for="id_year">{% trans "Promotion :" %}</label>
{{ form.year }}
<label for="id_department">{% trans "Department :" %}</label>
<label for="id_department">{% trans "Départment :" %}</label>
{{ form.department }}
<input type="submit" value="{% trans "Recherche" %}">
</form>

Binary file not shown.

View file

@ -7,17 +7,29 @@ msgid ""
msgstr ""
"Project-Id-Version: \n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2021-01-27 23:35+0000\n"
"PO-Revision-Date: 2021-01-28 00:50+0100\n"
"POT-Creation-Date: 2021-01-28 00:03+0000\n"
"PO-Revision-Date: 2021-01-28 01:03+0100\n"
"Last-Translator: Tom Hubrecht <tom.hubrecht@ens.fr>\n"
"Language-Team: \n"
"Language: en\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
"Last-Translator: Tom Hubrecht <tom.hubrecht@ens.fr>\n"
"Language-Team: \n"
"X-Generator: Poedit 2.4.1\n"
#: fiches/forms.py:15
msgid "Nom/Surnom"
msgstr "Name/Nickname"
#: fiches/forms.py:16
msgid "Promotion"
msgstr "Entry year"
#: fiches/forms.py:28
msgid "Tous les champs sont vides"
msgstr "All fields are empty"
#: fiches/models.py:11
msgid "utilisateur"
msgstr "user"
@ -100,6 +112,10 @@ msgstr "address"
msgid "Annuaire des élèves de l'ENS"
msgstr "ENS student directory"
#: fiches/templates/fiches/base.html:30
msgid "Recherche Rapide"
msgstr "Quick Search"
#: fiches/templates/fiches/base.html:31
msgid "Rechercher"
msgstr "Search"
@ -232,85 +248,85 @@ msgstr "Date of birth:"
#: fiches/templates/fiches/fiches_modif.html:63
msgid "Thurne :"
msgstr "Room"
msgstr "Room :"
#: fiches/templates/fiches/fiches_modif.html:68
#: fiches/templates/fiches/fiches_modif.html:66
msgid "Personnel"
msgstr "Private"
#: fiches/templates/fiches/fiches_modif.html:69
#: fiches/templates/fiches/fiches_modif.html:66
msgid "0612345678"
msgstr "0612345678"
#: fiches/templates/fiches/fiches_modif.html:71
#: fiches/templates/fiches/fiches_modif.html:67
msgid "Numéro(s) de téléphone :"
msgstr "Phone number(s):"
#: fiches/templates/fiches/fiches_modif.html:72
#: fiches/templates/fiches/fiches_modif.html:68
msgid "Ajouter un numéro"
msgstr "Add a phone number"
#: fiches/templates/fiches/fiches_modif.html:77
#: fiches/templates/fiches/fiches_modif.html:71
msgid "InstaTok"
msgstr "InstaTok"
#: fiches/templates/fiches/fiches_modif.html:78
#: fiches/templates/fiches/fiches_modif.html:71
msgid "mon_profil_instatok"
msgstr "my_instatok_profile"
#: fiches/templates/fiches/fiches_modif.html:80
#: fiches/templates/fiches/fiches_modif.html:72
msgid "Réseaux sociaux :"
msgstr "Social networks:"
#: fiches/templates/fiches/fiches_modif.html:81
#: fiches/templates/fiches/fiches_modif.html:73
msgid "Ajouter un réseau social"
msgstr "Add a social network"
#: fiches/templates/fiches/fiches_modif.html:86
#: fiches/templates/fiches/fiches_modif.html:76
msgid "Professionelle"
msgstr "Professional"
#: fiches/templates/fiches/fiches_modif.html:87
#: fiches/templates/fiches/fiches_modif.html:76
msgid "moi@ens.fr"
msgstr "me@ens.fr"
#: fiches/templates/fiches/fiches_modif.html:89
msgid "Mail(s):"
#: fiches/templates/fiches/fiches_modif.html:77
msgid "Mail(s) :"
msgstr "E-mail(s):"
#: fiches/templates/fiches/fiches_modif.html:90
#: fiches/templates/fiches/fiches_modif.html:78
msgid "Ajouter un email"
msgstr "Add an e-mail"
#: fiches/templates/fiches/fiches_modif.html:95
#: fiches/templates/fiches/fiches_modif.html:81
msgid "Bureau"
msgstr "Office"
#: fiches/templates/fiches/fiches_modif.html:96
#: fiches/templates/fiches/fiches_modif.html:81
msgid "45 rue d'Ulm"
msgstr "45 rue d'Ulm"
#: fiches/templates/fiches/fiches_modif.html:98
msgid "Adresse(s):"
#: fiches/templates/fiches/fiches_modif.html:82
msgid "Adresse(s) :"
msgstr "Address(es):"
#: fiches/templates/fiches/fiches_modif.html:99
#: fiches/templates/fiches/fiches_modif.html:83
msgid "Ajouter une adresse"
msgstr "Add an address"
#: fiches/templates/fiches/fiches_modif.html:103
#: fiches/templates/fiches/fiches_modif.html:87
msgid "Champ libre :"
msgstr "Free space:"
#: fiches/templates/fiches/fiches_modif.html:109
#: fiches/templates/fiches/fiches_modif.html:93
msgid "Apparaître sur l'annuaire papier ?"
msgstr "Appear on the paper directory?"
#: fiches/templates/fiches/fiches_modif.html:113
#: fiches/templates/fiches/fiches_modif.html:97
msgid "Conserver la fiche annuaire ?"
msgstr "Keep the directory record?"
#: fiches/templates/fiches/fiches_modif.html:116
#: fiches/templates/fiches/fiches_modif.html:100
msgid "Enregistrer"
msgstr "Save"
@ -323,9 +339,12 @@ msgid "Nom/Surnom :"
msgstr "Name/Nickname:"
#: fiches/templates/fiches/home.html:17
msgid "Department :"
msgid "Départment :"
msgstr "Department:"
#: fiches/templates/fiches/home.html:19
msgid "Recherche"
msgstr "Search"
#~ msgid "Department :"
#~ msgstr "Department:"