Created
August 16, 2020 10:07
-
-
Save yarickprih/e271af0d95ad4ef96c1a3034937a94a8 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<form action="{% url 'set_language' %}" method="post" class="nav-link"> | |
{% csrf_token %} | |
<input name="next" type="hidden" value="{{ redirect_to }}" /> | |
<select name="language" style="width: auto; color: #d4c270" | |
onchange="this.form.submit()"> | |
{% get_current_language as LANGUAGE_CODE %} | |
{% get_available_languages as LANGUAGES %} | |
{% get_language_info_list for LANGUAGES as languages %} | |
{% for language in languages %} | |
<option value="{{ language.code }}" {% if language.code == LANGUAGE_CODE %} | |
selected="selected" {% endif %}> | |
{{ language.code|upper }} | |
</option> | |
{% endfor %} | |
</select> | |
</form> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment