@@ -25,6 +25,7 @@ import { useObjectListFavorite } from '../layout/SidebarItemMenu.js';
2525import { useMetaItemRefusal } from '../hooks/useMetaItemRefusal.js' ;
2626import { useTenancyPosture } from '../hooks/useTenancyPosture.js' ;
2727import { useServedViewItems } from '../hooks/useServedViewItems.js' ;
28+ import { servedObjectPluralLabel } from '../hooks/useNavTargetLabel.js' ;
2829import type { DataSource } from '@object-ui/types' ;
2930import { MetadataPanel , useMetadataInspector } from './MetadataInspector.js' ;
3031import { ViewConfigPanel } from './ViewConfigPanel.js' ;
@@ -256,14 +257,22 @@ function ObjectViewInner({ dataSource, objects, onEdit, externalRefreshKey }: Co
256257 // and keeps an `object:` favorite only for an object the app does not list.
257258 // The entry the list is starred under is named with the plural the title
258259 // reads (objectui#11733).
260+ // What this list is titled: a served object's label is already translated
261+ // (objectstack#30311), so it is drawn as given; the bundle is asked only
262+ // when the definition carries none. The header, the favorite and an
263+ // unlabelled view's tab all read this one function, so they agree.
264+ const listTitleOf = useCallback (
265+ ( def : { name : string ; label ?: unknown ; pluralLabel ?: unknown } ) => servedObjectPluralLabel ( def , language , objectPluralLabel ) ,
266+ [ language , objectPluralLabel ] ,
267+ ) ;
259268 const listFavorite = useObjectListFavorite ( {
260269 appSegment : appName ,
261270 objectName,
262- label : objectPluralLabel ( objectDef ) ,
271+ label : listTitleOf ( objectDef ) ,
263272 } ) ;
264273 // A view stored with no `label` is named by the object's plural label, on
265274 // its tab and on the record page's way back alike (objectui#12774).
266- const unlabelledViewText = objectPluralLabel ( objectDef ) ;
275+ const unlabelledViewText = listTitleOf ( objectDef ) ;
267276
268277 // Refresh trigger — bumped after view CRUD or this page's own data writes.
269278 const [ ownRefreshKey , setRefreshKey ] = useState ( 0 ) ;
@@ -1182,7 +1191,7 @@ function ObjectViewInner({ dataSource, objects, onEdit, externalRefreshKey }: Co
11821191 titleSwitcher = { pageHeaderShown ? titleSwitcher : null }
11831192 titleLabel = { titleLabel }
11841193 objectListHref = { appName && objectName ? `/apps/${ appName } /${ objectName } ` : undefined }
1185- objectPluralLabel = { objectPluralLabel }
1194+ objectPluralLabel = { listTitleOf }
11861195 objectDesc = { objectDesc }
11871196 createButton = { createButton }
11881197 importShown = { importShown }
0 commit comments