10
10
* governing permissions and limitations under the License.
11
11
*/
12
12
13
+ import { ActionButton } from './ActionButton' ;
13
14
import {
14
15
Breadcrumb as AriaBreadcrumb ,
15
16
BreadcrumbsProps as AriaBreadcrumbsProps ,
@@ -29,12 +30,14 @@ import {createContext, forwardRef, Fragment, ReactNode, RefObject, useCallback,
29
30
import { focusRing , getAllowedOverrides , StyleProps } from './style-utils' with { type : 'macro' } ;
30
31
import FolderIcon from '../s2wf-icons/S2_Icon_FolderBreadcrumb_20_N.svg' ;
31
32
import { forwardRefType } from './types' ;
33
+ // @ts -ignore
34
+ import intlMessages from '../intl/*.json' ;
32
35
import { Menu , MenuItem , MenuTrigger } from './Menu' ;
33
- import { ActionButton as S2ActionButton } from './ActionButton' ;
34
36
import { size , style } from '../style/spectrum-theme' with { type : 'macro' } ;
35
37
import { Text } from './Content' ;
36
38
import { useDOMRef , useResizeObserver } from '@react-spectrum/utils' ;
37
39
import { useLayoutEffect } from '@react-aria/utils' ;
40
+ import { useLocalizedStringFormatter } from '@react-aria/i18n' ;
38
41
import { useSpectrumContextProps } from './useSpectrumContextProps' ;
39
42
40
43
const MIN_VISIBLE_ITEMS = 1 ;
@@ -128,15 +131,16 @@ function Breadcrumbs<T extends object>(props: BreadcrumbsProps<T>, ref: DOMRef<H
128
131
}
129
132
130
133
let BreadcrumbMenu = ( props : { items : Array < Node < any > > , onAction : BreadcrumbsProps < unknown > [ 'onAction' ] } ) => {
134
+ let stringFormatter = useLocalizedStringFormatter ( intlMessages , '@react-spectrum/s2' ) ;
131
135
let { items, onAction} = props ;
132
136
let { direction} = useLocale ( ) ;
133
137
let { size, isDisabled} = useContext ( InternalBreadcrumbsContext ) ;
134
- // TODO localize See more
138
+ let label = stringFormatter . format ( 'breadcrumbs. more' ) ;
135
139
return (
136
140
< UNSTABLE_CollectionRendererContext . Provider value = { UNSTABLE_DefaultCollectionRenderer } >
137
141
< li className = { breadcrumbStyles ( { size, isDisabled, isMenu : true } ) } >
138
142
< MenuTrigger >
139
- < S2ActionButton isDisabled = { isDisabled } isQuiet aria-label = "See more" > < FolderIcon /> </ S2ActionButton >
143
+ < ActionButton isDisabled = { isDisabled } isQuiet aria-label = { label } > < FolderIcon /> </ ActionButton >
140
144
< Menu items = { items } onAction = { onAction } >
141
145
{ ( item : Node < any > ) => (
142
146
< MenuItem
@@ -193,7 +197,7 @@ let HiddenBreadcrumbs = function (props: {listRef: RefObject<HTMLDivElement | nu
193
197
</ div >
194
198
) ;
195
199
} ) }
196
- < S2ActionButton data-hidden-button isQuiet > < FolderIcon /> </ S2ActionButton >
200
+ < ActionButton data-hidden-button isQuiet > < FolderIcon /> </ ActionButton >
197
201
</ div >
198
202
) ;
199
203
} ;
0 commit comments