Skip to content

i18n 核心:全局 language 配置、文案目录与 t() - #264

Merged
zj1123581321 merged 5 commits into
mainfrom
card/VideoTranscriptAPI-20261019-02
Oct 19, 2026
Merged

zj1123581321 merged 5 commits into
mainfrom
card/VideoTranscriptAPI-20261019-02

Conversation

@zj1123581321

Copy link
Copy Markdown
Collaborator

内容

中英双语(i18n)第一步:建立后续三张卡共用的契约。

  • 设计文档:docs/sessions/vta-i18n-261019/design.md(方案、已否决方案、分期)
  • 顶层配置 language:zh-CN | en,缺省 zh-CN(现有部署零变更);非法值在 load_config 时直接抛 ValueError 并列出合法取值
  • 新包 video_transcript_api.i18n:SUPPORTED_LANGUAGES、get_language()、t(key, **kwargs);缺 key 直接抛错,不回落
  • 文案目录 i18n/locales/{zh-CN,en}.json(目前只有骨架 key,后续卡填充)
  • 测试 tests/unit/i18n/test_i18n.py:key 集合一致性、缺省语言、非法值、端到端子进程消费

验证

  • 执行器:make test 全绿(4158 项)
  • 主脑复跑:pytest tests/unit/i18n tests/unit/test_llm_config_defaults.py tests/unit/test_api_routes.py → 70 passed

后续

C2 英文文档(并行中);C3 LLM 产出语言、C4 网页界面、C5 API 报错在本 PR 合并后派发。

🤖 Generated with Claude Code

zj1123581321 and others added 4 commits October 19, 2026 16:13
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Agent-Executor: cc
Agent-Session: 7b8b0d08-623e-4524-a474-f22b021e4d4c
Agent-Effort: medium
…Verify 通过)

Agent-Executor: ocgo-deepseek-pi
Agent-Model: deepseek-v4.1-flash
Agent-Effort: high
Dispatch-Id: dlg-20261019-081827-df5db1
Task-Id: VideoTranscriptAPI-20261019-02
Committed-By: delegate-harness
非对象根(123/null)此前在 load_config 里先抛 TypeError: argument of type
'int' is not iterable,把 validate_config 原本明确的 "configuration root
must be an object" 换成了与真实原因无关的一句。加 isinstance 前置条件,
让形状错误继续由 validate_config 报,并新增测试锁死。

Agent-Executor: ocgo-deepseek-pi
Agent-Model: deepseek-v4.1-flash
Agent-Effort: high
Dispatch-Id: dlg-20261019-100413-17add4
Task-Id: VideoTranscriptAPI-20261019-02
--check-config 只证明取值被接受,不证明配置里写 en 之后 t() 真的返回英文。
新增两条子进程测试,走真实的 VTAPI_CONFIG 环境变量 -> load_config ->
get_language -> 文案目录链路,分别在子进程里断言 en 与缺省 zh-CN 的输出。

Agent-Executor: ocgo-deepseek-pi
Agent-Model: deepseek-v4.1-flash
Agent-Effort: high
Dispatch-Id: dlg-20261019-100413-17add4
Task-Id: VideoTranscriptAPI-20261019-02
@zj1123581321 zj1123581321 self-assigned this Oct 19, 2026
Agent-Executor: codex
Agent-Model: gpt-6-luna
Agent-Effort: xhigh
Dispatch-Id: dlg-20261019-114013-33ac41
Task-Id: VideoTranscriptAPI-20261019-03
@zj1123581321
zj1123581321 marked this pull request as ready for review October 19, 2026 12:21
@github-actions

Copy link
Copy Markdown

Required Gate v2 — 状态面板

当前状态:pass · 可合并

当前裁决:code_pass / primary_pass

PR 累计主审轮(影子):1/5 · collecting

历史可能不完整:1 个制品处理失败:URLError;1 个历史重建预算耗尽

Gate 历史(v1;来源为持久化 gate_terminal 制品)

Run Attempt Head 状态 PR 累计主审轮(影子) 收件人动作
39245021562 1 2d1a648 skipped — 无需动作(主审未跑,绿≠过审)
39251426672 1 4db3637 fail — 要修代码
39251466481 1 4db3637 pass 1/5 · collecting 可合并

历史行按 run_id + run_attempt 去重并只增不删;删除本评论后可由 gate_terminal 制品重建。

@zj1123581321
zj1123581321 merged commit 708352f into main Oct 19, 2026
21 of 26 checks passed
@zj1123581321
zj1123581321 deleted the card/VideoTranscriptAPI-20261019-02 branch October 19, 2026 12:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant