From 259146ecdc0c4755ef277aa9d058d274de143cad Mon Sep 17 00:00:00 2001 From: Giorgio Gilestro Date: Fri, 29 May 2026 12:03:44 +0200 Subject: [PATCH] fix: don't put literal Jinja syntax inside JS comments in base.html MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The previous commit's i18n explanatory comment included the snippet {% if user_lang == 'it' %} as illustration — but Jinja parses the whole template, including content inside JS // comments, so that literal got picked up as a real (unclosed) tag and every page rendered with a TemplateSyntaxError. Rewrite the comment without the literal Jinja syntax. Co-Authored-By: Claude Opus 4.7 --- app/templates/base.html | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/app/templates/base.html b/app/templates/base.html index 9bbb46f..97d1750 100644 --- a/app/templates/base.html +++ b/app/templates/base.html @@ -158,11 +158,10 @@ // HTMX (server-side translation), but plain UI labels are baked into // the HTML at render time. This dict + applyI18n() below let the // language toggle swap labels live without a page refresh. - // Convention: … (sets textContent), - // (sets .placeholder). - // First-render correctness is handled by the template's - // {% if user_lang == 'it' %} block — applyI18n only kicks in on - // subsequent toggle events. + // Convention: data-i18n="key" sets textContent; + // data-i18n-placeholder="key" sets .placeholder. + // First-render correctness is handled by the template's user_lang + // conditional, so applyI18n only kicks in on subsequent toggles. window.CASSANDRA_I18N = { 'chat.title': { en: 'Ask Cassandra', it: 'Chiedi a Cassandra' },