carbon-design-system / carbon

A design system built by IBM
https://www.carbondesignsystem.com
Apache License 2.0
7.6k stars 1.76k forks source link

[Bug]: DatePicker doesn't have translateWithId control to translate the tooltip text #16869

Open laxman-4656 opened 1 week ago

laxman-4656 commented 1 week ago

Package

@carbon/react

Browser

Chrome, Edge

Package version

v1.53.1

React version

v18.2.0

Description

DatePicker component doesn't have translateWithId property to translate the tooltip text, so it displays the tooltip message in default language(en) even after changing the locale language(ex: En to Fr), which is inappropriate. It would be helpful to translate the Required and other default validation messages if we have translateWithId property.

Reproduction/example

https://stackblitz.com/edit/github-xxqk6q?file=src%2FApp.jsx

Steps to reproduce

  1. Create a datePicker in french language(locale={'fr'}) and mark it as required

    image
  2. Select some date in the datePicker

  3. Now clear the field and then hover on the field, that will show a tooltip with required field validation message in english

    image
image

Suggested Severity

Severity 4 = Unrelated to a user task, has a workaround or does not need a workaround.

Application/PAL

No response

Code of Conduct

kglickman commented 1 week ago

I've seen this "Please fill out this field" tooltip with other fields as well.