@@ -126,10 +126,21 @@ const FIELDS = {
126126 */
127127const 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. */
135146const 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