feat: i18n system - French/English internationalization
CI / lint (push) Failing after 20s
CI / test (push) Has been skipped
CI / build (push) Has been skipped
CI / e2e (push) Has been skipped
CI / security (push) Failing after 9s

Core: i18n.js module with t(), setLocale(), initI18n()
- Flat key→string JSON locale files (fr.json + en.json, 165 keys)
- data-i18n / data-i18n-placeholder / data-i18n-attr DOM attributes
- Live locale switch via setLocale() - no page reload
- Language detection: localStorage > navigator.language > 'fr'
- Fallback: missing key → French → raw key

Wired into:
- app.js: await initI18n() early in init()
- config.js: profile save → await setLocale(), toasts + confirm via t()
- auth.js: network error toast via t()
- index.html: data-i18n on login form, profile section, search placeholder
This commit is contained in:
2026-06-18 13:31:11 -04:00
parent daab917ed1
commit f85482214e
7 changed files with 718 additions and 24 deletions
+2
View File
@@ -4,6 +4,7 @@
import * as UI from './ui.js';
import * as Utils from './utils.js';
import { initI18n } from './i18n.js';
// Wire up AI toolbar toast (avoids circular import in utils.js)
window._obsigateShowToast = UI.showToast;
@@ -23,6 +24,7 @@ import { initMermaid, setupFocusMode } from './mermaid-viewer.js';
// =========================================================================
async function init() {
UI.initTheme();
await initI18n(); // Must run before any rendering that uses t()
UI.initHeaderMenu();
UI.initCustomDropdowns();