diff --git a/accounts/templates/accounts/participation_list.html b/accounts/templates/accounts/participation_list.html
index 4c2557c..1aa073a 100644
--- a/accounts/templates/accounts/participation_list.html
+++ b/accounts/templates/accounts/participation_list.html
@@ -1,7 +1,6 @@
{% extends 'base.html' %}
-{% load bootstrap3 %}
-{% load accounts_tags %}
+{% load bootstrap3 accounts_tags i18n %}
{% block admintab %} active{% endblock %}
@@ -30,14 +29,14 @@
{% endif %}{% endfor %}
+ title="{% trans "View conversation" %}">
{% if request.user in participation.conversation.subscribers.all %}
+ data-toggle="tooltip" data-placement="bottom" title="{% trans "Unsubscribe to conversation" %}">
{% else %}
+ data-toggle="tooltip" data-placement="bottom" title="{% trans "Subscribe to conversation" %}">
{% endif %}
|
diff --git a/conversations/templates/conversations/_message_form.html b/conversations/templates/conversations/_message_form.html
index 6dfb3a5..5049e06 100644
--- a/conversations/templates/conversations/_message_form.html
+++ b/conversations/templates/conversations/_message_form.html
@@ -1,6 +1,7 @@
+{% load i18n %}
- Send a message
+ {% trans "Send a message" %}
diff --git a/conversations/templates/conversations/conversation.html b/conversations/templates/conversations/conversation.html
index aa958c9..2f482ff 100644
--- a/conversations/templates/conversations/conversation.html
+++ b/conversations/templates/conversations/conversation.html
@@ -1,13 +1,15 @@
{% extends 'base.html' %}
+{% load i18n %}
+
{% block admintab %} active{% endblock %}
{% block content %}
diff --git a/conversations/templates/conversations/correspondents.html b/conversations/templates/conversations/correspondents.html
index 4fe49ab..b3af798 100644
--- a/conversations/templates/conversations/correspondents.html
+++ b/conversations/templates/conversations/correspondents.html
@@ -1,14 +1,14 @@
{% extends 'base.html' %}
-{% load bootstrap3 %}
+{% load bootstrap3 i18n %}
{% block admintab %} active{% endblock %}
{% block content %}
@@ -26,9 +26,9 @@
{% if request.user in correspondent.conversation.subscribers.all %}
-
+
{% else %}
-
+
{% endif %}
|
diff --git a/conversations/templates/conversations/inbox.html b/conversations/templates/conversations/inbox.html
index b2715f1..9e8085f 100644
--- a/conversations/templates/conversations/inbox.html
+++ b/conversations/templates/conversations/inbox.html
@@ -1,10 +1,12 @@
{% extends 'conversations/conversation.html' %}
+{% load i18n %}
+
{% block inboxtab %} class="active"{% endblock %}
{% block admintab %}{% endblock %}
{% block heading %}
-You can use this page to communicate with the staff.
+{% trans "You can use this page to communicate with the staff." %}
{% endblock %}
{% block panelstyleblock %}{% if message.author == message.conversation.participation.user %}info{% else %}success{% endif %}{% endblock %}
diff --git a/locale/fr/LC_MESSAGES/django.mo b/locale/fr/LC_MESSAGES/django.mo
new file mode 100644
index 0000000..e228b44
Binary files /dev/null and b/locale/fr/LC_MESSAGES/django.mo differ
diff --git a/locale/fr/LC_MESSAGES/django.po b/locale/fr/LC_MESSAGES/django.po
new file mode 100644
index 0000000..980dc47
--- /dev/null
+++ b/locale/fr/LC_MESSAGES/django.po
@@ -0,0 +1,233 @@
+# SOME DESCRIPTIVE TITLE.
+# Copyright (C) 2016
+# This file is distributed under the same license as the PonyConf package.
+# FIRST AUTHOR , YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2016-07-23 01:11+0000\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME \n"
+"Language-Team: LANGUAGE \n"
+"Language: \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"
+
+#: accounts/templates/accounts/participation_list.html:32
+msgid "View conversation"
+msgstr "Afficher la discussion"
+
+#: accounts/templates/accounts/participation_list.html:35
+#: conversations/templates/conversations/correspondents.html:29
+msgid "Unsubscribe to conversation"
+msgstr "Se désabonner de la discussion"
+
+#: accounts/templates/accounts/participation_list.html:39
+#: conversations/templates/conversations/correspondents.html:31
+msgid "Subscribe to conversation"
+msgstr "S’abonner à la discussion"
+
+#: conversations/templates/conversations/_message_form.html:4
+msgid "Send a message"
+msgstr "Envoyer un message"
+
+#: conversations/templates/conversations/_message_form.html:12
+msgid "Send"
+msgstr "Envoyer"
+
+#: conversations/templates/conversations/conversation.html:10
+msgid "Messaging"
+msgstr "Messagerie"
+
+#: conversations/templates/conversations/conversation.html:12
+msgid "Go back to correspondents list"
+msgstr "Retourner à la liste des correspondants"
+
+#: conversations/templates/conversations/correspondents.html:10
+msgid "Correspondents"
+msgstr "Correspondants"
+
+#: conversations/templates/conversations/correspondents.html:11
+msgid "This is the list of participants that you follow."
+msgstr "Ceci est la liste des participants que vous suivez"
+
+#: conversations/templates/conversations/inbox.html:9
+msgid "You can use this page to communicate with the staff."
+msgstr ""
+"Vous pouvez utiliser cette page pour communiquer avec l’équipe organisatrice."
+
+#: ponyconf/settings.py:135
+msgid "English"
+msgstr "Anglais"
+
+#: ponyconf/settings.py:136
+msgid "French"
+msgstr "Français"
+
+#: ponyconf/templates/base.html:45
+msgid "Home"
+msgstr "Accueil"
+
+#: ponyconf/templates/base.html:47
+#: proposals/templates/proposals/user_details.html:13
+msgid "Talks"
+msgstr "Exposés"
+
+#: ponyconf/templates/base.html:48 proposals/models.py:48
+msgid "Topics"
+msgstr "Thèmes"
+
+#: ponyconf/templates/base.html:50 proposals/models.py:44
+msgid "Speakers"
+msgstr "Orateurs"
+
+#: ponyconf/templates/base.html:75
+msgid "Register"
+msgstr "S’enregistrer"
+
+#: ponyconf/templates/base.html:76
+msgid "Login"
+msgstr "Se connecter"
+
+#: ponyconf/templates/base.html:101
+msgid "Powered by"
+msgstr "Propulsé par"
+
+#: proposals/models.py:22
+msgid "Name"
+msgstr "Nom"
+
+#: proposals/models.py:25
+msgid "Reviewers"
+msgstr "Responsables"
+
+#: proposals/models.py:45
+msgid "Title"
+msgstr "Titre"
+
+#: proposals/models.py:47
+msgid "Description"
+msgstr "Description"
+
+#: proposals/models.py:49
+msgid "Format"
+msgstr "Format"
+
+#: proposals/templates/proposals/_talk_list.html:24
+msgid "No talks"
+msgstr "Aucun thème"
+
+#: proposals/templates/proposals/speaker_list.html:9
+#: proposals/templates/proposals/talk_detail.html:21
+msgid "Speakers:"
+msgstr "Orateurs :"
+
+#: proposals/templates/proposals/speaker_list.html:15
+#: proposals/templates/proposals/topic_list.html:18
+msgid "talk"
+msgstr "thème"
+
+#: proposals/templates/proposals/speaker_list.html:18
+#: proposals/templates/proposals/talk_detail.html:27
+msgid "No speakers."
+msgstr "Aucun orateur."
+
+#: proposals/templates/proposals/talk_detail.html:17
+msgid "Description:"
+msgstr "Description :"
+
+#: proposals/templates/proposals/talk_detail.html:31
+#: proposals/templates/proposals/topic_list.html:9
+msgid "Topics:"
+msgstr "Thèmes :"
+
+#: proposals/templates/proposals/talk_detail.html:40
+msgid "Moderation"
+msgstr "Modération"
+
+#: proposals/templates/proposals/talk_detail.html:42
+msgid "Vote:"
+msgstr "Vote :"
+
+#: proposals/templates/proposals/talk_detail.html:51
+msgid "Sum:"
+msgstr "Somme :"
+
+#: proposals/templates/proposals/talk_detail.html:53
+msgid "Status:"
+msgstr "Status :"
+
+#: proposals/templates/proposals/talk_detail.html:56
+msgid "Messages:"
+msgstr "Messages :"
+
+#: proposals/templates/proposals/talk_edit.html:9
+#: proposals/templates/proposals/talks.html:9
+msgid "Propose a talk"
+msgstr "Proposer un exposé"
+
+#: proposals/templates/proposals/talks.html:12
+msgid "My participing talks:"
+msgstr "Exposés auquels je participe :"
+
+#: proposals/templates/proposals/talks.html:17
+msgid "Others talks:"
+msgstr "Autres exposés :"
+
+#: proposals/templates/proposals/topic_form.html:14
+msgid "Topic"
+msgstr "Thème"
+
+#: proposals/templates/proposals/topic_list.html:16
+msgid "reviewer"
+msgstr "Responsable"
+
+#: proposals/templates/proposals/topic_list.html:17
+msgid "and"
+msgstr "et"
+
+#: proposals/templates/proposals/topic_list.html:24
+msgid "No topics."
+msgstr "Aucun thèmes."
+
+#: proposals/templates/proposals/topic_list.html:29
+msgid "Add a topic"
+msgstr "Ajouter un thème"
+
+#: proposals/templates/proposals/user_details.html:10
+msgid "Biography"
+msgstr "Biographie"
+
+#: proposals/templates/proposals/user_details.html:17
+msgid "Notes"
+msgstr "Notes"
+
+#: proposals/templates/proposals/user_details.html:19
+msgid "Edit"
+msgstr "Éditer"
+
+#: proposals/views.py:38
+#, python-format
+msgid "Talks related to %s:"
+msgstr "Exposés portant sur la thèmatique %s :"
+
+#: proposals/views.py:57
+msgid "Talk modified successfully!"
+msgstr "Exposé modifié avec succès !"
+
+#: proposals/views.py:63
+msgid "Talk proposed successfully!"
+msgstr "Exposé proposé avec succès !"
+
+#: proposals/views.py:131
+msgid "Vote successfully created"
+msgstr "A voté !"
+
+#: proposals/views.py:131
+msgid "Vote successfully updated"
+msgstr "Vote mis à jour"
diff --git a/ponyconf/settings.py b/ponyconf/settings.py
index d2cf3ca..2b7c542 100644
--- a/ponyconf/settings.py
+++ b/ponyconf/settings.py
@@ -10,6 +10,8 @@ For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.9/ref/settings/
"""
+from django.utils.translation import ugettext_lazy as _
+
import os
# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
@@ -56,6 +58,7 @@ INSTALLED_APPS = [
MIDDLEWARE_CLASSES = [
'django.middleware.security.SecurityMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware',
+ 'django.middleware.locale.LocaleMiddleware',
'django.middleware.common.CommonMiddleware',
'django.middleware.csrf.CsrfViewMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
@@ -120,8 +123,6 @@ AUTH_PASSWORD_VALIDATORS = [
# Internationalization
# https://docs.djangoproject.com/en/1.9/topics/i18n/
-LANGUAGE_CODE = 'en-us'
-
TIME_ZONE = 'UTC'
USE_I18N = True
@@ -130,6 +131,17 @@ USE_L10N = True
USE_TZ = True
+LANGUAGES = [
+ ('en', _('English')),
+ ('fr', _('French')),
+]
+
+LANGUAGE_CODE = 'en-us'
+
+LOCALE_PATHS = [
+ os.path.join(BASE_DIR, 'locale'),
+]
+
# Static files (CSS, JavaScript, Images)
# https://docs.djangoproject.com/en/1.9/howto/static-files/
diff --git a/ponyconf/templates/base.html b/ponyconf/templates/base.html
index 8a8c8af..30888da 100644
--- a/ponyconf/templates/base.html
+++ b/ponyconf/templates/base.html
@@ -1,6 +1,4 @@
-{% load staticfiles %}
-{% load bootstrap3 %}
-{% load accounts_tags %}
+{% load staticfiles bootstrap3 accounts_tags i18n %}
@@ -43,12 +41,12 @@
{% block navbar-right %}{% endblock %}
@@ -99,7 +97,7 @@
diff --git a/proposals/models.py b/proposals/models.py
index 4d80ea2..c4fd0b7 100644
--- a/proposals/models.py
+++ b/proposals/models.py
@@ -5,6 +5,7 @@ from django.contrib.sites.models import Site
from django.core.urlresolvers import reverse
from django.core.validators import MaxValueValidator, MinValueValidator
from django.db import models
+from django.utils.translation import ugettext_lazy as _
from autoslug import AutoSlugField
@@ -18,10 +19,10 @@ class Topic(PonyConfModel):
site = models.ForeignKey(Site, on_delete=models.CASCADE)
- name = models.CharField(max_length=128, verbose_name='Name')
+ name = models.CharField(max_length=128, verbose_name=_('Name'))
slug = AutoSlugField(populate_from='name', unique=True)
- reviewers = models.ManyToManyField(User, blank=True)
+ reviewers = models.ManyToManyField(User, blank=True, verbose_name=_('Reviewers'))
class Meta:
unique_together = ('site', 'name')
@@ -40,12 +41,12 @@ class Talk(PonyConfModel):
site = models.ForeignKey(Site, on_delete=models.CASCADE)
proposer = models.ForeignKey(User, related_name='+')
- speakers = models.ManyToManyField(User)
- title = models.CharField(max_length=128, verbose_name='Title')
+ speakers = models.ManyToManyField(User, verbose_name=_('Speakers'))
+ title = models.CharField(max_length=128, verbose_name=_('Title'))
slug = AutoSlugField(populate_from='title', unique=True)
- description = models.TextField(blank=True, verbose_name='Description')
- topics = models.ManyToManyField(Topic, blank=True)
- event = models.IntegerField(choices=enum_to_choices(EVENTS), default=EVENTS.conference_short.value)
+ description = models.TextField(blank=True, verbose_name=_('Description'))
+ topics = models.ManyToManyField(Topic, blank=True, verbose_name=_('Topics'))
+ event = models.IntegerField(choices=enum_to_choices(EVENTS), default=EVENTS.conference_short.value, verbose_name=_('Format'))
accepted = models.NullBooleanField(default=None)
def __str__(self):
diff --git a/proposals/templates/proposals/_talk_list.html b/proposals/templates/proposals/_talk_list.html
index d5b5b0f..d14373f 100644
--- a/proposals/templates/proposals/_talk_list.html
+++ b/proposals/templates/proposals/_talk_list.html
@@ -1,3 +1,4 @@
+{% load i18n %}
{% regroup talk_list by event as event_list %}
{% for event in event_list %}
@@ -20,6 +21,6 @@
{% endfor %}
- {% empty %}Nothing
+ {% empty %}{% trans "No talks" %}
{% endfor %}
diff --git a/proposals/templates/proposals/speaker_list.html b/proposals/templates/proposals/speaker_list.html
index d4b1a8d..d8d25b3 100644
--- a/proposals/templates/proposals/speaker_list.html
+++ b/proposals/templates/proposals/speaker_list.html
@@ -1,19 +1,21 @@
{% extends 'base.html' %}
+{% load i18n %}
+
{% block speakertab %} class="active"{% endblock %}
{% block content %}
-Speakers:
+{% trans "Speakers:" %}
{% for speaker in user_list %}
-
{{ speaker.profile }}
- ({{ speaker.talk_set.count }} talk{{ speaker.talk_set.count|pluralize }})
+ ({{ speaker.talk_set.count }} {% trans "talk" %}{{ speaker.talk_set.count|pluralize }})
{% empty %}
- - No speakers.
+ - {% trans "No speakers." %}
{% endfor %}
diff --git a/proposals/templates/proposals/talk_detail.html b/proposals/templates/proposals/talk_detail.html
index d2d5fd7..e06f5c0 100644
--- a/proposals/templates/proposals/talk_detail.html
+++ b/proposals/templates/proposals/talk_detail.html
@@ -1,5 +1,7 @@
{% extends 'base.html' %}
+{% load i18n %}
+
{% block talktab %} class="active"{% endblock %}
{% block content %}
@@ -12,21 +14,21 @@
{{ talk.get_event_display }}
-Description:
+{% trans "Description:" %}
{{ talk.description }}
-Speakers:
+{% trans "Speakers:" %}
{% for speaker in talk.speakers.all %}
- {{ speaker }}
{% empty %}
- - No speaker.
+ - {% trans "No speakers." %}
{% endfor %}
-Topics:
+{% trans "Topics:" %}
{% for topic in talk.topics.all %}
@@ -35,9 +37,9 @@
{% if moderate_perm %}
-Moderation
+{% trans "Moderation" %}
-Vote:
+{% trans "Vote:" %}
-Sum: {{ talk.score }}
+{% trans "Sum:" %} {{ talk.score }}
-Status:
+{% trans "Status:" %}
{{ talk.accepted|yesno:"✔,✘,?" }}
-Messages:
+{% trans "Messages:" %}
{% for message in talk.conversation.messages.all %}
{% include 'conversations/_message_detail.html' %}
{% endfor %}
diff --git a/proposals/templates/proposals/talk_edit.html b/proposals/templates/proposals/talk_edit.html
index 87d50f5..e54bf64 100644
--- a/proposals/templates/proposals/talk_edit.html
+++ b/proposals/templates/proposals/talk_edit.html
@@ -1,12 +1,12 @@
{% extends 'base.html' %}
-{% load bootstrap3 staticfiles %}
+{% load bootstrap3 staticfiles i18n %}
{% block talktab %} class="active"{% endblock %}
{% block content %}
-Propose a talk
+{% trans "Propose a talk" %}
{% include "_form.html" %}
diff --git a/proposals/templates/proposals/talks.html b/proposals/templates/proposals/talks.html
index 0990e09..21d1a8f 100644
--- a/proposals/templates/proposals/talks.html
+++ b/proposals/templates/proposals/talks.html
@@ -1,18 +1,20 @@
{% extends 'base.html' %}
+{% load i18n %}
+
{% block talktab %} class="active"{% endblock %}
{% block content %}
-Propose a talk
+{% trans "Propose a talk" %}
{% if my_talks %}
-My participing talks:
+{% trans "My participing talks:" %}
{% include "proposals/_talk_list.html" with talk_list=my_talks %}
{% endif %}
{% if other_talks %}
-Others talks:
+{% trans "Others talks:" %}
{% include "proposals/_talk_list.html" with talk_list=other_talks %}
{% endif %}
diff --git a/proposals/templates/proposals/topic_form.html b/proposals/templates/proposals/topic_form.html
index b879fb3..a3ef69a 100644
--- a/proposals/templates/proposals/topic_form.html
+++ b/proposals/templates/proposals/topic_form.html
@@ -1,6 +1,6 @@
{% extends 'base.html' %}
-{% load bootstrap3 %}
+{% load bootstrap3 i18n %}
{% block topictab %} class="active"{% endblock %}
@@ -11,7 +11,7 @@
{% block content %}
-Topic
+{% trans "Topic" %}
{% include "_form.html" %}
diff --git a/proposals/templates/proposals/topic_list.html b/proposals/templates/proposals/topic_list.html
index 607de82..d6dcf61 100644
--- a/proposals/templates/proposals/topic_list.html
+++ b/proposals/templates/proposals/topic_list.html
@@ -1,32 +1,32 @@
{% extends 'base.html' %}
-{% load accounts_tags %}
+{% load accounts_tags i18n %}
{% block topictab %} class="active"{% endblock %}
{% block content %}
-Topics:
+{% trans "Topics:" %}
{% if request|orga %}
-Add a topic
+{% trans "Add a topic" %}
{% endif %}
{% endblock %}
diff --git a/proposals/templates/proposals/user_details.html b/proposals/templates/proposals/user_details.html
index 665a3e0..886eae2 100644
--- a/proposals/templates/proposals/user_details.html
+++ b/proposals/templates/proposals/user_details.html
@@ -1,5 +1,5 @@
{% extends 'base.html' %}
-{% load accounts_tags %}
+{% load accounts_tags i18n %}
{% block speakertab %} class="active"{% endblock %}
@@ -7,16 +7,16 @@
{{ profile }}
-Biography
+{% trans "Biography" %}
{{ profile.biography }}
-Talks
+{% trans "Talks" %}
{% include "proposals/_talk_list.html" %}
{% if request|edit_profile:profile %}
-Notes
+{% trans "Notes" %}
{{ profile.notes }}
-Edit
+{% trans "Edit" %}
{% endif %}
diff --git a/proposals/views.py b/proposals/views.py
index 6998e62..e46c0d4 100644
--- a/proposals/views.py
+++ b/proposals/views.py
@@ -8,6 +8,7 @@ from django.core.urlresolvers import reverse
from django.db.models import Q
from django.shortcuts import get_object_or_404, redirect, render
from django.views.generic import CreateView, DetailView, ListView, UpdateView
+from django.utils.translation import ugettext as _
from accounts.mixins import OrgaRequiredMixin, StaffRequiredMixin
@@ -34,7 +35,7 @@ def talk_list(request):
def talk_list_by_topic(request, topic):
topic = get_object_or_404(Topic, slug=topic)
talks = allowed_talks(Talk.objects.filter(site=topic.site, topics=topic), request)
- return render(request, 'proposals/talk_list.html', {'title': 'Talks related to %s:' % topic, 'talk_list': talks})
+ return render(request, 'proposals/talk_list.html', {'title': _('Talks related to %s:') % topic, 'talk_list': talks})
@login_required
@@ -53,13 +54,13 @@ def talk_edit(request, talk=None):
if hasattr(talk, 'id'):
talk = form.save()
talk_edited.send(talk.__class__, instance=talk, author=request.user)
- messages.success(request, 'Talk modified successfully!')
+ messages.success(request, _('Talk modified successfully!'))
else:
form.instance.site = get_current_site(request)
form.instance.proposer = request.user
talk = form.save()
talk_added.send(talk.__class__, instance=talk, author=request.user)
- messages.success(request, 'Talk proposed successfully!')
+ messages.success(request, _('Talk proposed successfully!'))
return redirect(talk.get_absolute_url())
return render(request, 'proposals/talk_edit.html', {
'form': form,
@@ -127,7 +128,7 @@ def vote(request, talk, score):
vote, created = Vote.objects.get_or_create(talk=talk, user=request.user)
vote.vote = int(score)
vote.save()
- messages.success(request, "Vote successfully %s" % ('created' if created else 'updated'))
+ messages.success(request, _('Vote successfully created') if created else _('Vote successfully updated'))
return redirect(talk.get_absolute_url())