Describe the Bug
In packages/genui/lib/src/catalog/basic_catalog_widgets/date_time_input.dart, lines 241-250:
String _getPlaceholderText() {
if (widget.data.enableDate && widget.data.enableTime) {
return 'Select a date and time';
} else if (widget.data.enableDate) {
return 'Select a date';
} else if (widget.data.enableTime) {
return 'Select a time';
}
return 'Select a date/time';
}
When DateTimeInput has no value set, it displays placeholder text derived from _getPlaceholderText(). These strings are hardcoded English literals and do not route through MaterialLocalizations or any localization mechanism.
In non-English locales (e.g. Spanish, German, French, Japanese, Arabic, RTL pseudolocales), the input field correctly formats numbers or dates once selected, but initially renders the literal English string "Select a date" or "Select a time". In RTL locales, the placeholder is aligned to the right edge but still displays English ASCII characters.
Steps to Reproduce
- Render a
DateTimeInput with no value property in a Flutter app configured with a non-English locale (e.g. Locale('es') or Locale('ar')).
- Inspect the placeholder text inside the
InputDecorator.
- Observe English text
"Select a date" instead of localized text.
Expected Behavior
Placeholder text should be localized:
- Provide localized fallback strings via a
genui localization bundle or MaterialLocalizations.
- Alternatively (or additionally), allow an optional
placeholder string in the component schema so the generating agent can supply appropriate localized placeholder text.
Screenshots
Environment Details
- SDK/Package Name & Version:
package:genui (packages/genui/lib/src/catalog/basic_catalog_widgets/date_time_input.dart)
- Protocol Version: v0.9.1
Describe the Bug
In
packages/genui/lib/src/catalog/basic_catalog_widgets/date_time_input.dart, lines 241-250:When
DateTimeInputhas no value set, it displays placeholder text derived from_getPlaceholderText(). These strings are hardcoded English literals and do not route throughMaterialLocalizationsor any localization mechanism.In non-English locales (e.g. Spanish, German, French, Japanese, Arabic, RTL pseudolocales), the input field correctly formats numbers or dates once selected, but initially renders the literal English string
"Select a date"or"Select a time". In RTL locales, the placeholder is aligned to the right edge but still displays English ASCII characters.Steps to Reproduce
DateTimeInputwith novalueproperty in a Flutter app configured with a non-English locale (e.g.Locale('es')orLocale('ar')).InputDecorator."Select a date"instead of localized text.Expected Behavior
Placeholder text should be localized:
genuilocalization bundle orMaterialLocalizations.placeholderstring in the component schema so the generating agent can supply appropriate localized placeholder text.Screenshots
Environment Details
package:genui(packages/genui/lib/src/catalog/basic_catalog_widgets/date_time_input.dart)