@@ -20,14 +20,14 @@ interface MatrixCellProps {
2020 * Gets the localized label for a product category, with simple plural handling.
2121 */
2222function getCategoryLabel (
23- t : ReturnType < typeof useTranslations > ,
23+ tShared : ReturnType < typeof useTranslations > ,
2424 category : ProductCategory ,
2525 count : number
2626) : string {
2727 if ( count === 1 ) {
28- return t ( `categories.${ category } ` )
28+ return tShared ( `categories.${ category } ` )
2929 }
30- return t ( `categoriesPlural .${ category } `)
30+ return tShared ( `categories.plural .${ category } `)
3131}
3232
3333/**
@@ -45,6 +45,7 @@ function getVendorTypeLabel(t: ReturnType<typeof useTranslations>, type: string)
4545function MatrixCell ( { products, category } : MatrixCellProps ) {
4646 const [ isExpanded , setIsExpanded ] = useState ( false )
4747 const tComponent = useTranslations ( 'components.product.vendorMatrix' )
48+ const tShared = useTranslations ( 'shared' )
4849
4950 if ( products . length === 0 ) {
5051 return (
@@ -104,7 +105,7 @@ function MatrixCell({ products, category }: MatrixCellProps) {
104105 < span className = "font-medium text-sm tracking-tight" >
105106 { tComponent ( 'cell.summary' , {
106107 count : products . length ,
107- category : getCategoryLabel ( tComponent , category , products . length ) ,
108+ category : getCategoryLabel ( tShared , category , products . length ) ,
108109 } ) }
109110 </ span >
110111 < span className = "text-xs text-[var(--color-text-muted)]" >
@@ -143,6 +144,7 @@ export default function VendorMatrix({ matrixData }: VendorMatrixProps) {
143144 const [ selectedVendorTypes , setSelectedVendorTypes ] = useState < Set < string > > ( new Set ( ) )
144145 const [ sortBy , setSortBy ] = useState < 'name' | 'products' > ( 'products' )
145146 const tComponent = useTranslations ( 'components.product.vendorMatrix' )
147+ const tShared = useTranslations ( 'shared' )
146148
147149 const filteredAndSortedData = useMemo ( ( ) => {
148150 let filtered = matrixData
@@ -306,7 +308,7 @@ export default function VendorMatrix({ matrixData }: VendorMatrixProps) {
306308 : 'border-[var(--color-border)] hover:bg-[var(--color-hover)]'
307309 } `}
308310 >
309- { tComponent ( 'controls.sortProducts ') }
311+ { tShared ( 'terms.products ') }
310312 </ button >
311313 </ div >
312314 </ div >
@@ -322,7 +324,7 @@ export default function VendorMatrix({ matrixData }: VendorMatrixProps) {
322324 </ div >
323325 { PRODUCT_CATEGORIES . map ( cat => (
324326 < div key = { cat } className = "font-medium text-sm text-center px-2" >
325- { tComponent ( `categories.${ cat } ` ) }
327+ { tShared ( `categories.singular .${ cat } ` ) }
326328 </ div >
327329 ) ) }
328330 </ div >
0 commit comments