Show current lang in UI, and add URL properly

refactor-builder
Eric Holscher 2014-01-17 15:13:37 +07:00
parent 5cd5260c0b
commit 72d953be48
2 changed files with 7 additions and 0 deletions

View File

@ -79,12 +79,18 @@
<hr>
{% get_current_language as current_lang %}
<form action="/i18n/setlang/" method="post">{% csrf_token %}
<input name="next" type="hidden" value="/" />
{% csrf_token %}
<select style="float: left; height: 33px;" name="language">
{% for lang in LANGUAGES %}
{% if lang.0 == current_lang %}
<option selected="selected" value="{{ lang.0 }}">{{ lang.0|language_name_local }} [{{ lang.1 }}]</option>
{% else %}
<option value="{{ lang.0 }}">{{ lang.0|language_name_local }} [{{ lang.1 }}]</option>
{% endif %}
}
{% endfor %}
</select>
<input style="float: left; height: 33px; margin: 0px;" type="submit" value="Change Language" name="submit">

View File

@ -62,6 +62,7 @@ urlpatterns = patterns(
'core.views.serve_single_version_docs',
name='docs_detail'),
url(r'^i18n/', include('django.conf.urls.i18n')),
url(r'^projects/', include('projects.urls.public')),
url(r'^builds/', include('builds.urls')),
url(r'^flagging/', include('basic.flagging.urls')),