File tree Expand file tree Collapse file tree 6 files changed +22
-4
lines changed Expand file tree Collapse file tree 6 files changed +22
-4
lines changed Original file line number Diff line number Diff line change @@ -3,6 +3,7 @@ import { StyleSheet, View } from 'react-native'
33import { IconButton , useTheme } from 'react-native-paper'
44import DayNames , { dayNamesHeight } from './DayNames'
55import type { DisableWeekDaysType } from './dateUtils'
6+ import { getTranslation } from '../translations/utils'
67
78const buttonContainerHeight = 56
89const buttonContainerMarginTop = 4
@@ -48,7 +49,7 @@ function CalendarHeader({
4849 >
4950 < IconButton
5051 icon = "chevron-left"
51- accessibilityLabel = "Previous"
52+ accessibilityLabel = { getTranslation ( locale , 'previous' ) }
5253 onPress = { onPrev }
5354 // RN types bug
5455 hasTVPreferredFocus = { undefined }
@@ -64,7 +65,7 @@ function CalendarHeader({
6465 >
6566 < IconButton
6667 icon = "chevron-right"
67- accessibilityLabel = "Next"
68+ accessibilityLabel = { getTranslation ( locale , 'next' ) }
6869 onPress = { onNext }
6970 // RN types bug
7071 hasTVPreferredFocus = { undefined }
Original file line number Diff line number Diff line change @@ -80,7 +80,9 @@ export default function DatePickerModalContentHeader(
8080 < IconButton
8181 icon = { collapsed ? 'pencil' : 'calendar' }
8282 accessibilityLabel = {
83- collapsed ? 'Type in date' : 'Pick date from calendar'
83+ collapsed
84+ ? getTranslation ( props . locale , 'typeInDate' )
85+ : getTranslation ( props . locale , 'pickDateFromCalendar' )
8486 }
8587 color = { color }
8688 onPress = { onToggle }
Original file line number Diff line number Diff line change @@ -31,7 +31,7 @@ export default function DatePickerModalHeader(
3131 < Appbar style = { styles . appbarHeader } >
3232 < Appbar . Action
3333 icon = "close"
34- accessibilityLabel = "Close"
34+ accessibilityLabel = { getTranslation ( locale , 'close' ) }
3535 onPress = { props . onDismiss }
3636 color = { color }
3737 testID = "react-native-paper-dates-close"
Original file line number Diff line number Diff line change @@ -11,5 +11,10 @@ const en: TranslationsType = {
1111 mustBeLowerThan : 'Must be earlier then' ,
1212 mustBeBetween : 'Must be between' ,
1313 dateIsDisabled : 'Day is not allowed' ,
14+ previous : 'Previous' ,
15+ next : 'Next' ,
16+ typeInDate : 'Type in date' ,
17+ pickDateFromCalendar : 'Pick date from calendar' ,
18+ close : 'Close' ,
1419}
1520export default en
Original file line number Diff line number Diff line change @@ -11,5 +11,10 @@ const enGB: TranslationsType = {
1111 mustBeLowerThan : 'Must be earlier then' ,
1212 mustBeBetween : 'Must be between' ,
1313 dateIsDisabled : 'Day is not allowed' ,
14+ previous : 'Previous' ,
15+ next : 'Next' ,
16+ typeInDate : 'Type in date' ,
17+ pickDateFromCalendar : 'Pick date from calendar' ,
18+ close : 'Close' ,
1419}
1520export default enGB
Original file line number Diff line number Diff line change @@ -8,6 +8,11 @@ export type TranslationsType = {
88 mustBeLowerThan : string
99 mustBeBetween : string
1010 dateIsDisabled : string
11+ previous : string
12+ next : string
13+ typeInDate : string
14+ pickDateFromCalendar : string
15+ close : string
1116}
1217
1318let translationsPerLocale : Record < string , TranslationsType > = { }
You can’t perform that action at this time.
0 commit comments