Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
35
WPF MonthCalendar localization
posted

Hello.

Is it possible to localize the MonthCalendar WPF Control ? How ?

I just want to see day's name in French,Dutch or English.

thanks.

Jean-Michel

  • 8607
    Offline posted

    Hello Jean-Michel,


    Has this issue been resolved?


    There are two ways to resolve this issue.  This forum post was created for our Japanese customers.  You can get the code from there, but here's the general idea.

    1. You can set the Language attribute of the default WPF Grid:

    <Grid Language="fr-FR">

    This is hardcoding and is not recommended.

    2. You can set the App.xaml.cs file to use the system's locale.  The System.Windows.Markup and System.Globalization references need to be included.

    public App()

            {

                FrameworkElement.LanguageProperty.OverrideMetadata(

                  typeof(FrameworkElement),

                  new FrameworkPropertyMetadata(XmlLanguage.GetLanguage(

    CultureInfo.CurrentCulture.IetfLanguageTag)));

            }

     

    This overrides the FrameworkElement's LanguageProperty to create an internationalized (language-neutral) application.

     

    Elizabeth Albert

    Localization Engineer

  • 54937
    Offline posted

    In WPF the FrameworkElement.LanguageProperty determines the Culture that bindings use and it is that property that determines the culture used to obtain the month and day of week names.