mirror of
https://github.com/willmiao/ComfyUI-Lora-Manager.git
synced 2026-03-23 22:22:11 -03:00
feat(i18n): Enhance internationalization support by updating storage retrieval and translation handling
This commit is contained in:
@@ -3,6 +3,7 @@ import { toggleTheme } from '../utils/uiHelpers.js';
|
||||
import { SearchManager } from '../managers/SearchManager.js';
|
||||
import { FilterManager } from '../managers/FilterManager.js';
|
||||
import { initPageState } from '../state/index.js';
|
||||
import { getStorageItem } from '../utils/storageHelpers.js';
|
||||
import { updateSearchPlaceholder } from '../utils/i18nHelpers.js';
|
||||
|
||||
/**
|
||||
@@ -49,7 +50,7 @@ export class HeaderManager {
|
||||
const themeToggle = document.querySelector('.theme-toggle');
|
||||
if (themeToggle) {
|
||||
// Set initial state based on current theme
|
||||
const currentTheme = localStorage.getItem('lm_theme') || 'auto';
|
||||
const currentTheme = getStorageItem('theme') || 'auto';
|
||||
themeToggle.classList.add(`theme-${currentTheme}`);
|
||||
|
||||
// Set initial tooltip text
|
||||
@@ -157,8 +158,6 @@ export class HeaderManager {
|
||||
if (currentTheme === 'light') {
|
||||
themeToggle.title = window.i18n.t('header.theme.switchToDark');
|
||||
} else if (currentTheme === 'dark') {
|
||||
themeToggle.title = window.i18n.t('header.theme.switchToAuto');
|
||||
} else {
|
||||
themeToggle.title = window.i18n.t('header.theme.switchToLight');
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,7 +2,6 @@
|
||||
import { getCurrentPageState, setCurrentPageType } from '../../state/index.js';
|
||||
import { getStorageItem, setStorageItem, getSessionItem, setSessionItem } from '../../utils/storageHelpers.js';
|
||||
import { showToast } from '../../utils/uiHelpers.js';
|
||||
import { SidebarManager } from '../SidebarManager.js';
|
||||
import { sidebarManager } from '../SidebarManager.js';
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user