Skip to content

Commit

Permalink
Migrate clockLabelText
Browse files Browse the repository at this point in the history
  • Loading branch information
flaviendelangle committed Sep 6, 2024
1 parent fcb0c56 commit 14115d2
Show file tree
Hide file tree
Showing 37 changed files with 88 additions and 73 deletions.
7 changes: 6 additions & 1 deletion packages/x-date-pickers/src/TimeClock/Clock.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -370,7 +370,12 @@ export function Clock<TDate extends PickerValidDate>(inProps: ClockProps<TDate>)
)}
<ClockWrapper
aria-activedescendant={selectedId}
aria-label={translations.clockLabelText(type, value, utils)}
aria-label={translations.clockLabelText(
type,
value,
utils,
value == null ? null : utils.format(value, 'fullTime'),
)}
ref={listboxRef}
role="listbox"
onKeyDown={handleKeyDown}
Expand Down
4 changes: 2 additions & 2 deletions packages/x-date-pickers/src/locales/beBY.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@ const beBYPickers: Partial<PickersLocaleText<any>> = {
dateRangePickerToolbarTitle: 'Абраць каляндарны перыяд',

// Clock labels
clockLabelText: (view, time, adapter) =>
`Абярыце ${views[view]}. ${time === null ? 'Час не абраны' : `Абраны час ${adapter.format(time, 'fullTime')}`}`,
clockLabelText: (view, time, utils, formattedTime) =>
`Абярыце ${views[view]}. ${!formattedTime && (time === null || !utils.isValid(time)) ? 'Час не абраны' : `Абраны час ${formattedTime ?? utils.format(time, 'fullTime')}`}`,
hoursClockNumberText: (hours) => `${hours} гадзін`,
minutesClockNumberText: (minutes) => `${minutes} хвілін`,
secondsClockNumberText: (seconds) => `${seconds} секунд`,
Expand Down
4 changes: 2 additions & 2 deletions packages/x-date-pickers/src/locales/caES.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,8 @@ const caESPickers: Partial<PickersLocaleText<any>> = {
dateRangePickerToolbarTitle: 'Seleccionar rang de dates',

// Clock labels
clockLabelText: (view, time, adapter) =>
`Selecciona ${views[view]}. ${time === null ? 'Hora no seleccionada' : `L'hora seleccionada és ${adapter.format(time, 'fullTime')}`}`,
clockLabelText: (view, time, utils, formattedTime) =>
`Selecciona ${views[view]}. ${!formattedTime && (time === null || !utils.isValid(time)) ? 'Hora no seleccionada' : `L'hora seleccionada és ${formattedTime ?? utils.format(time, 'fullTime')}`}`,
hoursClockNumberText: (hours) => `${hours} hores`,
minutesClockNumberText: (minutes) => `${minutes} minuts`,
secondsClockNumberText: (seconds) => `${seconds} segons`,
Expand Down
4 changes: 2 additions & 2 deletions packages/x-date-pickers/src/locales/csCZ.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@ const csCZPickers: Partial<PickersLocaleText<any>> = {
dateRangePickerToolbarTitle: 'Vyberete rozmezí dat',

// Clock labels
clockLabelText: (view, time, adapter) =>
`${timeViews[view] ?? view} vybrány. ${time === null ? 'Není vybrán čas' : `Vybraný čas je ${adapter.format(time, 'fullTime')}`}`,
clockLabelText: (view, time, utils, formattedTime) =>
`${timeViews[view] ?? view} vybrány. ${!formattedTime && (time === null || !utils.isValid(time)) ? 'Není vybrán čas' : `Vybraný čas je ${formattedTime ?? utils.format(time, 'fullTime')}`}`,
hoursClockNumberText: (hours) => `${hours} hodin`,
minutesClockNumberText: (minutes) => `${minutes} minut`,
secondsClockNumberText: (seconds) => `${seconds} sekund`,
Expand Down
4 changes: 2 additions & 2 deletions packages/x-date-pickers/src/locales/daDK.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@ const daDKPickers: Partial<PickersLocaleText<any>> = {
dateRangePickerToolbarTitle: 'Vælg datointerval',

// Clock labels
clockLabelText: (view, time, adapter) =>
`Vælg ${timeViews[view] ?? view}. ${time === null ? 'Intet tidspunkt valgt' : `Valgte tidspunkt er ${adapter.format(time, 'fullTime')}`}`,
clockLabelText: (view, time, utils, formattedTime) =>
`Vælg ${timeViews[view] ?? view}. ${!formattedTime && (time === null || !utils.isValid(time)) ? 'Intet tidspunkt valgt' : `Valgte tidspunkt er ${formattedTime ?? utils.format(time, 'fullTime')}`}`,
hoursClockNumberText: (hours) => `${hours} timer`,
minutesClockNumberText: (minutes) => `${minutes} minutter`,
secondsClockNumberText: (seconds) => `${seconds} sekunder`,
Expand Down
4 changes: 2 additions & 2 deletions packages/x-date-pickers/src/locales/deDE.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@ const deDEPickers: Partial<PickersLocaleText<any>> = {
dateRangePickerToolbarTitle: 'Datumsbereich auswählen',

// Clock labels
clockLabelText: (view, time, adapter) =>
`${timeViews[view] ?? view} auswählen. ${time === null ? 'Keine Uhrzeit ausgewählt' : `Gewählte Uhrzeit ist ${adapter.format(time, 'fullTime')}`}`,
clockLabelText: (view, time, utils, formattedTime) =>
`${timeViews[view] ?? view} auswählen. ${!formattedTime && (time === null || !utils.isValid(time)) ? 'Keine Uhrzeit ausgewählt' : `Gewählte Uhrzeit ist ${formattedTime ?? utils.format(time, 'fullTime')}`}`,
hoursClockNumberText: (hours) => `${hours} ${timeViews.hours}`,
minutesClockNumberText: (minutes) => `${minutes} ${timeViews.minutes}`,
secondsClockNumberText: (seconds) => `${seconds} ${timeViews.seconds}`,
Expand Down
4 changes: 2 additions & 2 deletions packages/x-date-pickers/src/locales/elGR.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,8 @@ const elGRPickers: Partial<PickersLocaleText<any>> = {
dateRangePickerToolbarTitle: 'Επιλέξτε εύρος ημερομηνιών',

// Clock labels
clockLabelText: (view, time, adapter) =>
`Επιλέξτε ${views[view]}. ${time === null ? 'Δεν έχει επιλεγεί ώρα' : `Η επιλεγμένη ώρα είναι ${adapter.format(time, 'fullTime')}`}`,
clockLabelText: (view, time, utils, formattedTime) =>
`Επιλέξτε ${views[view]}. ${!formattedTime && (time === null || !utils.isValid(time)) ? 'Δεν έχει επιλεγεί ώρα' : `Η επιλεγμένη ώρα είναι ${formattedTime ?? utils.format(time, 'fullTime')}`}`,
hoursClockNumberText: (hours) => `${hours} ώρες`,
minutesClockNumberText: (minutes) => `${minutes} λεπτά`,
secondsClockNumberText: (seconds) => `${seconds} δευτερόλεπτα`,
Expand Down
6 changes: 4 additions & 2 deletions packages/x-date-pickers/src/locales/enUS.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,11 @@ const enUSPickers: PickersLocaleText<any> = {
dateRangePickerToolbarTitle: 'Select date range',

// Clock labels
clockLabelText: (view, time, adapter) =>
clockLabelText: (view, time, utils, formattedTime) =>
`Select ${view}. ${
time === null ? 'No time selected' : `Selected time is ${adapter.format(time, 'fullTime')}`
!formattedTime && (time === null || !utils.isValid(time))
? 'No time selected'
: `Selected time is ${formattedTime ?? utils.format(time, 'fullTime')}`
}`,
hoursClockNumberText: (hours) => `${hours} hours`,
minutesClockNumberText: (minutes) => `${minutes} minutes`,
Expand Down
4 changes: 2 additions & 2 deletions packages/x-date-pickers/src/locales/esES.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,8 @@ const esESPickers: Partial<PickersLocaleText<any>> = {
dateRangePickerToolbarTitle: 'Seleccionar rango de fecha',

// Clock labels
clockLabelText: (view, time, adapter) =>
`Seleccione ${views[view]}. ${time === null ? 'No hay hora seleccionada' : `La hora seleccionada es ${adapter.format(time, 'fullTime')}`}`,
clockLabelText: (view, time, utils, formattedTime) =>
`Seleccione ${views[view]}. ${!formattedTime && (time === null || !utils.isValid(time)) ? 'No hay hora seleccionada' : `La hora seleccionada es ${formattedTime ?? utils.format(time, 'fullTime')}`}`,
hoursClockNumberText: (hours) => `${hours} horas`,
minutesClockNumberText: (minutes) => `${minutes} minutos`,
secondsClockNumberText: (seconds) => `${seconds} segundos`,
Expand Down
4 changes: 2 additions & 2 deletions packages/x-date-pickers/src/locales/eu.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,8 @@ const euPickers: Partial<PickersLocaleText<any>> = {
dateRangePickerToolbarTitle: 'Data tartea aukeratu',

// Clock labels
clockLabelText: (view, time, adapter) =>
`Aukeratu ${views[view]}. ${time === null ? 'Ez da ordurik aukertau' : `Aukeratutako ordua ${adapter.format(time, 'fullTime')} da`}`,
clockLabelText: (view, time, utils, formattedTime) =>
`Aukeratu ${views[view]}. ${!formattedTime && (time === null || !utils.isValid(time)) ? 'Ez da ordurik aukertau' : `Aukeratutako ordua ${formattedTime ?? utils.format(time, 'fullTime')} da`}`,
hoursClockNumberText: (hours) => `${hours} ordu`,
minutesClockNumberText: (minutes) => `${minutes} minutu`,
secondsClockNumberText: (seconds) => `${seconds} segundu`,
Expand Down
4 changes: 2 additions & 2 deletions packages/x-date-pickers/src/locales/faIR.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,8 @@ const faIRPickers: Partial<PickersLocaleText<any>> = {
dateRangePickerToolbarTitle: 'محدوده تاریخ را انتخاب کنید',

// Clock labels
clockLabelText: (view, time, adapter) =>
` را انتخاب کنید ${timeViews[view]}. ${time === null ? 'هیچ ساعتی انتخاب نشده است' : `ساعت انتخاب ${adapter.format(time, 'fullTime')} می باشد`}`,
clockLabelText: (view, time, utils, formattedTime) =>
` را انتخاب کنید ${timeViews[view]}. ${!formattedTime && (time === null || !utils.isValid(time)) ? 'هیچ ساعتی انتخاب نشده است' : `ساعت انتخاب ${formattedTime ?? utils.format(time, 'fullTime')} می باشد`}`,
hoursClockNumberText: (hours) => `${hours} ساعت‌ها`,
minutesClockNumberText: (minutes) => `${minutes} دقیقه‌ها`,
secondsClockNumberText: (seconds) => `${seconds} ثانیه‌ها`,
Expand Down
4 changes: 2 additions & 2 deletions packages/x-date-pickers/src/locales/fiFI.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,8 @@ const fiFIPickers: Partial<PickersLocaleText<any>> = {
dateRangePickerToolbarTitle: 'Valitse aikaväli',

// Clock labels
clockLabelText: (view, time, adapter) =>
`Valitse ${views[view]}. ${time === null ? 'Ei aikaa valittuna' : `Valittu aika on ${adapter.format(time, 'fullTime')}`}`,
clockLabelText: (view, time, utils, formattedTime) =>
`Valitse ${views[view]}. ${!formattedTime && (time === null || !utils.isValid(time)) ? 'Ei aikaa valittuna' : `Valittu aika on ${formattedTime ?? utils.format(time, 'fullTime')}`}`,
hoursClockNumberText: (hours) => `${hours} tuntia`,
minutesClockNumberText: (minutes) => `${minutes} minuuttia`,
secondsClockNumberText: (seconds) => `${seconds} sekuntia`,
Expand Down
6 changes: 3 additions & 3 deletions packages/x-date-pickers/src/locales/frFR.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,8 @@ const frFRPickers: Partial<PickersLocaleText<any>> = {
dateRangePickerToolbarTitle: 'Choisir la plage de dates',

// Clock labels
clockLabelText: (view, time, adapter) =>
`Choix des ${views[view]}. ${time === null ? 'Aucune heure choisie' : `L'heure choisie est ${adapter.format(time, 'fullTime')}`}`,
clockLabelText: (view, time, utils, formattedTime) =>
`Choix des ${views[view]}. ${!formattedTime && (time === null || !utils.isValid(time)) ? 'Aucune heure choisie' : `L'heure choisie est ${formattedTime ?? utils.format(time, 'fullTime')}`}`,
hoursClockNumberText: (hours) => `${hours} heures`,
minutesClockNumberText: (minutes) => `${minutes} minutes`,
secondsClockNumberText: (seconds) => `${seconds} secondes`,
Expand All @@ -63,7 +63,7 @@ const frFRPickers: Partial<PickersLocaleText<any>> = {
formattedDate || (value !== null && utils.isValid(value))
? `Choisir la date, la date sélectionnée est ${formattedDate ?? utils.format(value, 'fullDate')}`
: 'Choisir la date',
openTimePickerDialogue: (value, formattedTime) =>
openTimePickerDialogue: (value, utils, formattedTime) =>
formattedTime
? `Choisir l'heure, l'heure sélectionnée est ${formattedTime ?? utils.format(value, 'fullTime')}`
: "Choisir l'heure",
Expand Down
4 changes: 2 additions & 2 deletions packages/x-date-pickers/src/locales/heIL.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,8 @@ const heILPickers: Partial<PickersLocaleText<any>> = {
dateRangePickerToolbarTitle: 'בחירת טווח תאריכים',

// Clock labels
clockLabelText: (view, time, adapter) =>
`בחירת ${views[view]}. ${time === null ? 'לא נבחרה שעה' : `השעה הנבחרת היא ${adapter.format(time, 'fullTime')}`}`,
clockLabelText: (view, time, utils, formattedTime) =>
`בחירת ${views[view]}. ${!formattedTime && (time === null || !utils.isValid(time)) ? 'לא נבחרה שעה' : `השעה הנבחרת היא ${formattedTime ?? utils.format(time, 'fullTime')}`}`,
hoursClockNumberText: (hours) => `${hours} שעות`,
minutesClockNumberText: (minutes) => `${minutes} דקות`,
secondsClockNumberText: (seconds) => `${seconds} שניות`,
Expand Down
4 changes: 2 additions & 2 deletions packages/x-date-pickers/src/locales/huHU.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@ const huHUPickers: Partial<PickersLocaleText<any>> = {
dateRangePickerToolbarTitle: 'Dátumhatárok kiválasztása',

// Clock labels
clockLabelText: (view, time, adapter) =>
`${timeViews[view] ?? view} kiválasztása. ${time === null ? 'Nincs kiválasztva idő' : `A kiválasztott idő ${adapter.format(time, 'fullTime')}`}`,
clockLabelText: (view, time, utils, formattedTime) =>
`${timeViews[view] ?? view} kiválasztása. ${!formattedTime && (time === null || !utils.isValid(time)) ? 'Nincs kiválasztva idő' : `A kiválasztott idő ${formattedTime ?? utils.format(time, 'fullTime')}`}`,
hoursClockNumberText: (hours) => `${hours} ${timeViews.hours.toLowerCase()}`,
minutesClockNumberText: (minutes) => `${minutes} ${timeViews.minutes.toLowerCase()}`,
secondsClockNumberText: (seconds) => `${seconds} ${timeViews.seconds.toLowerCase()}`,
Expand Down
4 changes: 2 additions & 2 deletions packages/x-date-pickers/src/locales/isIS.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,8 @@ const isISPickers: Partial<PickersLocaleText<any>> = {
dateRangePickerToolbarTitle: 'Velja tímabil',

// Clock labels
clockLabelText: (view, time, adapter) =>
`Velja ${timeViews[view]}. ${time === null ? 'Enginn tími valinn' : `Valinn tími er ${adapter.format(time, 'fullTime')}`}`,
clockLabelText: (view, time, utils, formattedTime) =>
`Velja ${timeViews[view]}. ${!formattedTime && (time === null || !utils.isValid(time)) ? 'Enginn tími valinn' : `Valinn tími er ${formattedTime ?? utils.format(time, 'fullTime')}`}`,
hoursClockNumberText: (hours) => `${hours} klukkustundir`,
minutesClockNumberText: (minutes) => `${minutes} mínútur`,
secondsClockNumberText: (seconds) => `${seconds} sekúndur`,
Expand Down
4 changes: 2 additions & 2 deletions packages/x-date-pickers/src/locales/itIT.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,8 @@ const itITPickers: Partial<PickersLocaleText<any>> = {
dateRangePickerToolbarTitle: 'Seleziona intervallo di date',

// Clock labels
clockLabelText: (view, time, adapter) =>
`Seleziona ${views[view]}. ${time === null ? 'Nessun orario selezionato' : `L'ora selezionata è ${adapter.format(time, 'fullTime')}`}`,
clockLabelText: (view, time, utils, formattedTime) =>
`Seleziona ${views[view]}. ${!formattedTime && (time === null || !utils.isValid(time)) ? 'Nessun orario selezionato' : `L'ora selezionata è ${formattedTime ?? utils.format(time, 'fullTime')}`}`,
hoursClockNumberText: (hours) => `${hours} ore`,
minutesClockNumberText: (minutes) => `${minutes} minuti`,
secondsClockNumberText: (seconds) => `${seconds} secondi`,
Expand Down
4 changes: 2 additions & 2 deletions packages/x-date-pickers/src/locales/jaJP.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@ const jaJPPickers: Partial<PickersLocaleText<any>> = {
dateRangePickerToolbarTitle: '日付の範囲を選択',

// Clock labels
clockLabelText: (view, time, adapter) =>
`${timeViews[view] ?? view}を選択してください ${time === null ? '時間が選択されていません' : `選択した時間は ${adapter.format(time, 'fullTime')} です`}`,
clockLabelText: (view, time, utils, formattedTime) =>
`${timeViews[view] ?? view}を選択してください ${!formattedTime && (time === null || !utils.isValid(time)) ? '時間が選択されていません' : `選択した時間は ${formattedTime ?? utils.format(time, 'fullTime')} です`}`,
hoursClockNumberText: (hours) => `${hours} ${timeViews.hours}`,
minutesClockNumberText: (minutes) => `${minutes} ${timeViews.minutes}`,
secondsClockNumberText: (seconds) => `${seconds} ${timeViews.seconds}`,
Expand Down
4 changes: 2 additions & 2 deletions packages/x-date-pickers/src/locales/koKR.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,8 @@ const koKRPickers: Partial<PickersLocaleText<any>> = {
dateRangePickerToolbarTitle: '날짜 범위 선택하기',

// Clock labels
clockLabelText: (view, time, adapter) =>
`${views[view]} 선택하세요. ${time === null ? '시간을 선택하지 않았습니다.' : `현재 선택된 시간은 ${adapter.format(time, 'fullTime')}입니다.`}`,
clockLabelText: (view, time, utils, formattedTime) =>
`${views[view]} 선택하세요. ${!formattedTime && (time === null || !utils.isValid(time)) ? '시간을 선택하지 않았습니다.' : `현재 선택된 시간은 ${formattedTime ?? utils.format(time, 'fullTime')}입니다.`}`,
hoursClockNumberText: (hours) => `${hours}시`,
minutesClockNumberText: (minutes) => `${minutes}분`,
secondsClockNumberText: (seconds) => `${seconds}초`,
Expand Down
4 changes: 2 additions & 2 deletions packages/x-date-pickers/src/locales/kzKZ.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@ const kzKZPickers: Partial<PickersLocaleText<any>> = {
dateRangePickerToolbarTitle: 'Кезеңді таңдаңыз',

// Clock labels
clockLabelText: (view, time, adapter) =>
`${timeViews[view]} таңдау. ${time === null ? 'Уақыт таңдалмаған' : `Таңдалған уақыт ${adapter.format(time, 'fullTime')}`}`,
clockLabelText: (view, time, utils, formattedTime) =>
`${timeViews[view]} таңдау. ${!formattedTime && (time === null || !utils.isValid(time)) ? 'Уақыт таңдалмаған' : `Таңдалған уақыт ${formattedTime ?? utils.format(time, 'fullTime')}`}`,
hoursClockNumberText: (hours) => `${hours} сағат`,
minutesClockNumberText: (minutes) => `${minutes} минут`,
secondsClockNumberText: (seconds) => `${seconds} секунд`,
Expand Down
4 changes: 2 additions & 2 deletions packages/x-date-pickers/src/locales/mk.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@ const mkPickers: Partial<PickersLocaleText<any>> = {
dateRangePickerToolbarTitle: 'Избери временски опсег',

// Clock labels
clockLabelText: (view, time, adapter) =>
`Select ${view}. ${time === null ? 'Нема избрано време' : `Избраното време е ${adapter.format(time, 'fullTime')}`}`,
clockLabelText: (view, time, utils, formattedTime) =>
`Select ${view}. ${!formattedTime && (time === null || !utils.isValid(time)) ? 'Нема избрано време' : `Избраното време е ${formattedTime ?? utils.format(time, 'fullTime')}`}`,
hoursClockNumberText: (hours) => `${hours} часа`,
minutesClockNumberText: (minutes) => `${minutes} минути`,
secondsClockNumberText: (seconds) => `${seconds} секунди`,
Expand Down
4 changes: 2 additions & 2 deletions packages/x-date-pickers/src/locales/nbNO.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,8 @@ const nbNOPickers: Partial<PickersLocaleText<any>> = {
dateRangePickerToolbarTitle: 'Velg datoperiode',

// Clock labels
clockLabelText: (view, time, adapter) =>
`Velg ${timeViews[view]}. ${time === null ? 'Ingen tid valgt' : `Valgt tid er ${adapter.format(time, 'fullTime')}`}`,
clockLabelText: (view, time, utils, formattedTime) =>
`Velg ${timeViews[view]}. ${!formattedTime && (time === null || !utils.isValid(time)) ? 'Ingen tid valgt' : `Valgt tid er ${formattedTime ?? utils.format(time, 'fullTime')}`}`,
hoursClockNumberText: (hours) => `${hours} timer`,
minutesClockNumberText: (minutes) => `${minutes} minutter`,
secondsClockNumberText: (seconds) => `${seconds} sekunder`,
Expand Down
4 changes: 2 additions & 2 deletions packages/x-date-pickers/src/locales/nlNL.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,8 @@ const nlNLPickers: Partial<PickersLocaleText<any>> = {
dateRangePickerToolbarTitle: 'Selecteer datumbereik',

// Clock labels
clockLabelText: (view, time, adapter) =>
`Selecteer ${timeViews[view]}. ${time === null ? 'Geen tijd geselecteerd' : `Geselecteerde tijd is ${adapter.format(time, 'fullTime')}`}`,
clockLabelText: (view, time, utils, formattedTime) =>
`Selecteer ${timeViews[view]}. ${!formattedTime && (time === null || !utils.isValid(time)) ? 'Geen tijd geselecteerd' : `Geselecteerde tijd is ${formattedTime ?? utils.format(time, 'fullTime')}`}`,
hoursClockNumberText: (hours) => `${hours} uren`,
minutesClockNumberText: (minutes) => `${minutes} minuten`,
secondsClockNumberText: (seconds) => `${seconds} seconden`,
Expand Down
4 changes: 2 additions & 2 deletions packages/x-date-pickers/src/locales/nnNO.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,8 @@ const nnNOPickers: Partial<PickersLocaleText<any>> = {
dateRangePickerToolbarTitle: 'Vel datoperiode',

// Clock labels
clockLabelText: (view, time, adapter) =>
`Vel ${timeViews[view]}. ${time === null ? 'Ingen tid vald' : `Vald tid er ${adapter.format(time, 'fullTime')}`}`,
clockLabelText: (view, time, utils, formattedTime) =>
`Vel ${timeViews[view]}. ${!formattedTime && (time === null || !utils.isValid(time)) ? 'Ingen tid vald' : `Vald tid er ${formattedTime ?? utils.format(time, 'fullTime')}`}`,
hoursClockNumberText: (hours) => `${hours} timar`,
minutesClockNumberText: (minutes) => `${minutes} minuttar`,
secondsClockNumberText: (seconds) => `${seconds} sekundar`,
Expand Down
4 changes: 2 additions & 2 deletions packages/x-date-pickers/src/locales/plPL.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,8 @@ const plPLPickers: Partial<PickersLocaleText<any>> = {
dateRangePickerToolbarTitle: 'Wybierz zakres dat',

// Clock labels
clockLabelText: (view, time, adapter) =>
`Wybierz ${timeViews[view]}. ${time === null ? 'Nie wybrano czasu' : `Wybrany czas to ${adapter.format(time, 'fullTime')}`}`,
clockLabelText: (view, time, utils, formattedTime) =>
`Wybierz ${timeViews[view]}. ${!formattedTime && (time === null || !utils.isValid(time)) ? 'Nie wybrano czasu' : `Wybrany czas to ${formattedTime ?? utils.format(time, 'fullTime')}`}`,
hoursClockNumberText: (hours) => `${hours} godzin`,
minutesClockNumberText: (minutes) => `${minutes} minut`,
secondsClockNumberText: (seconds) => `${seconds} sekund`,
Expand Down
Loading

0 comments on commit 14115d2

Please sign in to comment.