mirror of
https://github.com/cisagov/manage.get.gov.git
synced 2025-05-15 00:57:02 +02:00
Add language code to template context
To fix a pa11y error, we need to get the Django settings LANGUAGE_CODE into the template context so it can get rendered in the <html> element.
This commit is contained in:
parent
5bdd01138c
commit
13a310f354
2 changed files with 6 additions and 0 deletions
|
@ -158,6 +158,7 @@ TEMPLATES = [
|
|||
"django.template.context_processors.request",
|
||||
"django.contrib.auth.context_processors.auth",
|
||||
"django.contrib.messages.context_processors.messages",
|
||||
"registrar.context_processors.language_code",
|
||||
],
|
||||
},
|
||||
},
|
||||
|
|
5
src/registrar/context_processors.py
Normal file
5
src/registrar/context_processors.py
Normal file
|
@ -0,0 +1,5 @@
|
|||
from django.conf import settings
|
||||
|
||||
def language_code(request):
|
||||
"""Add LANGUAGE_CODE to the template context."""
|
||||
return {"LANGUAGE_CODE": settings.LANGUAGE_CODE}
|
Loading…
Add table
Add a link
Reference in a new issue