Skip to content

Commit 4bff297

Browse files
committed
fix(studio): name the customize strings' package placeholder {package}
The zh wording census reads a bare Latin "base" in a value as an untranslated word, and {base} is one. Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01QsR2jQpUMdR7QmHKTFR8iB
1 parent 0513534 commit 4bff297

6 files changed

Lines changed: 28 additions & 28 deletions

File tree

‎ui/packages/app-shell/src/views/studio-design/InterfacesPillar.customize-28562.test.tsx‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -346,8 +346,8 @@ describe('Customize a read-only base’s dashboard into its pair (objectstack#28
346346

347347
// The badge reads the declaration the pair's draft now serves.
348348
const chip = await within(header()).findByTestId('studio-override-chip', undefined, { timeout: 8000 });
349-
expect(chip).toHaveTextContent(tFormat('engine.studio.customize.overrides', 'en', { base: 'HotCRM' }));
350-
expect(chip).toHaveAttribute('title', tFormat('engine.studio.customize.overridesTitle', 'en', { base: 'HotCRM', basedOn: '4.0.0' }));
349+
expect(chip).toHaveTextContent(tFormat('engine.studio.customize.overrides', 'en', { package: 'HotCRM' }));
350+
expect(chip).toHaveAttribute('title', tFormat('engine.studio.customize.overridesTitle', 'en', { package: 'HotCRM', basedOn: '4.0.0' }));
351351

352352
// A later edit of the same item asks the door no more.
353353
patchBoard();

‎ui/packages/app-shell/src/views/studio-design/StudioCustomizeControls.customize-28562.test.tsx‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -203,15 +203,15 @@ describe('the Customize button and the override badge (objectstack#28562)', () =
203203
const button = screen.getByTestId('studio-customize');
204204
expect(button).toBeEnabled();
205205
expect(button).toHaveTextContent(t('engine.studio.customize.action', 'en'));
206-
expect(button).toHaveAttribute('title', tFormat('engine.studio.customize.actionTitle', 'en', { base: 'HotCRM' }));
206+
expect(button).toHaveAttribute('title', tFormat('engine.studio.customize.actionTitle', 'en', { package: 'HotCRM' }));
207207
button.click();
208208
expect(onCustomize).toHaveBeenCalledTimes(1);
209209
expect(screen.queryByTestId('studio-customize-blocked')).toBeNull();
210210
});
211211

212212
it.each([
213213
['walled', t('engine.studio.customize.walled', 'en')],
214-
['noVersion', tFormat('engine.studio.customize.noVersion', 'en', { base: 'HotCRM' })],
214+
['noVersion', tFormat('engine.studio.customize.noVersion', 'en', { package: 'HotCRM' })],
215215
] as const)('blocked (%s): disabled, and its wrapper says why', (block, reason) => {
216216
const onCustomize = vi.fn();
217217
render(<StudioCustomizeButton block={block} baseLabel="HotCRM" locale="en" onCustomize={onCustomize} />);
@@ -226,10 +226,10 @@ describe('the Customize button and the override badge (objectstack#28562)', () =
226226
it('the badge names the base, and its title the version the override is based on', () => {
227227
render(<StudioOverrideChip baseLabel="HotCRM" basedOn="4.0.0" locale="en" />);
228228
const chip = screen.getByTestId('studio-override-chip');
229-
expect(chip).toHaveTextContent(tFormat('engine.studio.customize.overrides', 'en', { base: 'HotCRM' }));
229+
expect(chip).toHaveTextContent(tFormat('engine.studio.customize.overrides', 'en', { package: 'HotCRM' }));
230230
expect(chip).toHaveAttribute(
231231
'title',
232-
tFormat('engine.studio.customize.overridesTitle', 'en', { base: 'HotCRM', basedOn: '4.0.0' }),
232+
tFormat('engine.studio.customize.overridesTitle', 'en', { package: 'HotCRM', basedOn: '4.0.0' }),
233233
);
234234
});
235235
});

‎ui/packages/app-shell/src/views/studio-design/StudioCustomizeControls.tsx‎

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -207,15 +207,15 @@ export function StudioCustomizeButton({
207207
block === 'walled'
208208
? t('engine.studio.customize.walled', locale)
209209
: block === 'noVersion'
210-
? tFormat('engine.studio.customize.noVersion', locale, { base: baseLabel })
210+
? tFormat('engine.studio.customize.noVersion', locale, { package: baseLabel })
211211
: null;
212212
const button = (
213213
<button
214214
type="button"
215215
data-testid="studio-customize"
216216
disabled={reason !== null}
217217
aria-describedby={reason !== null ? reasonId : undefined}
218-
title={reason === null ? tFormat('engine.studio.customize.actionTitle', locale, { base: baseLabel }) : undefined}
218+
title={reason === null ? tFormat('engine.studio.customize.actionTitle', locale, { package: baseLabel }) : undefined}
219219
onClick={onCustomize}
220220
className={cn(
221221
'inline-flex h-7 shrink-0 items-center gap-1.5 whitespace-nowrap rounded-md border bg-background px-2.5 text-xs font-medium text-foreground hover:bg-muted',
@@ -260,11 +260,11 @@ export function StudioOverrideChip({
260260
return (
261261
<span
262262
data-testid="studio-override-chip"
263-
title={tFormat('engine.studio.customize.overridesTitle', locale, { base: baseLabel, basedOn })}
263+
title={tFormat('engine.studio.customize.overridesTitle', locale, { package: baseLabel, basedOn })}
264264
className="inline-flex h-[22px] shrink-0 items-center gap-1 rounded-[5px] bg-sky-500/10 px-2 text-[11px] font-medium text-sky-700 dark:text-sky-300"
265265
>
266266
<Layers className="h-3 w-3 shrink-0" aria-hidden="true" />
267-
{tFormat('engine.studio.customize.overrides', locale, { base: baseLabel })}
267+
{tFormat('engine.studio.customize.overrides', locale, { package: baseLabel })}
268268
</span>
269269
);
270270
}
@@ -318,7 +318,7 @@ export function StudioRestoreOriginalDialog({
318318
locale: string;
319319
onConfirm: () => void;
320320
}): React.ReactElement {
321-
const vars = { item: label, base: baseLabel };
321+
const vars = { item: label, package: baseLabel };
322322
const body = tFormat('engine.studio.customize.restoreBody', locale, vars);
323323
return (
324324
<AlertDialog open={open} onOpenChange={onOpenChange}>

‎ui/packages/app-shell/src/views/studio-design/StudioDesignSurface.tsx‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5148,7 +5148,7 @@ export function InterfacesPillar({
51485148
}
51495149
const declared = overrideDraftBody(body, custom.base, custom.basedOn);
51505150
if (declared === null) {
5151-
setError({ message: tFormat('engine.studio.customize.noVersion', locale, { base: custom.baseLabel }) });
5151+
setError({ message: tFormat('engine.studio.customize.noVersion', locale, { package: custom.baseLabel }) });
51525152
return;
51535153
}
51545154
// The buffer was read at another package (the base, before its pair
@@ -5247,7 +5247,7 @@ export function InterfacesPillar({
52475247
const pair = await pairFor(custom, 'view', viewId);
52485248
const body = overrideDraftBody(row, custom.base, custom.basedOn);
52495249
if (body === null) {
5250-
throw new Error(tFormat('engine.studio.customize.noVersion', locale, { base: custom.baseLabel }));
5250+
throw new Error(tFormat('engine.studio.customize.noVersion', locale, { package: custom.baseLabel }));
52515251
}
52525252
return { packageId: pair, body };
52535253
},
@@ -5923,7 +5923,7 @@ export function InterfacesPillar({
59235923
}
59245924
setServedNonce((n) => n + 1);
59255925
emitMetadataRefresh();
5926-
toast.success(tFormat('engine.studio.customize.restoreDone', locale, { item: item.label, base: custom.baseLabel }));
5926+
toast.success(tFormat('engine.studio.customize.restoreDone', locale, { item: item.label, package: custom.baseLabel }));
59275927
} catch (e) {
59285928
setError(plainRefusal(e));
59295929
} finally {

‎ui/packages/i18n/src/namespaces/studio/en.ts‎

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3167,17 +3167,17 @@ const STUDIO_EN: Record<string, string> = {
31673167
'engine.studio.pkg.readonlyLink': 'Read-only · Customize with an overlay',
31683168
// objectstack#28562 (ADR-0146 D2, D3) — Customize a read-only package's view, dashboard or report.
31693169
'engine.studio.customize.action': 'Customize',
3170-
'engine.studio.customize.actionTitle': 'Change this item for this deployment. Your first edit is saved as a customization draft, and {base} itself stays as it was installed.',
3170+
'engine.studio.customize.actionTitle': 'Change this item for this deployment. Your first edit is saved as a customization draft, and {package} itself stays as it was installed.',
31713171
'engine.studio.customize.walled': 'On this deployment, only the platform operator can customize an installed package.',
3172-
'engine.studio.customize.noVersion': 'The package list does not say which version of {base} is installed, so its items cannot be customized here.',
3173-
'engine.studio.customize.overrides': 'Overrides {base}',
3174-
'engine.studio.customize.overridesTitle': 'This item replaces {base}’s item of the same name on this deployment. It was taken from {base} {basedOn}.',
3172+
'engine.studio.customize.noVersion': 'The package list does not say which version of {package} is installed, so its items cannot be customized here.',
3173+
'engine.studio.customize.overrides': 'Overrides {package}',
3174+
'engine.studio.customize.overridesTitle': 'This item replaces {package}’s item of the same name on this deployment. It was taken from {package} {basedOn}.',
31753175
'engine.studio.customize.draftFooter': 'Edits save as a draft of this deployment’s customization; Publish applies them.',
31763176
'engine.studio.customize.restore': 'Restore package original',
3177-
'engine.studio.customize.restoreConfirm': 'Restore {base}’s “{item}”?',
3178-
'engine.studio.customize.restoreBody': 'This deployment’s customization of “{item}” is deleted, and {base}’s version is served again.',
3177+
'engine.studio.customize.restoreConfirm': 'Restore {package}’s “{item}”?',
3178+
'engine.studio.customize.restoreBody': 'This deployment’s customization of “{item}” is deleted, and {package}’s version is served again.',
31793179
'engine.studio.customize.restoreDraft': 'Its unpublished draft is discarded first.',
3180-
'engine.studio.customize.restoreDone': '“{item}” is back to {base}’s version',
3180+
'engine.studio.customize.restoreDone': '“{item}” is back to {package}’s version',
31813181
'engine.studio.app.scaffoldNav': "Add this package's objects as menu items",
31823182
'engine.studio.landing.title': 'App Builder',
31833183
'engine.studio.landing.description': 'Design objects, forms, automations and interfaces inside a writable package; edits save as drafts and the whole package publishes in one release. Code and installed packages are read-only: browse them here, and customize them with an environment overlay.',

‎ui/packages/i18n/src/namespaces/studio/zh.ts‎

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2809,17 +2809,17 @@ const STUDIO_ZH: Record<string, string> = {
28092809
'engine.studio.pkg.readonlyHint': '只读软件包 — 请切换或新建可写软件包后再编辑。',
28102810
'engine.studio.pkg.readonlyLink': '只读 · 用覆盖定制',
28112811
'engine.studio.customize.action': '自定义',
2812-
'engine.studio.customize.actionTitle': '为本部署修改此项。第一次编辑会保存为自定义草稿,{base} 本身保持安装时的样子。',
2812+
'engine.studio.customize.actionTitle': '为本部署修改此项。第一次编辑会保存为自定义草稿,{package} 本身保持安装时的样子。',
28132813
'engine.studio.customize.walled': '在此部署中,只有平台运营方可以自定义已安装的软件包。',
2814-
'engine.studio.customize.noVersion': '软件包列表没有给出已安装的 {base} 版本,因此无法在此自定义它的项。',
2815-
'engine.studio.customize.overrides': '覆盖 {base}',
2816-
'engine.studio.customize.overridesTitle': '此项在本部署中替换 {base} 中的同名项,取自 {base} {basedOn}。',
2814+
'engine.studio.customize.noVersion': '软件包列表没有给出已安装的 {package} 版本,因此无法在此自定义它的项。',
2815+
'engine.studio.customize.overrides': '覆盖 {package}',
2816+
'engine.studio.customize.overridesTitle': '此项在本部署中替换 {package} 中的同名项,取自 {package} {basedOn}。',
28172817
'engine.studio.customize.draftFooter': '编辑会保存为本部署自定义的草稿;发布后生效。',
28182818
'engine.studio.customize.restore': '恢复软件包原版',
2819-
'engine.studio.customize.restoreConfirm': '恢复 {base} 的「{item}」?',
2820-
'engine.studio.customize.restoreBody': '本部署对「{item}」的自定义会被删除,重新使用 {base} 的版本。',
2819+
'engine.studio.customize.restoreConfirm': '恢复 {package} 的「{item}」?',
2820+
'engine.studio.customize.restoreBody': '本部署对「{item}」的自定义会被删除,重新使用 {package} 的版本。',
28212821
'engine.studio.customize.restoreDraft': '会先丢弃它未发布的草稿。',
2822-
'engine.studio.customize.restoreDone': '「{item}」已恢复为 {base} 的版本',
2822+
'engine.studio.customize.restoreDone': '「{item}」已恢复为 {package} 的版本',
28232823
'engine.studio.app.scaffoldNav': '将本包的对象添加为菜单项',
28242824
'engine.studio.landing.title': '应用构建',
28252825
'engine.studio.landing.description': '在一个可写软件包里设计对象、表单、自动化与界面;编辑存为草稿,整包一次发布。源码与已安装的软件包为只读:可在此浏览,并用环境覆盖进行定制。',

0 commit comments

Comments
 (0)