From 4b9a450be39dabe5a910497ef593655f9bddabf2 Mon Sep 17 00:00:00 2001 From: Bruno Charest Date: Thu, 18 Jun 2026 22:55:04 -0400 Subject: [PATCH] fix: add missing t() import and fix init order - app.js: import { t } alongside initI18n, move initI18n() before UI.initTheme() - sidebar.js: add import { t } from ./i18n.js - These fix ReferenceError: t is not defined on startup --- frontend/js/app.js | 4 ++-- frontend/js/sidebar.js | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/frontend/js/app.js b/frontend/js/app.js index 404116e..26cd468 100644 --- a/frontend/js/app.js +++ b/frontend/js/app.js @@ -4,7 +4,7 @@ import * as UI from './ui.js'; import * as Utils from './utils.js'; -import { initI18n } from './i18n.js'; +import { initI18n, t } from './i18n.js'; // Wire up AI toolbar toast (avoids circular import in utils.js) window._obsigateShowToast = UI.showToast; @@ -23,8 +23,8 @@ import { initMermaid, setupFocusMode } from './mermaid-viewer.js'; // Initialization — mirrors the original app.js init() ordering // ========================================================================= async function init() { - UI.initTheme(); await initI18n(); // Must run before any rendering that uses t() + UI.initTheme(); UI.initHeaderMenu(); UI.initCustomDropdowns(); diff --git a/frontend/js/sidebar.js b/frontend/js/sidebar.js index fd18911..8611353 100644 --- a/frontend/js/sidebar.js +++ b/frontend/js/sidebar.js @@ -5,6 +5,7 @@ import { populateCustomDropdown, TabManager, closeMobileSidebar, ContextMenuMana import { _populateRecentVaultFilter, switchSidebarTab } from './config.js'; import { el, icon, getVaultIcon, smallBadge, attachTreeItemActionButton, attachTreeItemLongPress, showWelcome, appendHighlightedText } from './viewer.js'; import { performAdvancedSearch } from './search.js'; +import { t } from './i18n.js'; // --------------------------------------------------------------------------- // Vault context switching