Skip to content
This repository was archived by the owner on Sep 2, 2024. It is now read-only.
This repository was archived by the owner on Sep 2, 2024. It is now read-only.

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

Description

@barburak

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);
      });
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions