refactor(i18n): Remove server_i18n references from routes and update translations in zh-CN and zh-TW locales

This commit is contained in:
Will Miao
2025-08-30 19:02:37 +08:00
parent 7b374d747b
commit f6709a55c3
5 changed files with 11 additions and 17 deletions

View File

@@ -131,9 +131,7 @@ class BaseModelRoutes(ABC):
'settings': settings, 'settings': settings,
'request': request, 'request': request,
'folders': [], 'folders': [],
# 添加服务端翻译函数
't': server_i18n.get_translation, 't': server_i18n.get_translation,
'server_i18n': server_i18n,
} }
if not is_initializing: if not is_initializing:

View File

@@ -151,7 +151,6 @@ class RecipeRoutes:
request=request, request=request,
# 添加服务端翻译函数 # 添加服务端翻译函数
t=server_i18n.get_translation, t=server_i18n.get_translation,
server_i18n=server_i18n,
) )
except Exception as cache_error: except Exception as cache_error:
logger.error(f"Error loading recipe cache data: {cache_error}") logger.error(f"Error loading recipe cache data: {cache_error}")
@@ -163,7 +162,6 @@ class RecipeRoutes:
request=request, request=request,
# 添加服务端翻译函数 # 添加服务端翻译函数
t=server_i18n.get_translation, t=server_i18n.get_translation,
server_i18n=server_i18n,
) )
logger.info("Recipe cache error, returning initialization page") logger.info("Recipe cache error, returning initialization page")

View File

@@ -75,9 +75,7 @@ class StatsRoutes:
is_initializing=is_initializing, is_initializing=is_initializing,
settings=settings, settings=settings,
request=request, request=request,
# 添加服务端翻译函数
t=server_i18n.get_translation, t=server_i18n.get_translation,
server_i18n=server_i18n,
) )
return web.Response( return web.Response(

View File

@@ -93,7 +93,7 @@ export const zhCN = {
navigation: { navigation: {
loras: 'LoRA', loras: 'LoRA',
recipes: '配方', recipes: '配方',
checkpoints: '大模型', checkpoints: 'Checkpoint',
embeddings: 'Embedding', embeddings: 'Embedding',
statistics: '统计' statistics: '统计'
}, },
@@ -102,7 +102,7 @@ export const zhCN = {
placeholders: { placeholders: {
loras: '搜索 LoRA...', loras: '搜索 LoRA...',
recipes: '搜索配方...', recipes: '搜索配方...',
checkpoints: '搜索大模型...', checkpoints: '搜索Checkpoint...',
embeddings: '搜索 Embedding...' embeddings: '搜索 Embedding...'
}, },
options: '搜索选项', options: '搜索选项',
@@ -237,9 +237,9 @@ export const zhCN = {
} }
}, },
// 大模型页面 // Checkpoint页面
checkpoints: { checkpoints: {
title: '大模型', title: 'Checkpoint',
info: { info: {
filename: '文件名', filename: '文件名',
modelName: '模型名称', modelName: '模型名称',
@@ -267,7 +267,7 @@ export const zhCN = {
overview: { overview: {
title: '概览', title: '概览',
totalLoras: 'LoRA 总数', totalLoras: 'LoRA 总数',
totalCheckpoints: '大模型总数', totalCheckpoints: 'Checkpoint总数',
totalEmbeddings: 'Embedding 总数', totalEmbeddings: 'Embedding 总数',
totalSize: '总大小', totalSize: '总大小',
favoriteModels: '收藏模型' favoriteModels: '收藏模型'
@@ -378,8 +378,8 @@ export const zhCN = {
message: '正在扫描并构建 LoRA 缓存,这可能需要几分钟时间...' message: '正在扫描并构建 LoRA 缓存,这可能需要几分钟时间...'
}, },
checkpoints: { checkpoints: {
title: '初始化大模型管理器', title: '初始化Checkpoint管理器',
message: '正在扫描并构建大模型缓存,这可能需要几分钟时间...' message: '正在扫描并构建Checkpoint缓存,这可能需要几分钟时间...'
}, },
embeddings: { embeddings: {
title: '初始化 Embedding 管理器', title: '初始化 Embedding 管理器',

View File

@@ -93,7 +93,7 @@ export const zhTW = {
navigation: { navigation: {
loras: 'LoRA', loras: 'LoRA',
recipes: '配方', recipes: '配方',
checkpoints: '大模型', checkpoints: 'Checkpoint',
embeddings: 'Embedding', embeddings: 'Embedding',
statistics: '統計' statistics: '統計'
}, },
@@ -102,7 +102,7 @@ export const zhTW = {
placeholders: { placeholders: {
loras: '搜尋 LoRA...', loras: '搜尋 LoRA...',
recipes: '搜尋配方...', recipes: '搜尋配方...',
checkpoints: '搜尋大模型...', checkpoints: '搜尋Checkpoint...',
embeddings: '搜尋 Embedding...' embeddings: '搜尋 Embedding...'
}, },
options: '搜尋選項', options: '搜尋選項',
@@ -241,9 +241,9 @@ export const zhTW = {
} }
}, },
// 大模型頁面 // Checkpoint頁面
checkpoints: { checkpoints: {
title: '大模型', title: 'Checkpoint',
info: { info: {
filename: '檔案名稱', filename: '檔案名稱',
modelName: '模型名稱', modelName: '模型名稱',