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:
Will Miao
2025-08-30 16:56:56 +08:00
parent 3c9e402bc0
commit 29160bd6e5
14 changed files with 775 additions and 42 deletions

View File

@@ -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...',

View File

@@ -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: '处理元数据...',