feat: i18n system - French/English internationalization
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:
@@ -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();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user