@@ -32,12 +32,15 @@ import {createContext, forwardRef, Fragment, ReactNode, useCallback, useContext,
32
32
import { focusRing , style } from '../style' with { type : 'macro' } ;
33
33
import { getAllowedOverrides , StyleProps , StylesPropWithHeight , UnsafeStyles } from './style-utils' with { type : 'macro' } ;
34
34
import { IconContext } from './Icon' ;
35
+ // @ts -ignore
36
+ import intlMessages from '../intl/*.json' ;
35
37
import { Picker , PickerItem } from './TabsPicker' ;
36
38
import { Text , TextContext } from './Content' ;
37
39
import { useControlledState } from '@react-stately/utils' ;
38
40
import { useDOMRef } from '@react-spectrum/utils' ;
39
41
import { useEffectEvent , useLayoutEffect , useResizeObserver } from '@react-aria/utils' ;
40
42
import { useLocale } from '@react-aria/i18n' ;
43
+ import { useLocalizedStringFormatter } from '@react-aria/i18n' ;
41
44
import { useSpectrumContextProps } from './useSpectrumContextProps' ;
42
45
43
46
export interface TabsProps extends Omit < AriaTabsProps , 'className' | 'style' | 'children' > , UnsafeStyles {
@@ -454,6 +457,7 @@ let HiddenTabs = function (props: {
454
457
} ;
455
458
456
459
let TabsMenu = ( props : { items : Array < Node < any > > , onSelectionChange : TabsProps [ 'onSelectionChange' ] } ) => {
460
+ let stringFormatter = useLocalizedStringFormatter ( intlMessages , '@react-spectrum/s2' ) ;
457
461
let { items} = props ;
458
462
let { density, onSelectionChange, selectedKey, isDisabled, disabledKeys} = useContext ( InternalTabsContext ) ;
459
463
let state = useContext ( TabListStateContext ) ;
@@ -480,7 +484,7 @@ let TabsMenu = (props: {items: Array<Node<any>>, onSelectionChange: TabsProps['o
480
484
disabledKeys = { disabledKeys }
481
485
selectedKey = { selectedKey }
482
486
onSelectionChange = { onSelectionChange }
483
- aria-label = { 'Tab selector' } >
487
+ aria-label = { stringFormatter . format ( 'tabs.selectorLabel' ) } >
484
488
{ ( item : Node < any > ) => {
485
489
// need to determine the best way to handle icon only -> icon and text
486
490
// good enough to aria-label the picker item?
0 commit comments