Uh oh!
There was an error while loading. Please reload this page.
fix(i18n): 组织写入目标徽标在十种语言下都渲染译文,而不是英文兜底 - #3526
Merged
Merged
Conversation
…locales
`form.createTargetOrg` was defined in no locale pack — not even `en` — so
i18next genuinely missed it and `RecordFormPage`'s inline `defaultValue`
rendered instead. The ADR-0105 badge therefore read English `Creates in <org>`
in all ten languages (a Chinese console creating a record on an org-walled
object showed `Creates in 某某组织`).
`all-locales-key-parity.test.ts` could not see this: it asserts every pack
defines every `en` key, so a key `en` itself lacks is outside the comparison,
and ten packs missing it identically kept parity green.
Backfill `createTargetOrg: 'Creates in {{org}}'` into `en` (the parity gate then
demands it from the other nine, each translated to its pack's existing form
tone), delete the inline default, and invert the two exception pins #3516 left:
the key joins BARE_KEYS, and the render assertion checks the badge against the
pack copy in both `en` and `zh`.
Fixes#3517The latest updates on your projects. Learn more about Vercel for GitHub. |
Contributor
✅ Console Performance Budget
📦 Bundle Size Report
Size Limits
|
yinlianghui
marked this pull request as ready for review
August 7, 2026 03:11
Uh oh!
There was an error while loading. Please reload this page.
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 freeto 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.
Fixes#3517
form.createTargetOrg(ADR-0105 集团租户「写入目标」徽标,RecordFormPagecreate 模式渲染)在十个语言包里一个都没有定义,连en都没有。i18next 是真的 miss,渲染出来的是调用点的内联defaultValue,所以该徽标在十种语言下全是英文 —— 中文控制台在组织隔离对象上新建记录时,头部会出现一句Creates in 某某组织。all-locales-key-parity.test.ts看不见这条:它断言的是「每个包定义了en的每个 key」,en自己没有的 key 不在比较范围内,十个包一致地缺失反而让 parity 完全绿。改了什么
en.ts回填createTargetOrg: 'Creates in {{org}}',parity 门禁随即要求其余九包跟上。form段的语气与词汇,不是机翻占位、也不是英文复制(逐条理由见下表)。RecordFormPage.tsx的内联defaultValue及其说明注释 —— 这是 [finding][i18n] RecordFormPage 给 form.createTitle 传的 defaultValue 是New ${label},与 en 包的Create {{object}}动词不一致(当前不可达) #3469 留下的最后一条例外,现在该文件每一处t()都是裸调用。Declared = enforced:语言包是这份文案的唯一来源,key 缺失必须显形(裸 key + dev missing-key 告警),而不是在调用点糊过去。form.createTargetOrg并入BARE_KEYS(钉住十包都有),渲染断言改为按语言包取值,并按该文件既有的写法同时断言 zh —— 被删掉的英文默认值无论如何都满足不了中文断言。九个语言的取词依据
创建到{{org}}新建{{object}}一致,插值前后不加空格;「创建到」表达写入方向作成先: {{org}}相手の保存時刻: {{time}}的「名词 + 半角冒号 + 值」徽标句式;作成先正是写入目标{{org}}에 생성{{object}} 생성同词(생성);조사에不随收音变化,插值安全Wird in {{org}} erstellt{{object}} erstellen同词根,被动现在时对应 "Creates in"Création dans {{org}}Créer {{object}}混淆Se crea en {{org}}Criação em {{org}}Criado em,它会与日期字段「Criado em 某日期」歧义Создаётся в {{org}}Создать {{object}}同词根;用 ё,与该包несохранённые/обновлён的正字法一致الإنشاء في {{org}}إنشاء {{object}}同词根;占位符置于句末,与该包تحرير {{label}}、الخطوة {{current}} من {{total}}的 RTL 语序一致测试方向(先预测再跑)
改动前(fresh main):两条例外钉扎绿(它们断言「缺失」)—— 实测 36 passed。
仅做第 1 步(只改
en.ts)——刻意跑的中间态:parity 红 + 例外钉扎红,共 10 failed。九条形如(以ar为例,zh/ja/ko/de/fr/es/pt/ru 同形):外加例外钉扎打出它自己写好的指令:
两道门禁都确实会响。
全部改完:全绿。
反向验证的方向是「无变化」,不是「变红」,这里如实记录:把
RecordFormPage.tsx从 origin/main 检出(把defaultValue装回去),测试文件 17 passed 依旧全绿 —— 因为 key 现在能从语言包解析,i18next 根本不会去看defaultValue,它又变回死代码。这正是本 issue 描述的缺陷形态(没有测试能看见的死分支),所以真正的红色方向是上面那个中间态,而不是「把删掉的肢体装回去」。验证
Changeset:
.changeset/create-target-org-translated-3517.md,@object-ui/i18n与@object-ui/app-shell各一条 patch。未触碰content/docs/releases/。🤖 Generated with Claude Code