Skip to content

Commit

Permalink
[#2374] language dropdown current language now selected
Browse files Browse the repository at this point in the history
  • Loading branch information
tobes committed Jun 13, 2012
1 parent 6eecbef commit 46af558
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions ckan/templates/snippets/language_selector.html
@@ -1,10 +1,11 @@
{% set current_url = request.environ.CKAN_CURRENT_URL %}
{% set current_lang = request.environ.CKAN_LANG %}
<form class="form-inline form-select" action="{% url_for controller='util', action='redirect' %}" method="POST">
<label for="field-lang-select">{{ _('Language') }}</label>
<select id="field-lang-select" name="url">
{% for locale in h.get_available_locales() %}
<option value="{{h.url_for(current_url, locale=locale)}}">
{{ locale.display_name or locale.english_name }}
<option value="{% url_for current_url, locale=locale %}" {% if locale == current_lang %}selected="selected"{% endif %}>
{{ locale.display_name or locale.english_name }}
</option>
{% endfor %}
</select>
Expand Down

0 comments on commit 46af558

Please sign in to comment.