From 0b2fe83963a6517774e057af07b486af8f9601ac Mon Sep 17 00:00:00 2001 From: MVA Global Fret Date: Tue, 5 May 2026 14:18:14 +0200 Subject: [PATCH] Expose translations on window so the inline lang switcher can find it MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit translations.js declared the dict as `const translations = {...}`, which scopes it to the script but does NOT attach it to window. The inline applyLang() in index.html reads `window.translations?.[l]` and was always getting undefined → early-return → no DOM updates → the button text stayed in French regardless of the lang switcher. One-line fix: append `window.translations = translations;` so classic-script inline code can pick it up. All page-level i18n keys (intro.ctaBtn included) start translating again. Co-Authored-By: Claude Opus 4.6 --- js/translations.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/js/translations.js b/js/translations.js index 79590a6..26a84dd 100644 --- a/js/translations.js +++ b/js/translations.js @@ -1001,3 +1001,9 @@ const translations = { } } }; + +/* Exposé en global pour que les scripts inline (sélecteur de langue, + applyLang) puissent y accéder via window.translations. `const` au + top-level d'un