Last active
August 29, 2015 14:00
-
-
Save prudnitskiy/f4bbd42890b29b6ee928 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
{% load i18n %} | |
{% get_current_language as LANGUAGE_CODE %} | |
<!DOCTYPE html> | |
<html lang="{{ LANGUAGE_CODE }}"> | |
<!-- shows an current lang. Also you need it for HTML strict test --> | |
<!-- non-ajax but simple language selector --> | |
<ul class="list-unstyled pull-right footer-inline"> | |
{% for lang in LANGUAGES %} | |
<li> | |
<a href="#" onclick="document.setLang{{ lang.1 }}.submit();return false;"><img src="{{MEDIA_ROOT}}img/{{ lang.0 }}.png"/>{{ lang.1 }}</a> | |
<form style="margin:0; padding: 0" name="setLang{{ lang.1}}" action="/i18n/setlang/" method="POST">{% csrf_token %} | |
<input name="next" type="hidden" value="{{ request.url }}" /> | |
<input type="hidden" name="language" value="{{ lang.0 }}" /> | |
</form> | |
</li> | |
{% endfor %} | |
</ul> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
you need to place {{LANG_CODE}}.png files to {{MEDIA_ROOT}}img/