Skip to content

Commit ec3b0e6

Browse files
committed
test(app-shell): serve the zh-CN answer in the record way-back plural fixture
Claude-Session: https://claude.ai/code/session_01Utp6CZywtebM5fE7KZuMEM Co-authored-by: Claude <noreply@anthropic.com>
1 parent 2311484 commit ec3b0e6

1 file changed

Lines changed: 16 additions & 5 deletions

File tree

‎ui/packages/app-shell/src/views/ObjectView.listLinksPlural-11733.test.tsx‎

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -126,10 +126,21 @@ const FIELDS = {
126126
*/
127127
const UNLABELLED_VIEW = { grid: { type: 'grid', columns: ['name'] } };
128128

129-
const OBJECTS = [
130-
{ name: 'showcase_project', label: 'Project', pluralLabel: 'Projects', fields: FIELDS, listViews: UNLABELLED_VIEW },
131-
{ name: 'showcase_note', label: 'Note', fields: FIELDS, listViews: UNLABELLED_VIEW },
132-
];
129+
/**
130+
* The served objects, per language: the server translates what it serves under
131+
* the request's language from the same catalog the console loads, so a zh-CN
132+
* session holds the zh-CN answer (objectstack#30311).
133+
*/
134+
const OBJECTS: Record<Lang, Array<Record<string, unknown>>> = {
135+
en: [
136+
{ name: 'showcase_project', label: 'Project', pluralLabel: 'Projects', fields: FIELDS, listViews: UNLABELLED_VIEW },
137+
{ name: 'showcase_note', label: 'Note', fields: FIELDS, listViews: UNLABELLED_VIEW },
138+
],
139+
'zh-CN': [
140+
{ name: 'showcase_project', label: '项目', pluralLabel: '项目清单', fields: FIELDS, listViews: UNLABELLED_VIEW },
141+
{ name: 'showcase_note', label: 'Note', fields: FIELDS, listViews: UNLABELLED_VIEW },
142+
],
143+
};
133144

134145
/** The catalog as the console loads it: `zh-CN` translates both scalars. */
135146
const BUNDLE: Record<Lang, Record<string, unknown>> = {
@@ -179,7 +190,7 @@ async function mountList(lang: Lang, objectName: string): Promise<void> {
179190
<Routes>
180191
<Route
181192
path="/apps/:appName/:objectName"
182-
element={<ObjectView dataSource={dataSource} objects={OBJECTS} onEdit={() => {}} />}
193+
element={<ObjectView dataSource={dataSource} objects={OBJECTS[lang] as never} onEdit={() => {}} />}
183194
/>
184195
<Route path="/apps/:appName/:objectName/record/:recordId" element={<OriginProbe />} />
185196
</Routes>

0 commit comments

Comments
 (0)