From f6709a55c323d0bb9f64896e66720a9d0a6892e4 Mon Sep 17 00:00:00 2001 From: Will Miao <13051207myq@gmail.com> Date: Sat, 30 Aug 2025 19:02:37 +0800 Subject: [PATCH] refactor(i18n): Remove server_i18n references from routes and update translations in zh-CN and zh-TW locales --- py/routes/base_model_routes.py | 2 -- py/routes/recipe_routes.py | 2 -- py/routes/stats_routes.py | 2 -- static/js/i18n/locales/zh-CN.js | 14 +++++++------- static/js/i18n/locales/zh-TW.js | 8 ++++---- 5 files changed, 11 insertions(+), 17 deletions(-) diff --git a/py/routes/base_model_routes.py b/py/routes/base_model_routes.py index 3a832c9b..c870f4c0 100644 --- a/py/routes/base_model_routes.py +++ b/py/routes/base_model_routes.py @@ -131,9 +131,7 @@ class BaseModelRoutes(ABC): 'settings': settings, 'request': request, 'folders': [], - # 添加服务端翻译函数 't': server_i18n.get_translation, - 'server_i18n': server_i18n, } if not is_initializing: diff --git a/py/routes/recipe_routes.py b/py/routes/recipe_routes.py index f23e0fd7..cdd1b793 100644 --- a/py/routes/recipe_routes.py +++ b/py/routes/recipe_routes.py @@ -151,7 +151,6 @@ class RecipeRoutes: request=request, # 添加服务端翻译函数 t=server_i18n.get_translation, - server_i18n=server_i18n, ) except Exception as cache_error: logger.error(f"Error loading recipe cache data: {cache_error}") @@ -163,7 +162,6 @@ class RecipeRoutes: request=request, # 添加服务端翻译函数 t=server_i18n.get_translation, - server_i18n=server_i18n, ) logger.info("Recipe cache error, returning initialization page") diff --git a/py/routes/stats_routes.py b/py/routes/stats_routes.py index 36392e2e..3fa1a519 100644 --- a/py/routes/stats_routes.py +++ b/py/routes/stats_routes.py @@ -75,9 +75,7 @@ class StatsRoutes: is_initializing=is_initializing, settings=settings, request=request, - # 添加服务端翻译函数 t=server_i18n.get_translation, - server_i18n=server_i18n, ) return web.Response( diff --git a/static/js/i18n/locales/zh-CN.js b/static/js/i18n/locales/zh-CN.js index 4e1623f8..09c91bf8 100644 --- a/static/js/i18n/locales/zh-CN.js +++ b/static/js/i18n/locales/zh-CN.js @@ -93,7 +93,7 @@ export const zhCN = { navigation: { loras: 'LoRA', recipes: '配方', - checkpoints: '大模型', + checkpoints: 'Checkpoint', embeddings: 'Embedding', statistics: '统计' }, @@ -102,7 +102,7 @@ export const zhCN = { placeholders: { loras: '搜索 LoRA...', recipes: '搜索配方...', - checkpoints: '搜索大模型...', + checkpoints: '搜索Checkpoint...', embeddings: '搜索 Embedding...' }, options: '搜索选项', @@ -237,9 +237,9 @@ export const zhCN = { } }, - // 大模型页面 + // Checkpoint页面 checkpoints: { - title: '大模型', + title: 'Checkpoint', info: { filename: '文件名', modelName: '模型名称', @@ -267,7 +267,7 @@ export const zhCN = { overview: { title: '概览', totalLoras: 'LoRA 总数', - totalCheckpoints: '大模型总数', + totalCheckpoints: 'Checkpoint总数', totalEmbeddings: 'Embedding 总数', totalSize: '总大小', favoriteModels: '收藏模型' @@ -378,8 +378,8 @@ export const zhCN = { message: '正在扫描并构建 LoRA 缓存,这可能需要几分钟时间...' }, checkpoints: { - title: '初始化大模型管理器', - message: '正在扫描并构建大模型缓存,这可能需要几分钟时间...' + title: '初始化Checkpoint管理器', + message: '正在扫描并构建Checkpoint缓存,这可能需要几分钟时间...' }, embeddings: { title: '初始化 Embedding 管理器', diff --git a/static/js/i18n/locales/zh-TW.js b/static/js/i18n/locales/zh-TW.js index 48b3ab0e..ae2fce92 100644 --- a/static/js/i18n/locales/zh-TW.js +++ b/static/js/i18n/locales/zh-TW.js @@ -93,7 +93,7 @@ export const zhTW = { navigation: { loras: 'LoRA', recipes: '配方', - checkpoints: '大模型', + checkpoints: 'Checkpoint', embeddings: 'Embedding', statistics: '統計' }, @@ -102,7 +102,7 @@ export const zhTW = { placeholders: { loras: '搜尋 LoRA...', recipes: '搜尋配方...', - checkpoints: '搜尋大模型...', + checkpoints: '搜尋Checkpoint...', embeddings: '搜尋 Embedding...' }, options: '搜尋選項', @@ -241,9 +241,9 @@ export const zhTW = { } }, - // 大模型頁面 + // Checkpoint頁面 checkpoints: { - title: '大模型', + title: 'Checkpoint', info: { filename: '檔案名稱', modelName: '模型名稱',