Skip to content

Commit

Permalink
feat: use translation for hour and minute label
Browse files Browse the repository at this point in the history
  • Loading branch information
Willian Monoga committed Dec 7, 2023
1 parent 1ee956e commit 0d711c4
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 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

0 comments on commit 0d711c4

Please sign in to comment.