Address review feedback

This commit is contained in:
Neil Martinsen-Burrell 2022-09-14 14:19:35 -05:00
parent 4440d2b3b9
commit aa06a3df20
No known key found for this signature in database
GPG key ID: 6A3C818CC10D0184
3 changed files with 11 additions and 2 deletions

View file

@ -2,5 +2,12 @@ from django.conf import settings
def language_code(request):
"""Add LANGUAGE_CODE to the template context."""
"""Add LANGUAGE_CODE to the template context.
The <html> element of a web page should include a lang="..." attribute. In
Django, the correct thing to put in that attribute is the value of
settings.LANGUAGE_CODE but the template context can't access that value
unless we add it here (and configure this context processor in the
TEMPLATES dict of our settings file).
"""
return {"LANGUAGE_CODE": settings.LANGUAGE_CODE}