mirror of
https://github.com/willmiao/ComfyUI-Lora-Manager.git
synced 2026-03-26 07:35:44 -03:00
feat(i18n): Implement server-side internationalization support
- Added ServerI18nManager to handle translations and locale settings on the server. - Integrated server-side translations into templates, reducing language flashing on initial load. - Created API endpoints for setting and getting user language preferences. - Enhanced client-side i18n handling to work seamlessly with server-rendered content. - Updated various templates to utilize the new translation system. - Added mixed i18n handler to coordinate server and client translations, improving user experience. - Expanded translation files to include initialization messages for various components.
This commit is contained in:
@@ -42,6 +42,11 @@ class I18nManager {
|
||||
return window.__INITIAL_LANGUAGE__;
|
||||
}
|
||||
|
||||
// 检查服务端传递的翻译数据
|
||||
if (window.__SERVER_TRANSLATIONS__ && window.__SERVER_TRANSLATIONS__.language && this.locales[window.__SERVER_TRANSLATIONS__.language]) {
|
||||
return window.__SERVER_TRANSLATIONS__.language;
|
||||
}
|
||||
|
||||
// Check localStorage for user-selected language
|
||||
const STORAGE_PREFIX = 'lora_manager_';
|
||||
let userLanguage = null;
|
||||
|
||||
@@ -373,6 +373,26 @@ export const en = {
|
||||
initialization: {
|
||||
title: 'Initializing LoRA Manager',
|
||||
message: 'Scanning and building LoRA cache. This may take a few minutes...',
|
||||
loras: {
|
||||
title: 'Initializing LoRA Manager',
|
||||
message: 'Scanning and building LoRA cache. This may take a few minutes...'
|
||||
},
|
||||
checkpoints: {
|
||||
title: 'Initializing Checkpoint Manager',
|
||||
message: 'Scanning and building checkpoint cache. This may take a few minutes...'
|
||||
},
|
||||
embeddings: {
|
||||
title: 'Initializing Embedding Manager',
|
||||
message: 'Scanning and building embedding cache. This may take a few minutes...'
|
||||
},
|
||||
recipes: {
|
||||
title: 'Initializing Recipe Manager',
|
||||
message: 'Loading and processing recipes. This may take a few minutes...'
|
||||
},
|
||||
statistics: {
|
||||
title: 'Initializing Statistics',
|
||||
message: 'Processing model data for statistics. This may take a few minutes...'
|
||||
},
|
||||
steps: {
|
||||
scanning: 'Scanning model files...',
|
||||
processing: 'Processing metadata...',
|
||||
|
||||
@@ -373,6 +373,26 @@ export const zhCN = {
|
||||
initialization: {
|
||||
title: '初始化 LoRA 管理器',
|
||||
message: '正在扫描并构建 LoRA 缓存,这可能需要几分钟时间...',
|
||||
loras: {
|
||||
title: '初始化 LoRA 管理器',
|
||||
message: '正在扫描并构建 LoRA 缓存,这可能需要几分钟时间...'
|
||||
},
|
||||
checkpoints: {
|
||||
title: '初始化大模型管理器',
|
||||
message: '正在扫描并构建大模型缓存,这可能需要几分钟时间...'
|
||||
},
|
||||
embeddings: {
|
||||
title: '初始化 Embedding 管理器',
|
||||
message: '正在扫描并构建 Embedding 缓存,这可能需要几分钟时间...'
|
||||
},
|
||||
recipes: {
|
||||
title: '初始化配方管理器',
|
||||
message: '正在加载和处理配方,这可能需要几分钟时间...'
|
||||
},
|
||||
statistics: {
|
||||
title: '初始化统计信息',
|
||||
message: '正在处理模型数据以生成统计信息,这可能需要几分钟时间...'
|
||||
},
|
||||
steps: {
|
||||
scanning: '扫描模型文件...',
|
||||
processing: '处理元数据...',
|
||||
|
||||
Reference in New Issue
Block a user