diff --git a/equipment/models.py b/equipment/models.py
index e93cbd3..9233787 100644
--- a/equipment/models.py
+++ b/equipment/models.py
@@ -47,7 +47,7 @@ class EquipmentAttribution(models.Model):
equipment = models.ForeignKey(AbstractEquipment)
activity = models.ForeignKey(Activity)
amount = models.PositiveSmallIntegerField(_("Quantité attribuée"))
- remarks = models.TextField("Remarques concernant l'attribution")
+ remarks = models.TextField(_("Remarques concernant l'attribution"))
class Meta:
verbose_name = _("attribution de matériel")
@@ -60,7 +60,7 @@ class EquipmentAttribution(models.Model):
class EquipmentRemark(models.Model):
- remark = models.TextField("Remarque sur le matériel")
+ remark = models.TextField(_("Remarque sur le matériel"))
equipment = models.ForeignKey(
AbstractEquipment,
related_name="remarks",
diff --git a/event/models.py b/event/models.py
index 7723796..aaad757 100644
--- a/event/models.py
+++ b/event/models.py
@@ -66,14 +66,14 @@ class ActivityTag(models.Model):
)
color_regex = RegexValidator(
regex=r'^#(?:[0-9a-fA-F]{3}){1,2}$',
- message="La chaîne de caractère rentrée n'est pas"
- "une couleur en hexadécimal.",
+ message=_("La chaîne de caractère rentrée n'est pas"
+ " une couleur en hexadécimal."),
)
color = models.CharField(
_('Couleur'),
max_length=7,
validators=[color_regex],
- help_text="Rentrer une couleur en hexadécimal",
+ help_text=_("Rentrer une couleur en hexadécimal"),
)
class Meta:
diff --git a/requirements.txt b/requirements.txt
index 73d7caa..2feecff 100644
--- a/requirements.txt
+++ b/requirements.txt
@@ -1,4 +1,4 @@
-Django==1.10.*
+Django==1.11.*
Pillow==3.3.0
psycopg2==2.6.2
django-bootstrap-form==3.2.1
diff --git a/shared/templates/base.html b/shared/templates/base.html
index 0b52928..fe950b6 100644
--- a/shared/templates/base.html
+++ b/shared/templates/base.html
@@ -1,5 +1,6 @@
{% extends "base_html.html" %}
{% load staticfiles %}
+{% load i18n %}
{% block title %}GestionÉvènementiel{% block sub_title %}{% endblock %}{% endblock %}
@@ -12,7 +13,7 @@
{% if user.is_authenticated %}
{{ user.username }}
{% else %}
- non connecté·e
+ {% trans "non connecté·e" %}
{% endif %}
@@ -22,19 +23,19 @@
- Se connecter
+ {% trans "Se connecter" %}
- Créer un compte
+ {% trans "Créer un compte" %}
- Mot de passe oublié
+ {% trans "Mot de passe oublié" %}
{% endif %}
@@ -42,13 +43,13 @@
- Changer de mot de passe
+ {% trans "Changer de mot de passe" %}
- Se déconnecter
+ {% trans "Se déconnecter" %}
{% endif %}
@@ -66,4 +67,3 @@
{% endblock %}
-
diff --git a/shared/templates/base_error.html b/shared/templates/base_error.html
index 841b576..88fb504 100644
--- a/shared/templates/base_error.html
+++ b/shared/templates/base_error.html
@@ -1,5 +1,3 @@
{% extends "base.html" %}
-{% block page_title %}Erreur !{% endblock %}
-
-
+{% block page_title %}{% trans "Erreur !" %}{% endblock %}
diff --git a/shared/templates/base_footer.html b/shared/templates/base_footer.html
index 331c9e4..ca69991 100644
--- a/shared/templates/base_footer.html
+++ b/shared/templates/base_footer.html
@@ -1,5 +1,8 @@
+{% load i18n %}
diff --git a/shared/templates/base_nav.html b/shared/templates/base_nav.html
index 2763935..65a0f67 100644
--- a/shared/templates/base_nav.html
+++ b/shared/templates/base_nav.html
@@ -1,3 +1,4 @@
+{% load i18n %}
{% if user.is_authenticated %}
-
@@ -67,12 +68,12 @@
diff --git a/shared/templates/home.html b/shared/templates/home.html
index ec425b7..ee3e655 100644
--- a/shared/templates/home.html
+++ b/shared/templates/home.html
@@ -1,6 +1,7 @@
{% extends "base.html" %}
+{% load i18n %}
-{% block page_title %}Acceuil{% endblock %}
+{% block page_title %}{% trans "Accueil" %}{% endblock %}
{% block content %}
Bonjours, je suis une maison
diff --git a/shared/urls.py b/shared/urls.py
index f591c4a..1ffb7e5 100644
--- a/shared/urls.py
+++ b/shared/urls.py
@@ -3,5 +3,5 @@ from .views import Home
app_name = 'shared'
urlpatterns = [
- url(r'$', Home.as_view(), name='home'),
+ url(r'^$', Home.as_view(), name='home'),
]
diff --git a/users/urls.py b/users/urls.py
index a80c300..6933001 100644
--- a/users/urls.py
+++ b/users/urls.py
@@ -1,6 +1,7 @@
from django.conf.urls import url
from django.contrib.auth import views as auth_views
from django.core.urlresolvers import reverse_lazy
+from django.utils.translation import ugettext_lazy as _
from shared.views import Home
from users.views import CreateUser
@@ -13,8 +14,8 @@ urlpatterns = [
auth_views.login,
{'template_name': 'users/login.html',
'extra_context': {
- 'page_title': 'Connexion',
- 'button': 'Se connecter',
+ 'page_title': _('Connexion'),
+ 'button': _('Se connecter'),
},
},
name='login',
@@ -29,8 +30,8 @@ urlpatterns = [
{'template_name': 'users/change_pass.html',
'post_change_redirect': reverse_lazy('shared:home'),
'extra_context': {
- 'page_title': 'Changement de mot de passe',
- 'button': 'Modifier',
+ 'page_title': _('Changement de mot de passe'),
+ 'button': _('Modifier'),
},
},
name='password_change'),
@@ -43,8 +44,8 @@ urlpatterns = [
'subject_template_name': 'subject_password_reset.txt',
'post_reset_redirect': reverse_lazy('users:password_reset_done'),
'extra_context': {
- 'page_title': 'Demander un nouveau mot de passe',
- 'button': 'Envoyer'
+ 'page_title': _('Demander un nouveau mot de passe'),
+ 'button': _('Envoyer')
},
},
name='password_reset'),
@@ -62,8 +63,8 @@ urlpatterns = [
'user:password_reset_complete'
),
'extra_context': {
- 'page_title': 'Changer de mot de passe',
- 'button': 'Changer'
+ 'page_title': _('Changer de mot de passe'),
+ 'button': _('Changer')
},
},
name='password_reset_confirm'),