diff --git a/fiches/forms.py b/fiches/forms.py index ffd7b3b..b8f9782 100644 --- a/fiches/forms.py +++ b/fiches/forms.py @@ -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=[]) diff --git a/fiches/models.py b/fiches/models.py index 8c7111a..90c8427 100644 --- a/fiches/models.py +++ b/fiches/models.py @@ -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): diff --git a/fiches/templates/fiches/base.html b/fiches/templates/fiches/base.html index 9ecc5f6..8d1eecb 100644 --- a/fiches/templates/fiches/base.html +++ b/fiches/templates/fiches/base.html @@ -27,7 +27,7 @@
{% csrf_token %} - +
diff --git a/fiches/templates/fiches/fiches_modif.html b/fiches/templates/fiches/fiches_modif.html index 71609cc..8d77c9c 100644 --- a/fiches/templates/fiches/fiches_modif.html +++ b/fiches/templates/fiches/fiches_modif.html @@ -63,39 +63,23 @@ {{ form.thurne }} -
- +
+ {% trans "Ajouter un numéro" as add_number %} {% include "fiches/multientry.html" with formset=phone_form new_entry_text=add_number %}
-
+
{% trans "Ajouter un réseau social" as add_social %} {% include "fiches/multientry.html" with formset=social_form new_entry_text=add_social %}
-
- +
+ {% trans "Ajouter un email" as add_mail %} {% include "fiches/multientry.html" with formset=mail_form new_entry_text=add_mail %}
-
- +
+ {% trans "Ajouter une adresse" as add_address %} {% include "fiches/multientry.html" with formset=address_form new_entry_text=add_address %}
@@ -120,5 +104,5 @@ {% endblock %} {% block extra_js %} - + {% endblock %} diff --git a/fiches/templates/fiches/home.html b/fiches/templates/fiches/home.html index f6648c5..bd2af5a 100644 --- a/fiches/templates/fiches/home.html +++ b/fiches/templates/fiches/home.html @@ -14,7 +14,7 @@ {{ form.year }} - + {{ form.department }} diff --git a/locale/en/LC_MESSAGES/django.mo b/locale/en/LC_MESSAGES/django.mo index 92899ca..8774442 100644 Binary files a/locale/en/LC_MESSAGES/django.mo and b/locale/en/LC_MESSAGES/django.mo differ diff --git a/locale/en/LC_MESSAGES/django.po b/locale/en/LC_MESSAGES/django.po index eabd8a7..4c5b3dd 100644 --- a/locale/en/LC_MESSAGES/django.po +++ b/locale/en/LC_MESSAGES/django.po @@ -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 \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 \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:"