feat(i18n): add Vietnamese localization

This commit is contained in:
2026-07-22 18:02:17 +07:00
parent e066b9c131
commit 5aefec8dcf
47 changed files with 688 additions and 576 deletions
@@ -67,7 +67,7 @@ class TemplateCommandService:
) -> tuple[str | None, str | None]:
"""解析模板输入(支持模板名或序号)。"""
if not template_input:
return None, "模板参数不能为空"
return None, "Tham số mẫu không được để trống"
if template_input.isdigit():
index = int(template_input)
@@ -75,7 +75,8 @@ class TemplateCommandService:
return available_templates[index - 1], None
return (
None,
f"无效的序号 '{template_input}',有效范围: 1-{len(available_templates)}",
f"Số thứ tự '{template_input}' không hợp lệ; phạm vi hợp lệ: "
f"1-{len(available_templates)}",
)
return template_input, None
@@ -91,10 +92,12 @@ class TemplateCommandService:
header_content = [
Plain(
f"🎨 可用报告模板列表\n📌 当前使用: {current_template}\n💡 使用 /设置模板 [序号] 切换"
"🎨 Danh sách mẫu báo cáo khả dụng\n"
f"📌 Đang sử dụng: {current_template}\n"
"💡 Dùng /maubc [số thứ tự] để chuyển mẫu"
)
]
node_list.append(Node(uin=bot_id, name="模板预览", content=header_content))
node_list.append(Node(uin=bot_id, name="Xem trước mẫu", content=header_content))
for index, template_name in enumerate(available_templates):
current_mark = "" if template_name == current_template else ""
@@ -129,7 +129,7 @@ class AnalysisApplicationService:
# 1. 获取适配器
adapter = self.bot_manager.get_adapter(platform_id)
if not adapter:
raise ValueError(f"未找到平台 {platform_id} 的适配器")
raise ValueError(f"Không tìm thấy adapter cho nền tảng {platform_id}")
# 检查群聊是否被禁言(包括全体禁言或对 Bot 自身禁言)
if hasattr(adapter, "is_group_muted"):
@@ -160,7 +160,8 @@ class AnalysisApplicationService:
)
except Exception as e:
raise ValueError(
f"飞书成员信息预检查失败,请先完成应用权限授权:{e}"
"Kiểm tra trước thông tin thành viên Feishu thất bại; "
f"vui lòng cấp đủ quyền cho ứng dụng: {e}"
) from e
# 2. 拉取消息
@@ -347,7 +348,9 @@ class AnalysisApplicationService:
"""
async with self.group_lock(group_id, "incremental"):
if not self.incremental_store:
raise RuntimeError("增量分析未初始化:缺少 IncrementalStore")
raise RuntimeError(
"Phân tích tăng cường chưa được khởi tạo: thiếu IncrementalStore"
)
logger.info(
f"开始增量分析用例: 群 {group_id}, 平台 {platform_id or '默认'}"
@@ -356,7 +359,7 @@ class AnalysisApplicationService:
# 1. 获取适配器
adapter = self.bot_manager.get_adapter(platform_id)
if not adapter:
raise ValueError(f"未找到平台 {platform_id} 的适配器")
raise ValueError(f"Không tìm thấy adapter cho nền tảng {platform_id}")
# 检查群聊是否被禁言(包括全体禁言或对 Bot 自身禁言)
if hasattr(adapter, "is_group_muted"):
@@ -626,7 +629,8 @@ class AnalysisApplicationService:
async with self.group_lock(group_id, "final"):
if not self.incremental_store or not self.incremental_merge_service:
raise RuntimeError(
"增量分析未初始化:缺少 IncrementalStore 或 IncrementalMergeService"
"Phân tích tăng cường chưa được khởi tạo: thiếu "
"IncrementalStore hoặc IncrementalMergeService"
)
logger.info(
@@ -658,7 +662,7 @@ class AnalysisApplicationService:
# 5. 获取适配器(报告发送需要)
adapter = self.bot_manager.get_adapter(platform_id)
if not adapter:
raise ValueError(f"未找到平台 {platform_id} 的适配器")
raise ValueError(f"Không tìm thấy adapter cho nền tảng {platform_id}")
# 检查群聊是否被禁言(包括全体禁言或对 Bot 自身禁言)
if hasattr(adapter, "is_group_muted"):