Repository navigation
Conversation
added 4 commits
November 17, 2026 06:06
内容生产与审查统一使用中文,分发到目标渠道时按渠道 locale 自动翻译, 人工审查始终基于中文原文。 主要改动: - 新增 article_translations 表,译文独立存储,中文原文永久保留在 articles - articles 增加 locale 字段,历史文章按标题语言自动回填 - distribution_channels 增加 locale 字段,后台可配置内容语言 - 新增 ArticleTranslationService:分段协议、截断检测、原文指纹过期判定、 失败回落原文,支持 zh/ru/en/ja/es/pt_BR - DistributionPayloadBuilder::build() 支持 targetLocale,载荷新增 content_locale/default_locale;Orchestrator 按渠道 locale 构建并哈希, 译文在入队前确定以保证 payload_hash 自洽 - 主站详情页与列表页按站点语言取译文,未命中回落原文 - 翻译命令改为写入译文表,不再覆盖 articles.content 顺带修复: - 质检 worker 与 knowledge/reverb/optimization worker 容器缺少 app/ 挂载, 代码改动不生效 - 兼容网关忽略 thinking 关闭参数导致质检 JSON 被推理 token 截断, 对非官方 DeepSeek 端点补 reasoning_effort=none 测试:新增 9 项单测/功能测试,相关回归 58 项通过
翻译命令改为调用 ArticleTranslationService 后不再直接访问 AiModel, 移除其清单条目;新增服务按 3 处直接访问登记。
Author
|
误操作:不应向上游提交 PR,已关闭。改动改在 autohaina 仓库处理。 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
背景
此前文章标题来自俄语标题库、正文语言由提示词文本决定,导致中俄混排、正文出现 GEO 等内部术语,人工审查困难。
本次改为:生成与审查统一中文,仅在分发(含主站展示)时按目标语言自动翻译。
改动
数据层
article_translations表:译文独立存储,中文原文永久保留在articlesarticles.locale:历史文章按标题语言回填distribution_channels.locale:后台可配置渠道内容语言翻译服务
ArticleTranslationService===TITLE=== / ===EXCERPT=== / ===META=== / ===CONTENT===translation_error,不阻断业务分发
DistributionPayloadBuilder::build($article, $targetLocale),载荷新增content_locale/default_localeDistributionOrchestrator按渠道 locale 构建并哈希;译文在入队前确定,保证payload_hash自洽主站
详情页与列表页按站点语言取译文,未命中回落中文原文。
顺带修复
app/挂载导致代码改动不生效(docker-compose.prod.yml)thinking关闭参数导致质检 JSON 被推理 token 截断;对非官方 DeepSeek 端点补reasoning_effort=none验证
locale=zh、俄语载荷locale=ru,default_locale=zh