1

How to localize the DatePicker component of the DotNetBar to show a localized Calendar?

Even when changing the input language, it still shows the English calendar. What's the solution?

Racil Hilan
  • 24,690
  • 13
  • 50
  • 55
codec
  • 11
  • 3

1 Answers1

0

You just need to add handler for LocalizationKeys.LocalizeString static event.

Below is an example to localize the text for DateTimeInput control.

In your static void Main() method,

DevComponents.DotNetBar.LocalizationKeys.LocalizeString += new DotNetBarManager.LocalizeStringEventHandler(LocalizeString);

private static void LocalizeString(object sender, LocalizeEventArgs e)
    {
        if (e.Key == LocalizationKeys.MonthCalendarTodayButtonText)
        {
            e.LocalizedValue = Properties.Resources.MonthCalendarTodayButtonText;
        }
        if (e.Key == LocalizationKeys.MonthCalendarClearButtonText)
        {
            e.LocalizedValue = Properties.Resources.MonthCalendarClearButtonText;
        }

        e.Handled = true;
    }

You can refer to official docs here. http://www.devcomponents.com/kb2/?p=523

Johnny Qian
  • 668
  • 7
  • 14