Commit 7b0c2c39 authored by Christophe Siraut's avatar Christophe Siraut

Fix #1052 language switching.

parent 4a1404b0
......@@ -24,6 +24,7 @@ urlpatterns = patterns('',
url(r'^admin/doc/', include('django.contrib.admindocs.urls')),
url(r'^$', 'django.views.generic.list_detail.object_list', dict(info_dict, template_name='index.html'), name='home'),
url(r'^nuages/$', 'django.views.generic.simple.direct_to_template', {'template': 'nuages.html'}, name='documentation'),
url(r'^languages/$', 'django.views.generic.simple.direct_to_template', {'template': 'languages.html'}, name='languages'),
#url(r'^(?P<lang_id>\w{2})/nuages$', 'meetingpoll.views.translation'),
url(r'^(?P<poll_id>\w{4})/$', 'meetingpoll.views.vote'),
url(r'^new/$', 'meetingpoll.views.new', name='new'),
......@@ -39,5 +40,6 @@ urlpatterns = patterns('',
)
urlpatterns += i18n_patterns('',
url(r'^nuages/$', 'django.views.generic.simple.direct_to_template', {'template': 'nuages.html'}, name='documentation_trans'),
url(r'^nuages/$', 'django.views.generic.simple.direct_to_template', {'template': 'nuages.html'}, name='documentation_translated'),
url(r'^$', 'django.views.generic.list_detail.object_list', dict(info_dict, template_name='index.html'), name='home_translated'),
)
......@@ -33,20 +33,6 @@
{% else %}
<a href="{% url 'auth_login' %}">{% trans 'Login' %}</a>
{% endif %}
<span class="notify">
<form style="display:inline" name="langForm" action="/i18n/setlang/" method="post">{% csrf_token %}
<input name="next" type="hidden" value="" />
<select name="language" onChange="langForm.submit()" />
<option value="#" />{{ LANGUAGE_CODE }}</option>
{% for lang in LANGUAGES %}
{% ifnotequal lang.0 LANGUAGE_CODE %}
<option value="{{ lang.0 }}" />{{ lang.0 }}</option>
{% endifnotequal %}
{% endfor %}
</select>
</form>
</span>
</div>
</div>
......
......@@ -63,7 +63,7 @@
{% for lang_code, lang_name in languages %}
{% language lang_code %}
<a href="{% url 'documentation_trans' %}">{{ lang_name }}</a>
<a href="{% url 'home_translated' %}">{{ lang_name }}</a>
{% endlanguage %}
{% endfor %}
</span>
......
{% extends "base.html" %}
{% load url from future %}
{% load i18n %}
{% block chapeau %}
<h1>{% trans "Languages" %}</h1>
<p class="filet">
{% trans "Nuages is available in many languages." %} {% trans "The preferences of your browser and the availbale languages decide in which language is presented. You can manually select language with some browser plugins." %} {% trans "At the moment we also provide a language cookie but this might disaippear soon." %}
</p>
{% get_available_languages as languages %}
{% trans "Set language cookie" %}:
<form style="display:inline;" name="setLang{{ lang_name }}" action="/i18n/setlang/" method="POST">{% csrf_token %}
{% for lang_code, lang_name in languages %}
{% language lang_code %}
<input name="next" type="hidden" value="/" />
<input type="hidden" name="language" value="{{ lang_code }}" />
<a href="#" onclick="document.setLang{{ lang_name }}.submit();return false;">{{ lang_name }}</a>
{% endlanguage %}
{% endfor %}
</form>
</p>
{% endblock %}
{% extends "base.html" %}
{% load url from future %}
{% load i18n %}
{% block chapeau %}
......@@ -47,7 +48,10 @@ Browse changes: <a href="http://git.domainepublic.net/?p=nuages.git">http://git.
</div>
<h3>{% trans "Translate Nuages" %}</h3>
<div class="filet">
<p>{% trans "If you have a little time and want help translate Nuages in your language, your help is welcome. You can translate the following file to your language, and present yourself on the mailing list." %}</p>
<p>
{% trans "Nuages is avalable in many" %}<a href="{% url "languages" %}">{% trans "languages" %}</a>.
{% trans "If you have a little time and want help translate Nuages in your language, your help is welcome. You can translate the following file to your language, and present yourself on the mailing list." %}
</p>
<pre>
http://git.domainepublic.net/?p=nuages.git;a=blob_plain;f=locale/fr/LC_MESSAGES/django.po
......@@ -61,4 +65,14 @@ http://git.domainepublic.net/?p=nuages.git;a=blob_plain;f=locale/fr/LC_MESSAGES/
<p>{% trans "Please send us a mail or join Domaine Public irc to let us know your propositions." %}</p>
</div>
<br /><br /><br />
<span class="notify" style="font-size:0.875em">{% trans "This page is available in the following languages" %}:
{% get_available_languages as languages %}
{% for lang_code, lang_name in languages %}
{% language lang_code %}
<a href="{% url 'documentation_translated' %}">{{ lang_name }}</a>
{% endlanguage %}
{% endfor %}
</span>
{% endblock %}
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