Translate the alt-date and alt-datetime part names (year, month, day, …)

Author: heath-freenomeCreated Sep 26, 2026Updated Oct 1, 2026
Labelsfeature

Prerequisites

What theme are you using?

core (and every theme built on DateElement, plus @rjsf/mantine and @rjsf/daisyui)

Is your feature request related to a problem? Please describe.

AltDateWidget and AltDateTimeWidget show the name of each date part (year, month, day, hour, minute, second) as the raw DateElementProp.type string. It can't be translated through translateString, so a localized form still shows and announces English part names.

  • @rjsf/utils: the shared DateElement in useAltDateWidgetProps.tsx renders placeholder={type}. Core and every theme that uses it inherit this.
  • @rjsf/mantine: since #5354, each part's Select uses part.type as its aria-label. That names the part, e.g. "Geburtstag year", and its listbox, so the English word is now in the announced name, not just the placeholder.

TranslatableString has no entries for these words; the widgets' only strings are NowLabel and ClearLabel.

Describe the solution you'd like

  1. Add TranslatableString entries for the six part names, e.g. YearLabel: 'year', MonthLabel: 'month', DayLabel: 'day', HourLabel: 'hour', MinuteLabel: 'minute', SecondLabel: 'second'. The default strings stay the same, so English output doesn't change.
  2. Map a DateElementProp.type to its TranslatableString in one helper in @rjsf/utils (or have getDateElementProps return the translated label next to type), so no theme maps them itself.
  3. Use the translated label wherever a part name is shown or announced:
    • the placeholder in DateElement (@rjsf/utils);
    • placeholder and aria-label in @rjsf/mantine's AltDatePart;
    • the part widgets any other theme renders for itself (check each theme's AltDateWidget, e.g. @rjsf/daisyui's visible per-part labels).
  4. Add the new keys to the translation docs, and to any locale files the repo ships.

Acceptance criteria

  • With a translateString that maps the new keys, every alt-date and alt-datetime part shows the translated placeholder, in core and in every theme.
  • In @rjsf/mantine, each part's accessible name is <field label> <translated part>, and its listbox's aria-label is the translated part.
  • With no custom translateString, output is unchanged, and no snapshot changes.
  • The new tests fail without the translation (mutation-checked).

Describe alternatives you've considered

Doing this as part of #5355, which names each part by the field title in every theme and already suggests running the per-part label through translateString. It is kept separate because the translation keys are useful on their own (the visible placeholders are untranslated today), and #5354 already names the Mantine parts without them.

Source: rjsf-team/react-jsonschema-form