Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

localization | attribute 'locale' does not translate hidden label for day (@duetds/date-picker/custom-element) #122

Open
barburak opened this issue Apr 17, 2023 · 0 comments

Comments

@barburak
Copy link

barburak commented Apr 17, 2023

Describe the bug
I am using duetds custom element DuetDatePicker in our vanilla JavaScript based project. When I apply the localization settings, everything is translated into German accordingly, but only the "locale" attribute (value "de-DE" or "de-AT") does not translate the screen reader label for days in the calendar. I also tried other locales/languages, nothing seems to get translated - the english description stays.

image

I appreciate any help.

Here is an excerpt from our code:

import '@duetds/date-picker';
import {DuetDatePicker} from "@duetds/date-picker/custom-element";

...

setLocalization() {
    this.date.localization = {
      buttonLabel: i18n.get("buttonLabel"),
      placeholder: i18n.get("placeholder"),
      selectedDateMessage: i18n.get("selectedDateMessage"),
      prevMonthLabel: i18n.get("prevMonthLabel"),
      nextMonthLabel: i18n.get("nextMonthLabel"),
      monthSelectLabel: i18n.get("monthSelectLabel"),
      yearSelectLabel: i18n.get("yearSelectLabel"),
      closeLabel: i18n.get("closeLabel"),
      calendarHeading: i18n.get("calendarHeading"),
      dayNames: i18n.get("dayNames"),
      monthNames: i18n.get("monthNames"),
      monthNamesShort: i18n.get("monthNamesShort"),
      locale: i18n.get("locale"), // german locale does not work - issue: screen reader label for chosen date in calendar is still english 
    }
  }

(...) 

connectedCallback() {
 customElements.whenDefined("duet-date-picker")
      .then(() => {
       this.date = this.querySelector('duet-date-picker');
        setTimeout(() => {
          this.setDateAdapter();
          this.setLocalization();
        }, 0);
      });
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

1 participant