fix(date-picker): locale-aware keyboard input parsing and i18n control labels

- Replace fixed-order date parser with locale-aware implementation
  using Intl.DateTimeFormat.formatToParts to detect field order;
  adds swap fallback for unambiguous inputs (day > 12) to handle
  locale mismatches gracefully
- Pre-fill keyboard input with locale-formatted numeric date
  (e.g. 14.06.2026) instead of raw ISO value
- Replace all hardcoded English aria-labels and titles with t()
  calls; add new keys under common.datepicker.* namespace across
  all locale files
- Update FE-COMP-DATEPICKER-013 to use unambiguous day value (> 12)
  to avoid locale-dependent test failures
This commit is contained in:
Gio Cettuzzi
2026-06-17 21:01:59 +02:00
committed by Maurice
parent 3011cf6c2f
commit 33fcbba414
21 changed files with 292 additions and 26 deletions
+12
View File
@@ -50,5 +50,17 @@ const common: TranslationStrings = {
'common.justNow': 'just now', // en-fallback
'common.hoursAgo': '{count}h ago', // en-fallback
'common.daysAgo': '{count}d ago', // en-fallback
'common.datepicker.prevMonth': 'Previous month', // en-fallback
'common.datepicker.nextMonth': 'Next month', // en-fallback
'common.datepicker.prevYear': 'Previous year', // en-fallback
'common.datepicker.nextYear': 'Next year', // en-fallback
'common.datepicker.prevYears': 'Previous years', // en-fallback
'common.datepicker.nextYears': 'Next years', // en-fallback
'common.datepicker.selectMonth': 'Select month', // en-fallback
'common.datepicker.selectYear': 'Select year', // en-fallback
'common.datepicker.enterManually': 'Enter date manually', // en-fallback
'common.datepicker.typeDate': 'Type a date', // en-fallback
'common.datepicker.dialog': 'Date picker', // en-fallback
'common.datepicker.clearDate': 'Clear date', // en-fallback
};
export default common;
+12
View File
@@ -50,5 +50,17 @@ const common: TranslationStrings = {
'common.justNow': 'agora mesmo',
'common.hoursAgo': 'há {count}h',
'common.daysAgo': 'há {count}d',
'common.datepicker.prevMonth': 'Previous month', // en-fallback
'common.datepicker.nextMonth': 'Next month', // en-fallback
'common.datepicker.prevYear': 'Previous year', // en-fallback
'common.datepicker.nextYear': 'Next year', // en-fallback
'common.datepicker.prevYears': 'Previous years', // en-fallback
'common.datepicker.nextYears': 'Next years', // en-fallback
'common.datepicker.selectMonth': 'Select month', // en-fallback
'common.datepicker.selectYear': 'Select year', // en-fallback
'common.datepicker.enterManually': 'Enter date manually', // en-fallback
'common.datepicker.typeDate': 'Type a date', // en-fallback
'common.datepicker.dialog': 'Date picker', // en-fallback
'common.datepicker.clearDate': 'Clear date', // en-fallback
};
export default common;
+12
View File
@@ -50,5 +50,17 @@ const common: TranslationStrings = {
'common.justNow': 'právě teď',
'common.hoursAgo': 'před {count} h',
'common.daysAgo': 'před {count} d',
'common.datepicker.prevMonth': 'Previous month', // en-fallback
'common.datepicker.nextMonth': 'Next month', // en-fallback
'common.datepicker.prevYear': 'Previous year', // en-fallback
'common.datepicker.nextYear': 'Next year', // en-fallback
'common.datepicker.prevYears': 'Previous years', // en-fallback
'common.datepicker.nextYears': 'Next years', // en-fallback
'common.datepicker.selectMonth': 'Select month', // en-fallback
'common.datepicker.selectYear': 'Select year', // en-fallback
'common.datepicker.enterManually': 'Enter date manually', // en-fallback
'common.datepicker.typeDate': 'Type a date', // en-fallback
'common.datepicker.dialog': 'Date picker', // en-fallback
'common.datepicker.clearDate': 'Clear date', // en-fallback
};
export default common;
+12
View File
@@ -50,5 +50,17 @@ const common: TranslationStrings = {
'common.reset': 'Zurücksetzen',
'common.copy': 'Kopieren',
'common.copied': 'Kopiert',
'common.datepicker.prevMonth': 'Vormonat',
'common.datepicker.nextMonth': 'Nächster Monat',
'common.datepicker.prevYear': 'Vorjahr',
'common.datepicker.nextYear': 'Nächstes Jahr',
'common.datepicker.prevYears': 'Vorherige Jahre',
'common.datepicker.nextYears': 'Nächste Jahre',
'common.datepicker.selectMonth': 'Monat auswählen',
'common.datepicker.selectYear': 'Jahr auswählen',
'common.datepicker.enterManually': 'Datum manuell eingeben',
'common.datepicker.typeDate': 'Datum eingeben',
'common.datepicker.dialog': 'Datumsauswahl',
'common.datepicker.clearDate': 'Datum löschen',
};
export default common;
+12
View File
@@ -50,5 +50,17 @@ const common: TranslationStrings = {
'common.collapse': 'Collapse',
'common.copy': 'Copy',
'common.copied': 'Copied',
'common.datepicker.prevMonth': 'Previous month',
'common.datepicker.nextMonth': 'Next month',
'common.datepicker.prevYear': 'Previous year',
'common.datepicker.nextYear': 'Next year',
'common.datepicker.prevYears': 'Previous years',
'common.datepicker.nextYears': 'Next years',
'common.datepicker.selectMonth': 'Select month',
'common.datepicker.selectYear': 'Select year',
'common.datepicker.enterManually': 'Enter date manually',
'common.datepicker.typeDate': 'Type a date',
'common.datepicker.dialog': 'Date picker',
'common.datepicker.clearDate': 'Clear date',
};
export default common;
+12
View File
@@ -50,5 +50,17 @@ const common: TranslationStrings = {
'common.justNow': 'justo ahora',
'common.hoursAgo': 'hace {count}h',
'common.daysAgo': 'hace {count}d',
'common.datepicker.prevMonth': 'Previous month', // en-fallback
'common.datepicker.nextMonth': 'Next month', // en-fallback
'common.datepicker.prevYear': 'Previous year', // en-fallback
'common.datepicker.nextYear': 'Next year', // en-fallback
'common.datepicker.prevYears': 'Previous years', // en-fallback
'common.datepicker.nextYears': 'Next years', // en-fallback
'common.datepicker.selectMonth': 'Select month', // en-fallback
'common.datepicker.selectYear': 'Select year', // en-fallback
'common.datepicker.enterManually': 'Enter date manually', // en-fallback
'common.datepicker.typeDate': 'Type a date', // en-fallback
'common.datepicker.dialog': 'Date picker', // en-fallback
'common.datepicker.clearDate': 'Clear date', // en-fallback
};
export default common;
+12
View File
@@ -50,5 +50,17 @@ const common: TranslationStrings = {
'common.justNow': "à l'instant",
'common.hoursAgo': 'il y a {count}h',
'common.daysAgo': 'il y a {count}j',
'common.datepicker.prevMonth': 'Previous month', // en-fallback
'common.datepicker.nextMonth': 'Next month', // en-fallback
'common.datepicker.prevYear': 'Previous year', // en-fallback
'common.datepicker.nextYear': 'Next year', // en-fallback
'common.datepicker.prevYears': 'Previous years', // en-fallback
'common.datepicker.nextYears': 'Next years', // en-fallback
'common.datepicker.selectMonth': 'Select month', // en-fallback
'common.datepicker.selectYear': 'Select year', // en-fallback
'common.datepicker.enterManually': 'Enter date manually', // en-fallback
'common.datepicker.typeDate': 'Type a date', // en-fallback
'common.datepicker.dialog': 'Date picker', // en-fallback
'common.datepicker.clearDate': 'Clear date', // en-fallback
};
export default common;
+12
View File
@@ -50,5 +50,17 @@ const common: TranslationStrings = {
'common.collapse': 'Σύμπτυξη',
'common.copy': 'Αντιγραφή',
'common.copied': 'Αντιγράφηκε',
'common.datepicker.prevMonth': 'Previous month', // en-fallback
'common.datepicker.nextMonth': 'Next month', // en-fallback
'common.datepicker.prevYear': 'Previous year', // en-fallback
'common.datepicker.nextYear': 'Next year', // en-fallback
'common.datepicker.prevYears': 'Previous years', // en-fallback
'common.datepicker.nextYears': 'Next years', // en-fallback
'common.datepicker.selectMonth': 'Select month', // en-fallback
'common.datepicker.selectYear': 'Select year', // en-fallback
'common.datepicker.enterManually': 'Enter date manually', // en-fallback
'common.datepicker.typeDate': 'Type a date', // en-fallback
'common.datepicker.dialog': 'Date picker', // en-fallback
'common.datepicker.clearDate': 'Clear date', // en-fallback
};
export default common;
+12
View File
@@ -50,5 +50,17 @@ const common: TranslationStrings = {
'common.justNow': 'az imént',
'common.hoursAgo': '{count} órája',
'common.daysAgo': '{count} napja',
'common.datepicker.prevMonth': 'Previous month', // en-fallback
'common.datepicker.nextMonth': 'Next month', // en-fallback
'common.datepicker.prevYear': 'Previous year', // en-fallback
'common.datepicker.nextYear': 'Next year', // en-fallback
'common.datepicker.prevYears': 'Previous years', // en-fallback
'common.datepicker.nextYears': 'Next years', // en-fallback
'common.datepicker.selectMonth': 'Select month', // en-fallback
'common.datepicker.selectYear': 'Select year', // en-fallback
'common.datepicker.enterManually': 'Enter date manually', // en-fallback
'common.datepicker.typeDate': 'Type a date', // en-fallback
'common.datepicker.dialog': 'Date picker', // en-fallback
'common.datepicker.clearDate': 'Clear date', // en-fallback
};
export default common;
+12
View File
@@ -50,5 +50,17 @@ const common: TranslationStrings = {
'common.collapse': 'Ciutkan',
'common.copy': 'Salin',
'common.copied': 'Disalin',
'common.datepicker.prevMonth': 'Previous month', // en-fallback
'common.datepicker.nextMonth': 'Next month', // en-fallback
'common.datepicker.prevYear': 'Previous year', // en-fallback
'common.datepicker.nextYear': 'Next year', // en-fallback
'common.datepicker.prevYears': 'Previous years', // en-fallback
'common.datepicker.nextYears': 'Next years', // en-fallback
'common.datepicker.selectMonth': 'Select month', // en-fallback
'common.datepicker.selectYear': 'Select year', // en-fallback
'common.datepicker.enterManually': 'Enter date manually', // en-fallback
'common.datepicker.typeDate': 'Type a date', // en-fallback
'common.datepicker.dialog': 'Date picker', // en-fallback
'common.datepicker.clearDate': 'Clear date', // en-fallback
};
export default common;
+12
View File
@@ -50,5 +50,17 @@ const common: TranslationStrings = {
'common.justNow': 'proprio ora',
'common.hoursAgo': '{count}h fa',
'common.daysAgo': '{count}g fa',
'common.datepicker.prevMonth': 'Mese precedente',
'common.datepicker.nextMonth': 'Mese prossimo',
'common.datepicker.prevYear': 'Anno precedente',
'common.datepicker.nextYear': 'Anno prossimo',
'common.datepicker.prevYears': 'Anni precedenti',
'common.datepicker.nextYears': 'Anni prossimi',
'common.datepicker.selectMonth': 'Seleziona mese',
'common.datepicker.selectYear': 'Seleziona anno',
'common.datepicker.enterManually': 'Inserisci la data manualmente',
'common.datepicker.typeDate': 'Inserisci una data',
'common.datepicker.dialog': 'Selettore di date',
'common.datepicker.clearDate': 'Cancella data',
};
export default common;
+12
View File
@@ -50,5 +50,17 @@ const common: TranslationStrings = {
'common.collapse': '접기',
'common.copy': '복사',
'common.copied': '복사됨',
'common.datepicker.prevMonth': 'Previous month', // en-fallback
'common.datepicker.nextMonth': 'Next month', // en-fallback
'common.datepicker.prevYear': 'Previous year', // en-fallback
'common.datepicker.nextYear': 'Next year', // en-fallback
'common.datepicker.prevYears': 'Previous years', // en-fallback
'common.datepicker.nextYears': 'Next years', // en-fallback
'common.datepicker.selectMonth': 'Select month', // en-fallback
'common.datepicker.selectYear': 'Select year', // en-fallback
'common.datepicker.enterManually': 'Enter date manually', // en-fallback
'common.datepicker.typeDate': 'Type a date', // en-fallback
'common.datepicker.dialog': 'Date picker', // en-fallback
'common.datepicker.clearDate': 'Clear date', // en-fallback
};
export default common;
+12
View File
@@ -50,5 +50,17 @@ const common: TranslationStrings = {
'common.justNow': 'zojuist',
'common.hoursAgo': '{count}u geleden',
'common.daysAgo': '{count}d geleden',
'common.datepicker.prevMonth': 'Previous month', // en-fallback
'common.datepicker.nextMonth': 'Next month', // en-fallback
'common.datepicker.prevYear': 'Previous year', // en-fallback
'common.datepicker.nextYear': 'Next year', // en-fallback
'common.datepicker.prevYears': 'Previous years', // en-fallback
'common.datepicker.nextYears': 'Next years', // en-fallback
'common.datepicker.selectMonth': 'Select month', // en-fallback
'common.datepicker.selectYear': 'Select year', // en-fallback
'common.datepicker.enterManually': 'Enter date manually', // en-fallback
'common.datepicker.typeDate': 'Type a date', // en-fallback
'common.datepicker.dialog': 'Date picker', // en-fallback
'common.datepicker.clearDate': 'Clear date', // en-fallback
};
export default common;
+12
View File
@@ -50,5 +50,17 @@ const common: TranslationStrings = {
'common.justNow': 'przed chwilą',
'common.hoursAgo': '{count} godz. temu',
'common.daysAgo': '{count} dn. temu',
'common.datepicker.prevMonth': 'Previous month', // en-fallback
'common.datepicker.nextMonth': 'Next month', // en-fallback
'common.datepicker.prevYear': 'Previous year', // en-fallback
'common.datepicker.nextYear': 'Next year', // en-fallback
'common.datepicker.prevYears': 'Previous years', // en-fallback
'common.datepicker.nextYears': 'Next years', // en-fallback
'common.datepicker.selectMonth': 'Select month', // en-fallback
'common.datepicker.selectYear': 'Select year', // en-fallback
'common.datepicker.enterManually': 'Enter date manually', // en-fallback
'common.datepicker.typeDate': 'Type a date', // en-fallback
'common.datepicker.dialog': 'Date picker', // en-fallback
'common.datepicker.clearDate': 'Clear date', // en-fallback
};
export default common;
+12
View File
@@ -50,5 +50,17 @@ const common: TranslationStrings = {
'common.justNow': 'только что',
'common.hoursAgo': '{count} ч назад',
'common.daysAgo': '{count} д назад',
'common.datepicker.prevMonth': 'Previous month', // en-fallback
'common.datepicker.nextMonth': 'Next month', // en-fallback
'common.datepicker.prevYear': 'Previous year', // en-fallback
'common.datepicker.nextYear': 'Next year', // en-fallback
'common.datepicker.prevYears': 'Previous years', // en-fallback
'common.datepicker.nextYears': 'Next years', // en-fallback
'common.datepicker.selectMonth': 'Select month', // en-fallback
'common.datepicker.selectYear': 'Select year', // en-fallback
'common.datepicker.enterManually': 'Enter date manually', // en-fallback
'common.datepicker.typeDate': 'Type a date', // en-fallback
'common.datepicker.dialog': 'Date picker', // en-fallback
'common.datepicker.clearDate': 'Clear date', // en-fallback
};
export default common;
+12
View File
@@ -50,5 +50,17 @@ const common: TranslationStrings = {
'common.collapse': 'Daralt',
'common.copy': 'Kopyala',
'common.copied': 'Kopyalandı',
'common.datepicker.prevMonth': 'Previous month', // en-fallback
'common.datepicker.nextMonth': 'Next month', // en-fallback
'common.datepicker.prevYear': 'Previous year', // en-fallback
'common.datepicker.nextYear': 'Next year', // en-fallback
'common.datepicker.prevYears': 'Previous years', // en-fallback
'common.datepicker.nextYears': 'Next years', // en-fallback
'common.datepicker.selectMonth': 'Select month', // en-fallback
'common.datepicker.selectYear': 'Select year', // en-fallback
'common.datepicker.enterManually': 'Enter date manually', // en-fallback
'common.datepicker.typeDate': 'Type a date', // en-fallback
'common.datepicker.dialog': 'Date picker', // en-fallback
'common.datepicker.clearDate': 'Clear date', // en-fallback
};
export default common;
+12
View File
@@ -50,5 +50,17 @@ const common: TranslationStrings = {
'common.justNow': 'щойно',
'common.hoursAgo': '{count} год. тому',
'common.daysAgo': '{count} дн. тому',
'common.datepicker.prevMonth': 'Previous month', // en-fallback
'common.datepicker.nextMonth': 'Next month', // en-fallback
'common.datepicker.prevYear': 'Previous year', // en-fallback
'common.datepicker.nextYear': 'Next year', // en-fallback
'common.datepicker.prevYears': 'Previous years', // en-fallback
'common.datepicker.nextYears': 'Next years', // en-fallback
'common.datepicker.selectMonth': 'Select month', // en-fallback
'common.datepicker.selectYear': 'Select year', // en-fallback
'common.datepicker.enterManually': 'Enter date manually', // en-fallback
'common.datepicker.typeDate': 'Type a date', // en-fallback
'common.datepicker.dialog': 'Date picker', // en-fallback
'common.datepicker.clearDate': 'Clear date', // en-fallback
};
export default common;
+12
View File
@@ -50,5 +50,17 @@ const common: TranslationStrings = {
'common.justNow': '剛剛',
'common.hoursAgo': '{count}小時前',
'common.daysAgo': '{count}天前',
'common.datepicker.prevMonth': 'Previous month', // en-fallback
'common.datepicker.nextMonth': 'Next month', // en-fallback
'common.datepicker.prevYear': 'Previous year', // en-fallback
'common.datepicker.nextYear': 'Next year', // en-fallback
'common.datepicker.prevYears': 'Previous years', // en-fallback
'common.datepicker.nextYears': 'Next years', // en-fallback
'common.datepicker.selectMonth': 'Select month', // en-fallback
'common.datepicker.selectYear': 'Select year', // en-fallback
'common.datepicker.enterManually': 'Enter date manually', // en-fallback
'common.datepicker.typeDate': 'Type a date', // en-fallback
'common.datepicker.dialog': 'Date picker', // en-fallback
'common.datepicker.clearDate': 'Clear date', // en-fallback
};
export default common;
+12
View File
@@ -50,5 +50,17 @@ const common: TranslationStrings = {
'common.justNow': '刚刚',
'common.hoursAgo': '{count}小时前',
'common.daysAgo': '{count}天前',
'common.datepicker.prevMonth': 'Previous month', // en-fallback
'common.datepicker.nextMonth': 'Next month', // en-fallback
'common.datepicker.prevYear': 'Previous year', // en-fallback
'common.datepicker.nextYear': 'Next year', // en-fallback
'common.datepicker.prevYears': 'Previous years', // en-fallback
'common.datepicker.nextYears': 'Next years', // en-fallback
'common.datepicker.selectMonth': 'Select month', // en-fallback
'common.datepicker.selectYear': 'Select year', // en-fallback
'common.datepicker.enterManually': 'Enter date manually', // en-fallback
'common.datepicker.typeDate': 'Type a date', // en-fallback
'common.datepicker.dialog': 'Date picker', // en-fallback
'common.datepicker.clearDate': 'Clear date', // en-fallback
};
export default common;