Skip to content

pipeline_by_stage 的 description 在 executive_dashboard 下与共享工厂脱钩,四个语言包同步漂移(共享 widget 的三份译文各说各话) #980

Description

@yinlianghui

发现自 #971 / PR #978 的实施过程(为把《快速上手》第 1 节写实,逐条核对 executive_dashboard 的 9 个 tile 与四个语言包)。基线 origin/main = 01da4a8e(平台 17.0.0-rc.3)。

observation-class:同义改写,读者不会读出不同含义,今天没有用户会因此做错事。记录下来是因为它恰好绕过了共享工厂想解决的问题。

事实

pipelineByStageFunnelWidget(src/dashboards/shared-widgets.ts:32-41)存在的理由写在它自己的文件头:

The pipeline funnel appeared word-for-word in the CRM, Sales and Executive dashboards … three copies of "what counts as open pipeline" that could (and did) drift independently. Each factory owns the semantic definition once.

工厂里的那一份是:

description: 'Open opportunity value at each sales stage'   // shared-widgets.ts:35

三块盘(crm_overview_dashboard / executive_dashboard / sales_dashboard)都调用它,源码侧确实只有一份。但语言包为每块盘各写了一份 widgets.pipeline_by_stage.description,而 executive 那一份在四个语言包里都与另外两份不一致:

语言包 crm_overview executive sales
en.ts :1271 at each sales stage :1286 by sales stage :1299 at each sales stage
zh-CN.ts :1279 按阶段统计的… :1294 按销售阶段统计的… :1307 按阶段统计的…
es-ES.ts :1347 en cada etapa de venta :1362 por etapa de venta :1375 en cada etapa de venta
ja-JP.ts :1293 各営業ステージの… :1308 営業ステージ別の… :1321 各営業ステージの…

title 三份一致(Pipeline by Stage / 阶段管道分布 / Pipeline por etapa / ステージ別パイプライン),漂的只有 description。四个语言包朝同一个方向漂,说明它们是从同一份早期文案各自翻译的,不是四次独立笔误。

为什么记下来

源码侧的复制被 #539 消掉了,i18n 侧的复制没有 —— 同一个 widget 的说明文字仍然是三份可独立漂移的文本 × 四个语言包 = 12 份。今天漂的只是"at each / by",无害;但同一个结构下一次漂的可能是语义(比如某一份把 open 写成 closed),而没有任何门会发现:pnpm lint --skip-i18n 跳过 i18n,test/i18n-references.test.ts 校的是 key 覆盖不是文案一致性。

顺带一提,en.ts 那份英文 description 与源码 shared-widgets.ts 的英文原文也不一致 —— 英文语言包本该是源码文案的同一份,这里却成了第四种写法。

处理建议(不预判)

至少三条路,都不明显最优,留给维护者定:

  1. 让工厂产出的 widget 只认一个 i18n key(例如 dashboards.shared.pipeline_by_stage),三块盘共用 —— 与 fix(analytics): repair chart axes, runtime-relative dates, real quota data; drop dead cube layer (#492) #539 的方向一致,但要动 i18n key 的组织方式,属于平台约定问题。
  2. 加一道门:断言凡是来自共享工厂的 widget,其在各 dashboard 下的 i18n 条目逐语言全等。改动小,但把重复留着。
  3. 只对齐现状:把 executive 的四份改成与另外两份一致,不加门 —— 最省事,也最容易再漂回来。

面:src/translations/{en,zh-CN,es-ES,ja-JP}.tscontent/docs/analytics/dashboards.mdx:129 与 PR #978 写的《快速上手》第 1 节都用的是源码原文,不受本条影响。

Refs #539 #971 #978

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions