Skip to content

fix(i18n): 八包补上 console.objectView 两个 key 的真译,systemViewReadonly 按 en 当前的 read-only 语义 (#3582) - #3627

Merged
yinlianghui merged 1 commit into
mainfrom
claude/issue-3582-values-english-2keys
Aug 7, 2026
Merged

fix(i18n): 八包补上 console.objectView 两个 key 的真译,systemViewReadonly 按 en 当前的 read-only 语义 (#3582)#3627
yinlianghui merged 1 commit into
mainfrom
claude/issue-3582-values-english-2keys

Conversation

@yinlianghui

Copy link
Copy Markdown
Collaborator

Fixes #3582

console.objectView.systemViewReadonly / expandToPage 在 ja/ko/de/fr/es/pt/ru/ar 八个包里存的是英文。systemViewReadonly 还多一层:八包存的不是 en 的当前文案,而是 en 自己已经废弃的旧话 —— 把八种语言的用户指向「复制一份来自定义」这条产品已不提供的操作路径。

en / zh 一字节未动,不增删任何 key(diff 是 8 个文件各 2 行、+2/-2 严格对称)。

译文对照表

console.objectView.systemViewReadonly

en 当前的 read-only 语义译,⛔ 未照抄包里那句过期英文。

修前 修后
en System view defined in code — read-only. (未改)
zh 系统视图由代码定义,只读。 (未改)
ja System view defined in code - duplicate to customize. システムビューはコードで定義されており、読み取り専用です。
ko 同上 시스템 보기는 코드에 정의되어 있어 읽기 전용입니다.
de 同上 Systemansicht — im Code definiert, schreibgeschützt.
fr 同上 Vue système définie dans le code — en lecture seule.
es 同上 Vista del sistema definida en el código: solo lectura.
pt 同上 Exibição do sistema definida no código — somente leitura.
ru 同上 Системное представление определено в коде — только для чтения.
ar 同上 عرض النظام معرَّف في الكود — للقراءة فقط.

console.objectView.expandToPage

修前 修后
en Open as full page (未改)
zh 以完整页面打开 (未改)
ja Open as full page フルページで開く
ko Open as full page 전체 페이지로 열기
de Open as full page Als ganze Seite öffnen
fr Open as full page Ouvrir en pleine page
es Open as full page Abrir como página completa
pt Open as full page Abrir como página inteira
ru Open as full page Открыть на всю страницу
ar Open as full page فتح كصفحة كاملة

译文来源:各包自己的既有措辞,没有一句是自创的

先读邻域再动笔,每个词都能指回同包已有的 key:

语义 取自
「系统视图」 同包 view.readonlyTooltip 的前半句
「由代码定义」 同包 console.objectView.cannotEditMetaView(#3583 刚落的邻键)
「只读」 同包 view.readOnly / view.readonlyAriaLabel
expandToPage 整句 同包 detail.openAsFullPage

detail.openAsFullPage 这条值得单说:它是隔壁命名空间里一模一样的英文句子(Open as full page),十个包早就译好了,而 enzh 的这两个 key 本来就逐字节相同。所以八包对齐它不是偷懒,而是照抄仓库自己已经立好的惯例;测试里也把这条钉住了,免得同一个动作在一个语言里出现两种说法。

旁证:packages/components/.../navigation-overlay-chrome-i18n.test.tsx:117 早就独立断言了 ja 的这句是 フルページで開く

标点与正式度也随邻域,不自创:es 用 :(同命名空间的 cannotEditMetaView / filterOrNotSavable 都用冒号,不是破折号),其余包用 ;es 的祈使语气邻域现状是 usted(Verifique / Use / Introduzca),本句是陈述句,不涉及。

反照抄验证输出

离线复现脚本(issue 正文那段的扩展版,十包 + 两个 key + 三条判据)。

修前:

===== console.objectView.systemViewReadonly =====
en  "System view defined in code — read-only."
zh  "系统视图由代码定义,只读。"
ja  "System view defined in code - duplicate to customize."   <<< EQ-EN-STALE,NO-NATIVE-SCRIPT
ko  "System view defined in code - duplicate to customize."   <<< EQ-EN-STALE,NO-NATIVE-SCRIPT
de  "System view defined in code - duplicate to customize."   <<< EQ-EN-STALE
fr  "System view defined in code - duplicate to customize."   <<< EQ-EN-STALE
es  "System view defined in code - duplicate to customize."   <<< EQ-EN-STALE
pt  "System view defined in code - duplicate to customize."   <<< EQ-EN-STALE
ru  "System view defined in code - duplicate to customize."   <<< EQ-EN-STALE,NO-NATIVE-SCRIPT
ar  "System view defined in code - duplicate to customize."   <<< EQ-EN-STALE,NO-NATIVE-SCRIPT

===== console.objectView.expandToPage =====
ja  "Open as full page"   <<< EQ-EN-CURRENT,EQ-EN-STALE,NO-NATIVE-SCRIPT
...(八包同)

systemViewReadonly: 3/10 distinct values; shared: ja/ko/de/fr/es/pt/ru/ar=...
expandToPage:       2/10 distinct values; shared: en/ja/ko/de/fr/es/pt/ru/ar=...

修后 —— 三类标记全部清空,两个 key 都是 10/10 互不相同:

===== console.objectView.systemViewReadonly =====
en  "System view defined in code — read-only."
zh  "系统视图由代码定义,只读。"
ja  "システムビューはコードで定義されており、読み取り専用です。"
ko  "시스템 보기는 코드에 정의되어 있어 읽기 전용입니다."
de  "Systemansicht — im Code definiert, schreibgeschützt."
fr  "Vue système définie dans le code — en lecture seule."
es  "Vista del sistema definida en el código: solo lectura."
pt  "Exibição do sistema definida no código — somente leitura."
ru  "Системное представление определено в коде — только для чтения."
ar  "عرض النظام معرَّف في الكود — للقراءة فقط."

systemViewReadonly: 10/10 distinct values
expandToPage:       10/10 distinct values

判据三条,均已写进 objectView-value-language-3582.test.ts:除 en 外无包等于新旧任一句英文;zh/ja/ko/ru/ar 的值必须含本文字系统字符;十包两两互不相同。

反向验证(先预测,后运行)

预测:回退 8 个包的值后 —— 新测试红 9 条(2 条等值 + 1 条 duplicate 语义 + 4 条文字系统(zh 应保持绿,它本来就没坏)+ 1 条互异 + 1 条 detail.openAsFullPage 对齐),en 钉子与非空断言保持绿;all-locales-key-parity 保持绿

实测完全吻合:

❯ objectView-value-language-3582.test.ts (22 tests | 9 failed)
  × no pack but en serves either English spelling of systemViewReadonly
  × no pack but en serves the English spelling of expandToPage
  × the retired "duplicate to customize" workflow is named by no pack
  × ja writes both values in its own script
  × ko writes both values in its own script
  × ru writes both values in its own script
  × ar writes both values in its own script
  × all ten packs differ from one another on both keys
  × expandToPage matches its own pack detail.openAsFullPage, in every pack
 Tests  9 failed | 33 passed (42)

# 同一棵回退树上单跑门禁:
all-locales-key-parity.test.ts →  Test Files 1 passed (1) / Tests 20 passed (20)

all-locales-key-parity 修前修后都绿是本 PR 的预期结论,不是缺陷 —— 它比的是键集合与占位符形状,而本缺陷不动键集合、两个 key 也都不带占位符。这正是它看不见这一类缺陷的原因,不该试图让它变红。

测试

# 新测试 + 门禁
npx vitest run --maxWorkers=2 packages/i18n/src/__tests__/objectView-value-language-3582.test.ts \
                              packages/i18n/src/__tests__/all-locales-key-parity.test.ts
  Test Files  2 passed (2) / Tests  42 passed (42)

# i18n 全量
npx vitest run --maxWorkers=2 packages/i18n/src/__tests__/
  Test Files  25 passed (25) / Tests  326 passed (326)

# 消费半径清扫(grep 全仓 key 名 + 两句英文字面量,逐个跑)
packages/components/.../navigation-overlay-chrome-i18n.test.tsx
packages/components/.../chrome-i18n-no-provider-fallback.test.tsx
  Test Files  2 passed (2) / Tests  18 passed (18)
packages/plugin-view/.../ObjectView.formTitleI18n.test.tsx, ObjectView.test.tsx
packages/app-shell/.../CreateViewDialog.ariaRequired.test.tsx, viewFilterFold.test.ts
  Test Files  4 passed (4) / Tests  75 passed (75)

pnpm --filter @object-ui/i18n type-check   → 通过(无输出)
node scripts/check-changeset-no-major.mjs  → ✅  No changeset declares a `major` bump.
node scripts/check-changeset-fixed.mjs     → ✅  All workspace packages are in the changeset fixed group.
eslint(9 个改动文件)                       → 0 errors,2 warnings(`as any`,与同目录既有 parity 测试同款)
控制字符自查 grep -naP '[\x00-\x08\x0b\x0c\x0e-\x1f]'  → 无

顺带发现,未在本 PR 修改(越界)

#3625 —— view.readonlyTooltip同样八个包里携带同一句已废弃语义(duplicate to customize),但它是地道译文而非英文原文。因此本 PR 的等值判据看不见它,issue #3582「建议 2」设想的那道非拉丁包 ASCII 抽查门禁也看不见它(ja 是日文、ru 是俄文、ar 是阿拉伯文,全绿)。这一点建议在裁定要不要做那道门禁时一并考虑 —— 真正缺的不变量可能是「en 改文案时九个译文包必须同批跟改」。本 PR 的新测试特意把 duplicate to customize 的扫描面限定在这两个 key,以免误红 #3625

按派发口径,issue #3582 的「建议 2」(非拉丁包 ASCII 抽查门禁)本单不做,另行分诊。

范围

  • 改:8 个语言包各 2 个值;新增 1 个测试文件 + 1 个 changeset(patch,@object-ui/i18n)
  • 未改:en.ts / zh.tsscripts/i18n-call-site-key-baseline.json(这两个 key 从不在棘轮里)、任何组件代码

🤖 Generated with Claude Code

https://claude.ai/code/session_01GTRjn8xBqp75dk7kFupVRt


Generated by Claude Code

… 当前的 read-only 语义 (#3582)

`console.objectView.systemViewReadonly` / `expandToPage` 在 ja/ko/de/fr/es/pt/
ru/ar 八个包里存的是英文;`systemViewReadonly` 存的还是 en 自己已经废弃的旧话
(`- duplicate to customize.`),把八种语言的用户指向一条产品已不提供的操作路径。
八包按 en 当前语义重译,en / zh 一字节不动,不增删任何 key。

译文取自各包自己的既有措辞而非自创:`view.readonlyTooltip` 供「系统视图」、
`console.objectView.cannotEditMetaView`(#3583 落的)供「由代码定义」;
`expandToPage` 对齐同包 `detail.openAsFullPage` —— 那是隔壁命名空间里
一模一样的英文句子,十包早已译好,en/zh 两个 key 本就逐字节相同。

新增 objectView-value-language-3582.test.ts:钉住 en 字面量(下次改 en 文案
即红,逼九个译文包同批跟改)、断言除 en 外无包等于新旧任一句英文、要求
zh/ja/ko/ru/ar 的值含本文字系统字符。all-locales-key-parity 修前修后都绿 ——
它比的是键集合与占位符形状,这正是它看不见本缺陷的原因。

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01GTRjn8xBqp75dk7kFupVRt
@vercel

vercel Bot commented Aug 7, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated (UTC)
objectui Ignored Ignored Aug 7, 2026 4:15pm

Request Review

@github-actions github-actions Bot added the tests label Aug 7, 2026
@github-actions

github-actions Bot commented Aug 7, 2026

Copy link
Copy Markdown
Contributor

✅ Console Performance Budget

Metric Value Budget
Main entry (gzip) 28.1 KB 350 KB
Entry file index-DJNW-W0o.js
Status PASS

📦 Bundle Size Report

Package Size Gzipped
app-shell (index.js) 8.66KB 3.13KB
app-shell (runtime-config.js) 7.42KB 2.32KB
app-shell (types.js) 0.01KB 0.04KB
app-shell (urlParams.js) 7.57KB 2.97KB
auth (AuthContext.js) 0.31KB 0.24KB
auth (AuthGuard.js) 1.17KB 0.53KB
auth (AuthProvider.js) 22.10KB 4.37KB
auth (AuthShell.js) 3.49KB 1.40KB
auth (ForgotPasswordForm.js) 12.21KB 3.45KB
auth (LoginForm.js) 18.13KB 5.39KB
auth (PreviewBanner.js) 0.90KB 0.50KB
auth (RegisterForm.js) 6.64KB 2.21KB
auth (SocialSignInButtons.js) 9.60KB 3.89KB
auth (UserMenu.js) 3.40KB 1.22KB
auth (auth-gate-events.js) 1.29KB 0.66KB
auth (authStyles.js) 5.04KB 1.72KB
auth (createAuthClient.js) 35.76KB 9.11KB
auth (createAuthenticatedFetch.js) 4.37KB 1.69KB
auth (index.js) 2.35KB 1.07KB
auth (org-roles.js) 6.66KB 2.78KB
auth (phone-identifier.js) 1.11KB 0.66KB
auth (types.js) 0.59KB 0.35KB
auth (useAuth.js) 4.91KB 0.87KB
auth (useIsWorkspaceAdmin.js) 1.61KB 0.85KB
collaboration (CommentThread.js) 26.07KB 7.56KB
collaboration (LiveCursors.js) 3.17KB 1.27KB
collaboration (PresenceAvatars.js) 6.49KB 2.64KB
collaboration (PresenceProvider.js) 2.79KB 1.13KB
collaboration (index.js) 1.65KB 0.73KB
collaboration (useCollaborationTranslation.js) 6.05KB 2.52KB
collaboration (useCommentSearch.js) 1.98KB 0.88KB
collaboration (useConflictResolution.js) 7.75KB 1.86KB
collaboration (useMentionNotifications.js) 1.81KB 0.68KB
collaboration (usePresence.js) 6.33KB 1.84KB
collaboration (useRealtimeSubscription.js) 7.91KB 2.01KB
components (index.js) 480.72KB 105.64KB
core (index.js) 2.96KB 1.13KB
create-plugin (index.js) 9.28KB 2.98KB
data-objectstack (index.js) 137.51KB 35.11KB
fields (index.js) 230.87KB 56.83KB
i18n (LocalizationContext.js) 1.76KB 0.96KB
i18n (currency.js) 1.22KB 0.64KB
i18n (i18n.js) 4.32KB 1.77KB
i18n (index.js) 2.65KB 1.06KB
i18n (pickLocalized.js) 1.70KB 0.83KB
i18n (provider.js) 9.48KB 3.27KB
i18n (useObjectLabel.js) 26.14KB 6.07KB
i18n (useSafeTranslation.js) 4.52KB 1.96KB
layout (index.js) 38.53KB 10.71KB
mobile (MobileProvider.js) 0.92KB 0.49KB
mobile (ResponsiveContainer.js) 0.94KB 0.38KB
mobile (breakpoints.js) 1.51KB 0.70KB
mobile (createOfflineDataSource.js) 5.61KB 1.74KB
mobile (index.js) 1.50KB 0.62KB
mobile (offlineQueue.js) 3.91KB 1.35KB
mobile (pwa.js) 0.97KB 0.49KB
mobile (serviceWorker.js) 1.48KB 0.62KB
mobile (serviceWorkerSource.js) 3.41KB 1.48KB
mobile (useBreakpoint.js) 1.54KB 0.65KB
mobile (useGesture.js) 6.96KB 1.98KB
mobile (useOfflineSync.js) 1.99KB 0.72KB
mobile (usePullToRefresh.js) 2.53KB 0.85KB
mobile (useResponsive.js) 0.71KB 0.42KB
mobile (useResponsiveConfig.js) 1.36KB 0.63KB
mobile (useSpecGesture.js) 4.32KB 1.64KB
mobile (useTouchTarget.js) 1.01KB 0.54KB
permissions (MePermissionsProvider.js) 8.75KB 3.06KB
permissions (PermissionContext.js) 0.31KB 0.25KB
permissions (PermissionGuard.js) 0.89KB 0.45KB
permissions (PermissionProvider.js) 3.67KB 1.12KB
permissions (evaluator.js) 4.41KB 1.44KB
permissions (index.js) 0.91KB 0.41KB
permissions (store.js) 0.91KB 0.42KB
permissions (useFieldPermissions.js) 1.28KB 0.52KB
permissions (usePermissions.js) 1.55KB 0.71KB
plugin-ai (index.js) 15.71KB 3.79KB
plugin-calendar (index.js) 44.98KB 12.37KB
plugin-charts (index.js) 61.04KB 17.31KB
plugin-chatbot (index.js) 180.09KB 42.72KB
plugin-dashboard (index.js) 115.50KB 29.96KB
plugin-designer (index.js) 210.51KB 42.51KB
plugin-detail (index.js) 232.79KB 57.42KB
plugin-editor (index.js) 2.46KB 1.10KB
plugin-form (index.js) 112.10KB 27.10KB
plugin-gantt (index.js) 162.55KB 39.57KB
plugin-grid (index.js) 186.61KB 49.34KB
plugin-kanban (index.js) 48.30KB 13.28KB
plugin-list (index.js) 105.12KB 25.48KB
plugin-map (index.js) 16.81KB 5.24KB
plugin-markdown (index.js) 13.72KB 4.69KB
plugin-report (index.js) 40.58KB 10.58KB
plugin-timeline (index.js) 25.76KB 7.33KB
plugin-tree (index.js) 8.50KB 2.88KB
plugin-view (index.js) 84.03KB 20.55KB
providers (DataSourceProvider.js) 0.75KB 0.39KB
providers (MetadataProvider.js) 1.37KB 0.59KB
providers (ThemeProvider.js) 1.90KB 0.85KB
providers (UploadProvider.js) 11.71KB 3.53KB
providers (index.js) 0.44KB 0.22KB
providers (types.js) 0.01KB 0.04KB
react-runtime (index.js) 5.67KB 2.37KB
react (LazyPluginLoader.js) 3.77KB 1.33KB
react (SchemaRenderer.js) 19.28KB 6.38KB
react (data-invalidation.js) 5.05KB 2.08KB
react (index.js) 1.02KB 0.55KB
react (spec-input.js) 0.20KB 0.18KB
sdui-parser (codegen.js) 4.09KB 1.74KB
sdui-parser (index.js) 4.47KB 2.03KB
sdui-parser (parse.js) 10.04KB 2.82KB
sdui-parser (types.js) 0.29KB 0.24KB
sdui-parser (validate.js) 4.69KB 1.48KB
types (ai.js) 0.20KB 0.17KB
types (api-types.js) 0.20KB 0.18KB
types (app.js) 2.87KB 0.99KB
types (base.js) 0.20KB 0.18KB
types (blocks.js) 0.20KB 0.18KB
types (complex.js) 0.20KB 0.18KB
types (crud.js) 0.20KB 0.18KB
types (data-display.js) 0.20KB 0.18KB
types (data-protocol.js) 0.20KB 0.19KB
types (data.js) 0.20KB 0.18KB
types (designer.js) 1.87KB 0.85KB
types (disclosure.js) 0.20KB 0.18KB
types (error-code.js) 1.54KB 0.88KB
types (feedback.js) 0.20KB 0.18KB
types (field-types.js) 0.20KB 0.18KB
types (form.js) 0.20KB 0.18KB
types (http-retry.js) 4.32KB 2.02KB
types (index.js) 2.71KB 1.34KB
types (layout.js) 0.20KB 0.18KB
types (managed-by.js) 0.19KB 0.18KB
types (mobile.js) 2.59KB 1.31KB
types (navigation.js) 0.20KB 0.18KB
types (objectql.js) 0.20KB 0.18KB
types (overlay.js) 0.20KB 0.18KB
types (permissions.js) 0.20KB 0.18KB
types (plugin-scope.js) 0.20KB 0.18KB
types (record-components.js) 0.20KB 0.19KB
types (record-semantics.js) 1.28KB 0.67KB
types (registry.js) 0.20KB 0.18KB
types (reports.js) 0.20KB 0.18KB
types (spec-report.js) 5.05KB 1.93KB
types (system-fields.js) 3.33KB 1.54KB
types (theme.js) 0.20KB 0.18KB
types (ui-action.js) 3.40KB 1.71KB
types (views.js) 0.20KB 0.18KB
types (widget.js) 0.20KB 0.18KB

Size Limits

  • ✅ Core packages should be < 50KB gzipped
  • ✅ Component packages should be < 100KB gzipped
  • ⚠️ Plugin packages should be < 150KB gzipped

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

console.objectView 的 2 个 key 在 8 个语言包里是英文原文,其中 systemViewReadonly 还是与 en 不一致的旧文案(全部门禁皆绿)

2 participants