[1.5.x] Fixed #20398 - Added language selection code to example in documentation

Thanks ggbaker for the suggestion and Simeon Visser for the patch.

Backport of 897e4eab65 from master
This commit is contained in:
Tim Graham 2013-05-13 13:43:28 -04:00
parent a9703edc61
commit cac0f7b72e
1 changed files with 3 additions and 1 deletions

View File

@ -1409,7 +1409,9 @@ Here's example HTML template code:
<select name="language"> <select name="language">
{% get_language_info_list for LANGUAGES as languages %} {% get_language_info_list for LANGUAGES as languages %}
{% for language in languages %} {% for language in languages %}
<option value="{{ language.code }}">{{ language.name_local }} ({{ language.code }})</option> <option value="{{ language.code }}"{% if language.code == LANGUAGE_CODE %} selected="selected"{% endif %}>
{{ language.name_local }} ({{ language.code }})
</option>
{% endfor %} {% endfor %}
</select> </select>
<input type="submit" value="Go" /> <input type="submit" value="Go" />