Browse Source

Use current language in <html> tag

Baptiste Jonglez 8 years ago
parent
commit
1fc9cd8834
1 changed files with 2 additions and 3 deletions
  1. 2 3
      panorama/templates/panorama/base.html

+ 2 - 3
panorama/templates/panorama/base.html

@@ -2,8 +2,8 @@
 {% load staticfiles %}
 {% load staticfiles %}
 {% load i18n %}
 {% load i18n %}
 
 
-{# TODO: change lang? #}
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="fr" lang="fr">
+{% get_current_language as LANGUAGE_CODE %}
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="{{ LANGUAGE_CODE }}" lang="{{ LANGUAGE_CODE }}">
   <head>
   <head>
     <meta http-equiv="Content-type" content="text/html; charset=UTF-8"/>
     <meta http-equiv="Content-type" content="text/html; charset=UTF-8"/>
     <title>{% block title %}{% endblock title %}</title>
     <title>{% block title %}{% endblock title %}</title>
@@ -52,7 +52,6 @@
                   <form action="{% url 'set_language' %}" method="post">{% csrf_token %}
                   <form action="{% url 'set_language' %}" method="post">{% csrf_token %}
                     <input name="next" type="hidden" value="{{ redirect_to }}" />
                     <input name="next" type="hidden" value="{{ redirect_to }}" />
                     <select class="selectpicker" title="     {% trans "Language" %}" name="language" onchange='this.form.submit()'>
                     <select class="selectpicker" title="     {% trans "Language" %}" name="language" onchange='this.form.submit()'>
-                      {% get_current_language as LANGUAGE_CODE %}
                       {% with "fr en es" as LANGUAGES %}
                       {% with "fr en es" as LANGUAGES %}
                       {% get_language_info_list for LANGUAGES.split as languages %}
                       {% get_language_info_list for LANGUAGES.split as languages %}
                         {% for language in languages %}
                         {% for language in languages %}