refactor(i18n): streamline i18n initialization and update translation methods

This commit is contained in:
Will Miao
2025-08-31 09:03:06 +08:00
parent 408a435b71
commit b2c4efab45
11 changed files with 196 additions and 282 deletions

View File

@@ -4,7 +4,7 @@ import { state } from '../state/index.js';
import { resetAndReload } from '../api/modelApiFactory.js';
import { setStorageItem, getStorageItem } from '../utils/storageHelpers.js';
import { DOWNLOAD_PATH_TEMPLATES, MAPPABLE_BASE_MODELS, PATH_TEMPLATE_PLACEHOLDERS, DEFAULT_PATH_TEMPLATES } from '../utils/constants.js';
import { switchLanguage } from '../utils/i18nHelpers.js';
// import { switchLanguage } from '../utils/i18nHelpers.js';
export class SettingsManager {
constructor() {
@@ -982,7 +982,7 @@ export class SettingsManager {
}
// Switch language immediately
switchLanguage(selectedLanguage);
// switchLanguage(selectedLanguage);
showToast('Language changed successfully.', 'success');