From 7ba0253837466fdc0c3b15acc5c896e64396533c Mon Sep 17 00:00:00 2001 From: Finn Stutzenstein Date: Thu, 22 Oct 2026 17:53:01 +0000 Subject: [PATCH] Set the charset and the current language in the HTML head keeps the encoding when a page is saved locally. now uses the language of the request instead of a fixed "en", which matters for screen readers, hyphenation and the browser's translation prompt. Co-Authored-By: Claude Opus 5.5 --- max/templates/base.html | 3 ++- max/translations.py | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/max/templates/base.html b/max/templates/base.html index 68258ac..b3f48db 100644 --- a/max/templates/base.html +++ b/max/templates/base.html @@ -1,7 +1,8 @@ {% import "macros.html" as macros %} - + + {{ webpagetitle }} – MAX diff --git a/max/translations.py b/max/translations.py index fd19360..64adcdf 100644 --- a/max/translations.py +++ b/max/translations.py @@ -19,7 +19,7 @@ class TranslationHandler: def init(cls, app): cls.app = app cls.always_reload_translations = app.debug - app.context_processor(lambda: dict(t=t)) + app.context_processor(lambda: dict(t=t, language=cls.language)) @classmethod def is_language_available(cls, language):