Skip to content

Commit

Permalink
Merge pull request #358 from bytewareteam/master
Browse files Browse the repository at this point in the history
Add translations for 'Hour' and 'Minute' in TimeInputs component
  • Loading branch information
RichardLindhout authored Dec 21, 2023
2 parents 5227b59 + 0d711c4 commit c61eae9
Show file tree
Hide file tree
Showing 24 changed files with 50 additions and 3 deletions.
7 changes: 5 additions & 2 deletions src/Time/TimeInputs.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import TimeInput from './TimeInput'
import AmPmSwitcher from './AmPmSwitcher'
import { useLatest } from '../utils'
import Color from 'color'
import { getTranslation } from '../translations/utils'

function TimeInputs({
hours,
Expand All @@ -28,6 +29,7 @@ function TimeInputs({
onChange,
is24Hour,
inputFontSize,
locale,
}: {
inputType: PossibleInputTypes
focused: PossibleClockTypes
Expand All @@ -41,6 +43,7 @@ function TimeInputs({
}) => any
is24Hour: boolean
inputFontSize?: number
locale?: string
}) {
const startInput = React.useRef<TextInputNative | null>(null)
const endInput = React.useRef<TextInputNative | null>(null)
Expand Down Expand Up @@ -113,7 +116,7 @@ function TimeInputs({
/>
{inputType === 'keyboard' ? (
<Text maxFontSizeMultiplier={1.5} variant="bodySmall">
Hour
{getTranslation(locale, 'hour', 'Hour')}
</Text>
) : null}
</View>
Expand Down Expand Up @@ -178,7 +181,7 @@ function TimeInputs({
/>
{inputType === 'keyboard' ? (
<Text maxFontSizeMultiplier={1.5} variant="bodySmall">
Minute
{getTranslation(locale, 'minute', 'Minute')}
</Text>
) : null}
</View>
Expand Down
1 change: 1 addition & 0 deletions src/Time/TimePicker.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,7 @@ function TimePicker({
onChange={onChange}
onFocusInput={onFocusInput}
focused={focused}
locale={locale}
/>
{inputType === inputTypes.picker ? (
<View style={styles.clockContainer}>
Expand Down
2 changes: 2 additions & 0 deletions src/translations/ar.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,7 @@ const ar: TranslationsType = {
typeInDate: 'اكتب التاريخ',
pickDateFromCalendar: 'اختر التاريخ من التقويم',
close: 'أغلق',
hour: 'ساعة',
minute: 'دقيقة',
}
export default ar
2 changes: 2 additions & 0 deletions src/translations/ca.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,7 @@ const ca: TranslationsType = {
typeInDate: 'Escriu la data',
pickDateFromCalendar: 'Seleccionar la data del calendari',
close: 'Tancar',
minute: 'Minut',
hour: 'Hora',
}
export default ca
2 changes: 2 additions & 0 deletions src/translations/cs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,7 @@ const cs: TranslationsType = {
typeInDate: 'Zadejte datum',
pickDateFromCalendar: 'Vyberte datum z kalendáře',
close: 'Zavřít',
minute: 'minuta',
hour: 'hodina',
}
export default cs
2 changes: 2 additions & 0 deletions src/translations/de.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,7 @@ const de: TranslationsType = {
typeInDate: 'Datum eingeben',
pickDateFromCalendar: 'Datum vom Kalender auswählen',
close: 'Schliessen',
minute: 'Minute',
hour: 'Stunde',
}
export default de
2 changes: 2 additions & 0 deletions src/translations/el.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,7 @@ const el: TranslationsType = {
typeInDate: 'Πληκτρολογήστε την ημερομηνία',
pickDateFromCalendar: 'Επιλέξτε ημερομηνία από το ημερολόγιο',
close: 'Κλείσε',
minute: 'λεπτό',
hour: 'ώρα',
}
export default el
2 changes: 2 additions & 0 deletions src/translations/en.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,7 @@ const en: TranslationsType = {
typeInDate: 'Type in date',
pickDateFromCalendar: 'Pick date from calendar',
close: 'Close',
minute: 'Minute',
hour: 'Hour',
}
export default en
2 changes: 2 additions & 0 deletions src/translations/enGB.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,7 @@ const enGB: TranslationsType = {
typeInDate: 'Type in date',
pickDateFromCalendar: 'Pick date from calendar',
close: 'Close',
hour: 'Hour',
minute: 'Minute',
}
export default enGB
2 changes: 2 additions & 0 deletions src/translations/es.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,7 @@ const es: TranslationsType = {
typeInDate: 'Escribir fecha',
pickDateFromCalendar: 'Seleccionar fecha del calendario',
close: 'Cerrar',
hour: 'Hora',
minute: 'Minuto',
}
export default es
2 changes: 2 additions & 0 deletions src/translations/fr.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,7 @@ const fr: TranslationsType = {
typeInDate: 'Entrer la date',
pickDateFromCalendar: 'Sélectionner une date dans le calendrier',
close: 'Fermer',
minute: 'minutes',
hour: 'heures',
}
export default fr
2 changes: 2 additions & 0 deletions src/translations/he.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,7 @@ const he: TranslationsType = {
typeInDate: 'הקש תאריך',
pickDateFromCalendar: 'בחר תאריך מהלוח שנה',
close: 'סגור',
hour: 'שעה',
minute: 'דקה',
}
export default he
2 changes: 2 additions & 0 deletions src/translations/hi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,7 @@ const hi: TranslationsType = {
typeInDate: 'तारीख़ लिखें',
pickDateFromCalendar: 'कैलेंडर से तारीख़ चुनें',
close: 'बंद करें',
minute: 'मिनट',
hour: 'घंटा',
}
export default hi
2 changes: 2 additions & 0 deletions src/translations/it.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,7 @@ const it: TranslationsType = {
typeInDate: 'Digita la data',
pickDateFromCalendar: 'Scegli data dal calendario',
close: 'Chiudi',
hour: 'Ora',
minute: 'Minuto',
}
export default it
2 changes: 2 additions & 0 deletions src/translations/ko.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,7 @@ const ko: TranslationsType = {
typeInDate: '날짜 입력',
pickDateFromCalendar: '달력에서 날짜 선택',
close: '닫기',
minute: '분',
hour: '시',
}
export default ko
2 changes: 2 additions & 0 deletions src/translations/nl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,7 @@ const nl: TranslationsType = {
typeInDate: 'Typ datum',
pickDateFromCalendar: 'Kies datum van kalender',
close: 'Sluit',
hour: 'Uur',
minute: 'Minuut',
}
export default nl
3 changes: 2 additions & 1 deletion src/translations/pl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,12 @@ const pl: TranslationsType = {
mustBeLowerThan: (date) => `Nie później niż ${date}`,
mustBeBetween: (startDate, endDate) => `Pomiędzy ${startDate} - ${endDate}`,
dateIsDisabled: 'Niedozwolona data',

previous: 'Poprzedni',
next: 'Dalej',
typeInDate: 'Wpisz datę',
pickDateFromCalendar: 'Wybierz datę z kalendarza',
close: 'Zamknij',
minute: 'Minuta',
hour: 'Godzina',
}
export default pl
2 changes: 2 additions & 0 deletions src/translations/pt.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,7 @@ const pt: TranslationsType = {
typeInDate: 'Digite a data',
pickDateFromCalendar: 'Escolha a data do calendário',
close: 'Fechar',
hour: 'Hora',
minute: 'Minuto',
}
export default pt
2 changes: 2 additions & 0 deletions src/translations/ro.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,7 @@ const ro: TranslationsType = {
typeInDate: 'Tipul în dată',
pickDateFromCalendar: 'Alege o dată din calendar',
close: 'Închide',
minute: 'Minut',
hour: 'Oră',
}
export default ro
2 changes: 2 additions & 0 deletions src/translations/ru.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,7 @@ const ru: TranslationsType = {
typeInDate: 'Ввод в дате',
pickDateFromCalendar: 'Выбор даты из календаря',
close: 'Закрыть',
hour: 'Час',
minute: 'Минута',
}
export default ru
2 changes: 2 additions & 0 deletions src/translations/tr.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,7 @@ const tr: TranslationsType = {
typeInDate: 'Tarihi yazın',
pickDateFromCalendar: 'Takvimden tarih seçin',
close: 'Kapat',
minute: 'Dakika',
hour: 'Saat',
}
export default tr
2 changes: 2 additions & 0 deletions src/translations/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ export type TranslationsType = {
typeInDate: string
pickDateFromCalendar: string
close: string
hour: string
minute: string
}

let translationsPerLocale: Record<string, TranslationsType> = {}
Expand Down
2 changes: 2 additions & 0 deletions src/translations/zh.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,7 @@ const zh: TranslationsType = {
typeInDate: '输入日期',
pickDateFromCalendar: '从日历中选择日期',
close: '关闭',
hour: '小时',
minute: '分钟',
}
export default zh
2 changes: 2 additions & 0 deletions src/translations/zhTW.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ const zhTW: TranslationsType = {
typeInDate: '輸入日期',
pickDateFromCalendar: '從日曆中選擇日期',
close: '關閉',
minute: '分鐘',
hour: '小時',
}

export default zhTW

0 comments on commit c61eae9

Please sign in to comment.