1
1
import React , { FC , ReactNode , useState } from 'react'
2
+ import { useTranslation } from 'react-i18next'
2
3
import { LayoutChangeEvent , StatusBar , View , ViewStyle , useWindowDimensions } from 'react-native'
3
4
import { useSafeAreaInsets } from 'react-native-safe-area-context'
4
5
5
6
import { useIsScreenReaderEnabled } from '@department-of-veterans-affairs/mobile-component-library'
6
7
7
8
import { HeaderButton , TextView , TextViewProps , WaygateWrapper } from 'components'
8
9
import VAScrollView , { VAScrollViewProps } from 'components/VAScrollView'
10
+ import { NAMESPACE } from 'constants/namespaces'
9
11
import { useTheme } from 'utils/hooks'
10
12
11
13
import HeaderBanner , { HeaderBannerProps } from './HeaderBanner'
@@ -59,6 +61,7 @@ export const ChildTemplate: FC<ChildTemplateProps> = ({
59
61
const fontScale = useWindowDimensions ( ) . fontScale
60
62
const theme = useTheme ( )
61
63
const screenReaderEnabled = useIsScreenReaderEnabled ( )
64
+ const { t } = useTranslation ( NAMESPACE . COMMON )
62
65
63
66
const [ scrollOffset , setScrollOffset ] = useState ( 0 )
64
67
const [ trackScrollOffset , setTrackScrollOffset ] = useState ( true )
@@ -73,7 +76,9 @@ export const ChildTemplate: FC<ChildTemplateProps> = ({
73
76
const headerProps : HeaderBannerProps = {
74
77
leftButton : {
75
78
text : backLabel ,
76
- a11yLabel : backLabelA11y ,
79
+ a11yLabel : backLabelA11y
80
+ ? t ( 'back.a11yLabel' , { screenName : backLabelA11y } )
81
+ : t ( 'back.a11yLabel' , { screenName : backLabel } ) ,
77
82
testID : backLabelTestID ,
78
83
onPress : backLabelOnPress ,
79
84
descriptiveBack : true ,
0 commit comments