Skip to content

[BUG] [genui] DateTimeInput placeholder text is hardcoded English and lacks localization #2835

Description

@Jungliana
  • I have searched the existing issues to make sure this bug has not already been reported.

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

  1. Render a DateTimeInput with no value property in a Flutter app configured with a non-English locale (e.g. Locale('es') or Locale('ar')).
  2. Inspect the placeholder text inside the InputDecorator.
  3. Observe English text "Select a date" instead of localized text.

Expected Behavior

Placeholder text should be localized:

  1. Provide localized fallback strings via a genui localization bundle or MaterialLocalizations.
  2. Alternatively (or additionally), allow an optional placeholder string in the component schema so the generating agent can supply appropriate localized placeholder text.

Screenshots

Image

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

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    • Status
      Todo

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions