Skip to content

Commit c61eae9

Browse files
Merge pull request #358 from bytewareteam/master
Add translations for 'Hour' and 'Minute' in TimeInputs component
2 parents 5227b59 + 0d711c4 commit c61eae9

File tree

24 files changed

+50
-3
lines changed

24 files changed

+50
-3
lines changed

src/Time/TimeInputs.tsx

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ import TimeInput from './TimeInput'
1818
import AmPmSwitcher from './AmPmSwitcher'
1919
import { useLatest } from '../utils'
2020
import Color from 'color'
21+
import { getTranslation } from '../translations/utils'
2122

2223
function TimeInputs({
2324
hours,
@@ -28,6 +29,7 @@ function TimeInputs({
2829
onChange,
2930
is24Hour,
3031
inputFontSize,
32+
locale,
3133
}: {
3234
inputType: PossibleInputTypes
3335
focused: PossibleClockTypes
@@ -41,6 +43,7 @@ function TimeInputs({
4143
}) => any
4244
is24Hour: boolean
4345
inputFontSize?: number
46+
locale?: string
4447
}) {
4548
const startInput = React.useRef<TextInputNative | null>(null)
4649
const endInput = React.useRef<TextInputNative | null>(null)
@@ -113,7 +116,7 @@ function TimeInputs({
113116
/>
114117
{inputType === 'keyboard' ? (
115118
<Text maxFontSizeMultiplier={1.5} variant="bodySmall">
116-
Hour
119+
{getTranslation(locale, 'hour', 'Hour')}
117120
</Text>
118121
) : null}
119122
</View>
@@ -178,7 +181,7 @@ function TimeInputs({
178181
/>
179182
{inputType === 'keyboard' ? (
180183
<Text maxFontSizeMultiplier={1.5} variant="bodySmall">
181-
Minute
184+
{getTranslation(locale, 'minute', 'Minute')}
182185
</Text>
183186
) : null}
184187
</View>

src/Time/TimePicker.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,7 @@ function TimePicker({
114114
onChange={onChange}
115115
onFocusInput={onFocusInput}
116116
focused={focused}
117+
locale={locale}
117118
/>
118119
{inputType === inputTypes.picker ? (
119120
<View style={styles.clockContainer}>

src/translations/ar.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,5 +17,7 @@ const ar: TranslationsType = {
1717
typeInDate: 'اكتب التاريخ',
1818
pickDateFromCalendar: 'اختر التاريخ من التقويم',
1919
close: 'أغلق',
20+
hour: 'ساعة',
21+
minute: 'دقيقة',
2022
}
2123
export default ar

src/translations/ca.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,5 +17,7 @@ const ca: TranslationsType = {
1717
typeInDate: 'Escriu la data',
1818
pickDateFromCalendar: 'Seleccionar la data del calendari',
1919
close: 'Tancar',
20+
minute: 'Minut',
21+
hour: 'Hora',
2022
}
2123
export default ca

src/translations/cs.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,5 +17,7 @@ const cs: TranslationsType = {
1717
typeInDate: 'Zadejte datum',
1818
pickDateFromCalendar: 'Vyberte datum z kalendáře',
1919
close: 'Zavřít',
20+
minute: 'minuta',
21+
hour: 'hodina',
2022
}
2123
export default cs

src/translations/de.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,5 +17,7 @@ const de: TranslationsType = {
1717
typeInDate: 'Datum eingeben',
1818
pickDateFromCalendar: 'Datum vom Kalender auswählen',
1919
close: 'Schliessen',
20+
minute: 'Minute',
21+
hour: 'Stunde',
2022
}
2123
export default de

src/translations/el.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,5 +17,7 @@ const el: TranslationsType = {
1717
typeInDate: 'Πληκτρολογήστε την ημερομηνία',
1818
pickDateFromCalendar: 'Επιλέξτε ημερομηνία από το ημερολόγιο',
1919
close: 'Κλείσε',
20+
minute: 'λεπτό',
21+
hour: 'ώρα',
2022
}
2123
export default el

src/translations/en.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,5 +17,7 @@ const en: TranslationsType = {
1717
typeInDate: 'Type in date',
1818
pickDateFromCalendar: 'Pick date from calendar',
1919
close: 'Close',
20+
minute: 'Minute',
21+
hour: 'Hour',
2022
}
2123
export default en

src/translations/enGB.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,5 +17,7 @@ const enGB: TranslationsType = {
1717
typeInDate: 'Type in date',
1818
pickDateFromCalendar: 'Pick date from calendar',
1919
close: 'Close',
20+
hour: 'Hour',
21+
minute: 'Minute',
2022
}
2123
export default enGB

src/translations/es.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,5 +17,7 @@ const es: TranslationsType = {
1717
typeInDate: 'Escribir fecha',
1818
pickDateFromCalendar: 'Seleccionar fecha del calendario',
1919
close: 'Cerrar',
20+
hour: 'Hora',
21+
minute: 'Minuto',
2022
}
2123
export default es

0 commit comments

Comments
 (0)