mirror of
https://github.com/willmiao/ComfyUI-Lora-Manager.git
synced 2026-03-26 07:35:44 -03:00
refactor(i18n): streamline i18n initialization and update translation methods
This commit is contained in:
@@ -5,7 +5,7 @@ import { modalManager } from './ModalManager.js';
|
||||
import { moveManager } from './MoveManager.js';
|
||||
import { getModelApiClient } from '../api/modelApiFactory.js';
|
||||
import { MODEL_TYPES, MODEL_CONFIG } from '../api/apiConfig.js';
|
||||
import { updateBulkSelectionCount } from '../utils/i18nHelpers.js';
|
||||
import { updateElementText } from '../utils/i18nHelpers.js';
|
||||
|
||||
export class BulkManager {
|
||||
constructor() {
|
||||
@@ -185,9 +185,9 @@ export class BulkManager {
|
||||
const countElement = document.getElementById('selectedCount');
|
||||
|
||||
if (countElement) {
|
||||
// Use i18n helper to update the count text
|
||||
updateBulkSelectionCount(state.selectedModels.size);
|
||||
|
||||
// Use i18nHelpers.js to update the count text
|
||||
updateElementText(countElement, 'loras.bulkOperations.selected', { count: state.selectedModels.size });
|
||||
|
||||
const existingCaret = countElement.querySelector('.dropdown-caret');
|
||||
if (existingCaret) {
|
||||
existingCaret.className = `fas fa-caret-${this.isStripVisible ? 'down' : 'up'} dropdown-caret`;
|
||||
|
||||
@@ -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');
|
||||
|
||||
|
||||
Reference in New Issue
Block a user