Commit 17276bc1 authored by fred's avatar fred
Browse files

add French/English switch

parent 5f9ead6d
......@@ -125,8 +125,9 @@ def player(context):
@register.inclusion_tag('includes/metaNav.html', takes_context=True)
def metanav(context, active=None):
return {
'LANGUAGE_CODE': context.get('LANGUAGE_CODE'),
'sectionName': context.get('sectionName')
}
}
@register.inclusion_tag('includes/week.html')
def weekview(year=None, week=None):
......
......@@ -47,6 +47,7 @@ LANGUAGE_CODE = 'fr-be'
LANGUAGES = (
('fr', u'Français'),
('en', u'English'),
)
SITE_ID = 1
......@@ -106,6 +107,7 @@ MIDDLEWARE_CLASSES = (
'django.middleware.cache.UpdateCacheMiddleware',
#'django.middleware.gzip.GZipMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware',
'django.middleware.locale.LocaleMiddleware',
'django.middleware.common.CommonMiddleware',
'django.middleware.csrf.CsrfViewMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
......@@ -227,7 +229,7 @@ COMBO_PUBLIC_TEMPLATES = {
},
}
LANGUAGE_COOKIE_NAME = 'panikweb_language'
try:
from local_settings import *
......
......@@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: panikweb_templates 0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2013-09-07 14:29+0200\n"
"POT-Creation-Date: 2015-04-10 14:42+0200\n"
"PO-Revision-Date: 2013-09-07 14:22+0200\n"
"Last-Translator: Frederic Peters <fpeters@0d.be>\n"
"Language: fr\n"
......@@ -17,31 +17,88 @@ msgstr ""
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=(n > 1);\n"
#: templates/includes/metaNav.html:7
msgid "Home"
msgstr "Accueil"
#: templates/agenda.html:60 templates/home.html:38 templates/news.html:42
msgid "Latest News"
msgstr "Dernières actus"
#: templates/emissions.html:6 templates/emissions/archives.html:6
#: templates/emissions/emission_detail.html:17 templates/grid.html:6
#: templates/home.html:16 templates/includes/metaNav.html:18
msgid "Program"
msgstr "Programme"
#: templates/includes/metaNav.html:11
#: templates/emissions/emission_detail.html:39
#: templates/includes/metaNav.html:10 templates/news.html:3
#: templates/news.html.py:5 templates/news/archives.html:3
msgid "News"
msgstr "Actus"
#: templates/includes/metaNav.html:15
msgid "Listen"
msgstr "Sons"
#: templates/emissions/emission_detail.html:59
msgid "Coming Soon"
msgstr "À venir"
#: templates/includes/metaNav.html:19
msgid "Program"
msgstr "Programme"
#: templates/emissions/emission_detail.html:68
msgid "Previously"
msgstr "Précédemment"
#: templates/emissions/nav.html:8 templates/grid.html:4
msgid "Grid"
msgstr "La grille"
#: templates/emissions/nav.html:11
msgid "By Week"
msgstr "Par semaine"
#: templates/emissions/nav.html:14
msgid "Emissions"
msgstr "Émissions"
#: templates/emissions/nav.html:17
msgid "Archives"
msgstr "Archives"
#: templates/includes/metaNav.html:23
#: templates/home.html:4 templates/includes/metaNav.html:6
msgid "Home"
msgstr "Accueil"
#: templates/home.html:17
msgid "This week on Panik"
msgstr "Cette semaine sur Panik"
#: templates/home.html:24
msgid "Every Monday, the news of the Panik week:"
msgstr "Tous les lundis, l'actualité de la semaine de Panik :"
#: templates/home.html:26
msgid "Subscribe"
msgstr "M'inscrire"
#: templates/home.html:31 templates/listen.html:20 templates/news.html:21
msgid "Focus"
msgstr "Focus"
#: templates/home.html:52 templates/listen.html:65
msgid "Latest Sounds"
msgstr "Derniers sons"
#: templates/home.html:66
msgid "New emissions"
msgstr "Nouvelles émissions"
#: templates/includes/metaNav.html:14 templates/listen.html:3
#: templates/listen.html.py:5
msgid "Sounds"
msgstr "Sons"
#: templates/includes/metaNav.html:22
msgid "About"
msgstr "À propos"
#: templates/includes/metaNav.html:27
#: templates/includes/metaNav.html:31
msgid "Search"
msgstr "Recherche"
#: templates/includes/player.html:8
#: templates/includes/player.html:8 templates/includes/player.html.py:9
msgid "Get the stream on your player!"
msgstr "Récupérez le stream sur votre lecteur !"
......@@ -52,3 +109,6 @@ msgstr "Besoin d'aide ?"
#: templates/includes/player.html:14
msgid "live"
msgstr "en direct"
#~ msgid "Listen"
#~ msgstr "Sons"
......@@ -236,6 +236,16 @@ body{
display:block;
}
#metaNav ul li#nav-language span {
cursor: pointer;
padding:0.4em 0 0.5em 0;
display: inline-block;
}
#metaNav ul li#nav-language span.lang-on {
color: white;
}
#metaNav ul li a span{
padding:0.4em 0 0.5em 0;
display:inline-block;
......
......@@ -489,6 +489,11 @@ $(function() {
});
});
$('#nav-language span').click(function() {
document.cookie = 'panikweb_language=' + $(this).data('lang') + '; path=/';
window.location = window.location;
return false;
});
if (document.cookie.indexOf('panikdb=on') != -1) {
panikdb_path = null;
......
{% extends "base.html"%}
{% load paniktags i18n %}
{% block title %}Actus{% endblock %}
{% block title %}{% trnas 'Actus' %}{% endblock %}
{% block toptitle %}
<h1 class="top"><a href="{% url 'news' %}">Actus</a> - L'agenda</h1>
{% endblock %}
......@@ -57,7 +57,7 @@ vous fait savoir.
</a>
</h5>
<h5 class="sectionLabel">
<span class="iconLabel">Dernières actus</span>
<span class="iconLabel">{% trans 'Latest News'%}</span>
<a class="button icon-rss inBlock" href="{% url 'rss-feed' %}"></a>
</h5>
......
{% extends "base.html" %}
{% load paniktags %}
{% load paniktags i18n %}
{% block bodyID %}Emissions{% endblock %}
{% block title %}Émissions{% endblock %}
{% block toptitle %}
<h1 class="top"><a href="{% url 'grid' %}">Programme</a></h1>
<h1 class="top"><a href="{% url 'grid' %}">{% trans 'Program' %}</a></h1>
{% endblock %}
{% block nav %}
{% emission_nav with klass="emissions" %}
......
{% extends "emissions.html" %}
{% load paniktags %}
{% load paniktags i18n%}
{% block bodyID %}Emissions{% endblock %}
{% block title %}Archives{% endblock %}
{% block toptitle %}
<h1 class="top"><a href="{% url 'grid' %}">Programme</a></h1>
<h1 class="top"><a href="{% url 'grid' %}">{% trans 'Program' %}</a></h1>
{% endblock %}
{% block nav %}
{% emission_nav with klass="archives" %}
......
{% extends "emissions.html" %}
{% load paniktags thumbnails staticfiles %}
{% load paniktags thumbnails staticfiles i18n %}
{% block bodyID %}Emissions{% endblock %}
{% block title %}{{ emission.title }}{% endblock %}
......@@ -14,7 +14,7 @@
{% endblock %}
{% block toptitle %}
<h1 class="top"><a href="{% url 'grid' %}">Programme</a></h1>
<h1 class="top"><a href="{% url 'grid' %}">{% trans 'Program' %}</a></h1>
{% endblock %}
{% block nav %}
{% emission_nav %}
......@@ -36,7 +36,7 @@
{% if news %}
<div class="sub emissions-newsitems">
<h5 class="sectionLabel">Actu</h5>
<h5 class="sectionLabel">{% trans 'News' %}</h5>
<ul class="custom list">
{% for content in news %}
<li>{% news_inline %}</li>
......@@ -56,7 +56,7 @@
{% if futurEpisodes %}
<div class="sub futur-episodes">
<h5 class="sectionLabel">À venir</h5>
<h5 class="sectionLabel">{% trans 'Coming Soon' %}</h5>
{% for episode in futurEpisodes|slice:":3" %}
{% episode_inline %}
{% endfor %}
......@@ -65,7 +65,7 @@
{% if episodes %}
<div class="sub recent-episodes">
<h5 class="sectionLabel">Précédemment</h5>
<h5 class="sectionLabel">{% trans 'Previously' %}</h5>
{% with episodes|slice:"0:5" as episodes %}
{% for episode in episodes %}
......
{% load i18n %}
<div class="mainSub">
<div class="wrapper">
<nav>
<ul class="inline padded">
<li><a href="{% url 'grid' %}" class="{% if class = "grid" %}active{% endif %}">
<span class="iconLabel">La grille</span>
<span class="iconLabel">{% trans 'Grid' %}</span>
</a></li>
<li><a href="{% url 'program' %}" class="{% if class = "program" %}active{% endif %}">
<span class="iconLabel">Par semaine</span>
<span class="iconLabel">{% trans 'By Week' %}</span>
</a></li>
<li><a href="{% url 'emissions' %}" class="{% if class != "program" and class != "grid" and class != "archives" %}active{% endif %}">
<span class="iconLabel">Émissions</span>
<span class="iconLabel">{% trans 'Emissions' %}</span>
</a></li>
<li><a href="{% url 'emissionsArchives' %}" class="{% if class = "archives" %}active{% endif %}">
<span class="iconLabel">Archives</span>
<span class="iconLabel">{% trans 'Archives' %}</span>
</a></li>
</ul>
</nav>
......
{% extends "emissions.html" %}
{% load paniktags %}
{% load paniktags i18n %}
{% block bodyID %}Grid{% endblock %}
{% block title %}La grille{% endblock %}
{% block title %}{% trans 'Grid' %}{% endblock %}
{% block toptitle %}
<h1 class="top"><a href="{% url 'grid' %}">Programme</a></h1>
<h1 class="top"><a href="{% url 'grid' %}">{% trans 'Program' %}</a></h1>
{% endblock %}
{% block nav %}
{% emission_nav with klass="grid" %}
......
{% extends "base.html" %}
{% load thumbnails paniktags staticfiles %}
{% load thumbnails paniktags staticfiles i18n %}
{% block bodyID %}Home{% endblock %}
{% block title %}Accueil{% endblock %}
{% block title %}{% trans 'Home' %}{% endblock %}
{% block head %}
<meta property="og:title" content="Radio Panik - 105.4 FM" />
......@@ -13,29 +13,29 @@
<div class="sided wrapper navigation" id="specialHome">
<div>
<div class="leftPart">
<h1 class="top"><a href="{% url 'grid' %}">Programme</a></h1>
<h2><a href="{% url 'program' %}">Cette semaine sur Panik</a></h2>
<h1 class="top"><a href="{% url 'grid' %}">{% trans 'Program' %}</a></h1>
<h2><a href="{% url 'program' %}">{% trans 'This week on Panik' %}</a></h2>
{% weeknav %}
{% weekview %}
<form method="post" action="{% url 'newsletter-subscribe' %}"
class="marged" id="subscribe-form">
<p>Tous les lundis, l'actualité de la semaine de Panik :</p>
<p>{% trans 'Every Monday, the news of the Panik week:' %}</p>
{{ newsletter_form.as_table }}
<button>M'inscrire</button>
<button>{% trans 'Subscribe' %}</button>
</form>
</div>
<div class="rightPart">
<h1 class="top">Focus</h1>
<h1 class="top">{% trans 'Focus' %}</h1>
{% newsroll %}
{% if newsitems %}
<div id="recent-news">
<h3 class="sectionLabel right"><a href="{% url 'newsArchives' %}">Toutes</a></h3>
<h3 class="sectionLabel"><a href="{% url 'news' %}">Dernières actus</a>&nbsp;<a class="button icon-rss inBlock" href="{% url 'atom-feed' %}"></a></h3>
<h3 class="sectionLabel"><a href="{% url 'news' %}">{% trans 'Latest News' %}</a>&nbsp;<a class="button icon-rss inBlock" href="{% url 'atom-feed' %}"></a></h3>
<ul class="custom list">
{% for content in newsitems %}
<li class="item">{% news_inline %}</li>
......@@ -49,7 +49,7 @@
<div id="recent-sounds">
<h3 class="sectionLabel right"><a href="{% url 'listenArchives' %}">Tous</a></h3>
<h3 class="sectionLabel"><a href="{% url 'listen' %}">Derniers sons</a>&nbsp;<a class="button icon-rss inBlock" href="{% url 'podcasts-feed' %}"></a></h3>
<h3 class="sectionLabel"><a href="{% url 'listen' %}">{% trans 'Latest Sounds' %}</a>&nbsp;<a class="button icon-rss inBlock" href="{% url 'podcasts-feed' %}"></a></h3>
<ul class="custom list">
{% for soundfile in soundfiles %}
<li class="item {% for category in soundfile.episode.emission.categories.all %} {{ category|slugify }}{% endfor %}">
......@@ -63,7 +63,7 @@
{% if emissions %}
<div id="recent-emissions">
<h3 class="sectionLabel right"><a href="{% url 'emissions' %}">Toutes</a></h3>
<h3 class="sectionLabel">Nouvelles émissions</h3>
<h3 class="sectionLabel">{% trans 'New emissions' %}</h3>
<ul class="custom list padded">
{% for emission in emissions %}
<li class="item">
......
......@@ -11,7 +11,7 @@
</a></li>
<li class="{% if sectionName = "Listen" %}active{% endif %}"><a title="Derniers contenus écoutables publiés" href="{% url 'listen' %}">
<span class="nav-icon icon-headphones resymbol" ></span>
<span class="iconLabel">{% trans 'Listen' %}</span>
<span class="iconLabel">{% trans 'Sounds' %}</span>
</a></li>
<li class="{% if sectionName = "Emissions" %}active{% endif %}"><a title="Les émissions, le programme de la semaine, la grille" href="{% url 'grid' %}">
<span class="nav-icon icon-calendar resymbol" ></span>
......@@ -21,6 +21,11 @@
<span class="nav-icon icon-info-sign" ></span>
<span class="iconLabel">{% trans 'About' %}</span>
</a></li>
<li id="nav-language">
<span data-lang="fr" {% if LANGUAGE_CODE == 'fr' %}class="lang-on"{% endif %}>FR</span></a>
/
<span data-lang="en"{% if LANGUAGE_CODE == 'en' %}class="lang-on"{% endif %}>EN</span>
</li>
<li id="nav-search" class="{% if sectionName = "Search" %}active{% endif %}"><a href="{% url 'search' %}">
<span class="nav-icon icon-search resymbol" ></span>
<span class="iconLabel">{% trans 'Search' %}</span>
......
{% extends "base.html" %}
{% load paniktags staticfiles thumbnails %}
{% block title %}Sons{% endblock %}
{% load paniktags staticfiles thumbnails i18n %}
{% block title %}{% trans 'Sounds' %}{% endblock %}
{% block toptitle %}
<h1 class="top"><a href="{% url 'listen' %}">Sons</a></h1>
<h1 class="top"><a href="{% url 'listen' %}">{% trans 'Sounds' %}</a></h1>
{% endblock %}
{% block nav %}
{% endblock %}
......@@ -17,7 +17,7 @@
<div class="leftPart">
<div class="soundfiles">
<h5 class="sectionLabel focus-title">Focus</h5>
<h5 class="sectionLabel focus-title">{% trans 'Focus' %}</h5>
<ul class="custom columns cf padded">
{% for soundfile in focus %}
......@@ -62,7 +62,7 @@
<h5 class="sectionLabel right">
<a href="{% url 'listenArchives' %}"><span class="iconLabel">Tous</span></a>
</h5>
<h5 class="sectionLabel">Derniers sons&nbsp;<a
<h5 class="sectionLabel">{% trans 'Latest Sounds' %}&nbsp;<a
class="button icon-rss inBlock" href="{% url 'podcasts-feed' %}"></a></h5>
<form action="{% url 'listenArchives' %}" id="search-form">
......
{% extends "base.html"%}
{% load paniktags i18n %}
{% block title %}Actus{% endblock %}
{% block title %}{% trans 'News' %}{% endblock %}
{% block toptitle %}
<h1 class="top"><a href="{% url 'news' %}">Actus</a></h1>
<h1 class="top"><a href="{% url 'news' %}">{% trans 'News' %}</a></h1>
{% endblock %}
{% block nav %}
{% news_nav %}
......@@ -18,7 +18,7 @@ vous fait savoir.
<div class="leftPart">
<div class="news">
<h5 class="sectionLabel focus-title">Focus</h5>
<h5 class="sectionLabel focus-title">{% trans 'Focus' %}</h5>
{% with focus as news %}
<ul class="custom columns cf padded">
......@@ -39,7 +39,7 @@ vous fait savoir.
</a>
</h5>
<h5 class="sectionLabel">
<span class="iconLabel">Dernières actus</span>
<span class="iconLabel">{% trans 'Latest News' %}</span>
<a class="button icon-rss inBlock" href="{% url 'rss-feed' %}"></a>
</h5>
......
{% extends "news.html" %}
{% load thumbnails paniktags %}
{% block title %}Actus - Archives{% endblock %}
{% load thumbnails paniktags i18n %}
{% block title %}{% trans 'News' %} - Archives{% endblock %}
{% block nav %}
<div class="search-filters">
{% if facets.fields.news_categories %}
......
{% extends "emissions.html" %}
{% load paniktags %}
{% load paniktags i18n %}
{% block bodyID %}Program{% endblock %}
{% block title %}Programme{% endblock %}
{% block title %}{% trans 'Program' %}{% endblock %}
{% block toptitle %}
<h1 class="top"><a href="{% url 'grid' %}">Programme</a></h1>
<h1 class="top"><a href="{% url 'grid' %}">{% trans 'Program' %}</a></h1>
{% endblock %}
{% block nav %}
{% emission_nav with klass="program" %}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment