forked from CGM_Public/pretix_original
Add lang attribute to <html> tag in presale
This commit is contained in:
@@ -1,5 +1,6 @@
|
|||||||
from django.conf import settings
|
from django.conf import settings
|
||||||
from django.core.files.storage import default_storage
|
from django.core.files.storage import default_storage
|
||||||
|
from django.utils import translation
|
||||||
from django.utils.translation import get_language_info
|
from django.utils.translation import get_language_info
|
||||||
from django_scopes import get_scope
|
from django_scopes import get_scope
|
||||||
from i18nfield.strings import LazyI18nString
|
from i18nfield.strings import LazyI18nString
|
||||||
@@ -92,6 +93,7 @@ def contextprocessor(request):
|
|||||||
ctx['js_date_format'] = get_javascript_format_without_seconds('DATE_INPUT_FORMATS')
|
ctx['js_date_format'] = get_javascript_format_without_seconds('DATE_INPUT_FORMATS')
|
||||||
ctx['js_time_format'] = get_javascript_format_without_seconds('TIME_INPUT_FORMATS')
|
ctx['js_time_format'] = get_javascript_format_without_seconds('TIME_INPUT_FORMATS')
|
||||||
ctx['js_locale'] = get_moment_locale()
|
ctx['js_locale'] = get_moment_locale()
|
||||||
|
ctx['html_locale'] = translation.get_language_info(translation.get_language()).get('public_code', translation.get_language())
|
||||||
ctx['settings'] = pretix_settings
|
ctx['settings'] = pretix_settings
|
||||||
ctx['django_settings'] = settings
|
ctx['django_settings'] = settings
|
||||||
|
|
||||||
|
|||||||
@@ -5,7 +5,7 @@
|
|||||||
{% load statici18n %}
|
{% load statici18n %}
|
||||||
{% load thumb %}
|
{% load thumb %}
|
||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
<html{% if rtl %} dir="rtl" class="rtl"{% endif %}>
|
<html{% if rtl %} dir="rtl" class="rtl"{% endif %} lang="{{ html_locale }}">
|
||||||
<head>
|
<head>
|
||||||
<title>{% block thetitle %}{% endblock %}</title>
|
<title>{% block thetitle %}{% endblock %}</title>
|
||||||
{% if css_file %}
|
{% if css_file %}
|
||||||
|
|||||||
@@ -440,13 +440,15 @@ EXTRA_LANG_INFO = {
|
|||||||
'bidi': False,
|
'bidi': False,
|
||||||
'code': 'de-informal',
|
'code': 'de-informal',
|
||||||
'name': 'German (informal)',
|
'name': 'German (informal)',
|
||||||
'name_local': 'Deutsch'
|
'name_local': 'Deutsch',
|
||||||
|
'public_code': 'de',
|
||||||
},
|
},
|
||||||
'nl-informal': {
|
'nl-informal': {
|
||||||
'bidi': False,
|
'bidi': False,
|
||||||
'code': 'nl-informal',
|
'code': 'nl-informal',
|
||||||
'name': 'Dutch (informal)',
|
'name': 'Dutch (informal)',
|
||||||
'name_local': 'Nederlands'
|
'name_local': 'Nederlands',
|
||||||
|
'public_code': 'nl',
|
||||||
},
|
},
|
||||||
'fr': {
|
'fr': {
|
||||||
'bidi': False,
|
'bidi': False,
|
||||||
|
|||||||
Reference in New Issue
Block a user