read.markets/app/templates
Giorgio Gilestro fca05aef7a i18n: live-swap chat sidebar labels on language toggle
The strategic log content already refreshes via HTMX on lang-changed
(server-side translation lookup), but the chat sidebar's static labels
— title, hint, helper lede, textarea placeholder, Send button — were
baked into the HTML by Jinja at page render and only updated after a
full reload.

Add a tiny client-side i18n dictionary (CASSANDRA_I18N) plus
applyI18n(lang) in base.html. cassandraSetLang() now calls
applyI18n(newLang) right after the language PATCH succeeds and before
firing the HTMX triggers, so labels swap in step with the AI content.

Convention: <element data-i18n="key">…</element> sets textContent;
<input data-i18n-placeholder="key" …> sets .placeholder. Initial
render still goes through the existing {% if user_lang == 'it' %}
Jinja blocks so there's no flash of English on page load for IT users
— applyI18n is a no-op until the toggle is clicked.

Only the chat sidebar has bindings today. Adding more labels later is
a matter of dropping a key into the dict and tagging the element.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-29 12:01:28 +02:00
..
partials mobile: wrap tabs, trim portfolio + markets bar columns 2026-05-28 19:10:58 +02:00
about.html public: landing + pricing + legal pages, apex-ready, lawyer-reviewed 2026-05-24 00:08:02 +02:00
base.html i18n: live-swap chat sidebar labels on language toggle 2026-05-29 12:01:28 +02:00
dashboard.html mobile: cache-bust static assets so browser picks up CSS/JS edits 2026-05-28 19:20:49 +02:00
disclaimer.html pricing: land £7/£70 paid tier and make behaviour match 2026-05-26 11:34:37 +02:00
landing.html mobile: cache-bust static assets so browser picks up CSS/JS edits 2026-05-28 19:20:49 +02:00
log.html i18n: live-swap chat sidebar labels on language toggle 2026-05-29 12:01:28 +02:00
login.html mobile: cache-bust static assets so browser picks up CSS/JS edits 2026-05-28 19:20:49 +02:00
news.html brand: rename product to "Read the Markets" (read.markets) 2026-05-22 19:39:38 +01:00
pricing.html cleanup: drop dead upload.html + soften broker-only marketing copy 2026-05-27 15:39:03 +02:00
privacy.html public: landing + pricing + legal pages, apex-ready, lawyer-reviewed 2026-05-24 00:08:02 +02:00
public_base.html mobile: cache-bust static assets so browser picks up CSS/JS edits 2026-05-28 19:20:49 +02:00
settings.html ui: flip tone relabel — "Pro" now maps to INTERMEDIATE, not NOVICE 2026-05-29 11:23:52 +02:00
terms.html i18n: instant lang switch via HTMX trigger + refresh paid-plans terms 2026-05-27 21:02:03 +02:00
verify.html mobile: cache-bust static assets so browser picks up CSS/JS edits 2026-05-28 19:20:49 +02:00