Set the charset and the current language in the HTML head

<meta charset="utf-8"> keeps the encoding when a page is saved locally.
<html lang> 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 <noreply@anthropic.com>
This commit is contained in:
finnandClaude Opus 5.5 committed 2026-10-22 17:53:01 +00:00
1 parent 78702f133c
commit 7ba0253837
2 files changed
+3 -2

No files matched your search

+2 -1
View File
@@ -1,7 +1,8 @@
{% import "macros.html" as macros %} {% import "macros.html" as macros %}
<!DOCTYPE html> <!DOCTYPE html>
<html lang="en"> <html lang="{{ language }}">
<head> <head>
<meta charset="utf-8">
<title>{{ webpagetitle }} &ndash; MAX</title> <title>{{ webpagetitle }} &ndash; MAX</title>
<meta name="viewport" content="width=device-width, initial-scale=1" /> <meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="robots" content="noindex" /> <meta name="robots" content="noindex" />
+1 -1
View File
@@ -19,7 +19,7 @@ class TranslationHandler:
def init(cls, app): def init(cls, app):
cls.app = app cls.app = app
cls.always_reload_translations = app.debug cls.always_reload_translations = app.debug
app.context_processor(lambda: dict(t=t)) app.context_processor(lambda: dict(t=t, language=cls.language))
@classmethod @classmethod
def is_language_available(cls, language): def is_language_available(cls, language):