fix: add missing t() import and fix init order
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 12s

- 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
This commit is contained in:
2026-06-18 22:55:04 -04:00
parent 659c227e6a
commit 4b9a450be3
2 changed files with 3 additions and 2 deletions
+2 -2
View File
@@ -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();
+1
View File
@@ -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