Custom localization manager week days and months name string

10 posts, 1 answers
  1. Mateusz
    Mateusz avatar
    14 posts
    Member since:
    Dec 2017

    Posted 10 Jan 2018 Link to this post

    Hi,

    I'm creating a custom localization manager, because my Culture is not supported and my client want to have everything in native language. LocalizationManager with 

     

    public override string GetStringOverride(string key)
            {
                switch (key)
                {
                }
     
             return base.GetStringOverride(key);
             }

     

    is a great and simple tool to use. But I need some keys, which are not mentioned in telerik documentation. Currently I need those for week days and month names. Can you provide them please?

     

    Best regards

  2. Mateusz
    Mateusz avatar
    14 posts
    Member since:
    Dec 2017

    Posted 10 Jan 2018 in reply to Mateusz Link to this post

    It actually gets value from windows. Well, it's ok, but I still kinda want to know how to replace them :)
  3. Dinko
    Admin
    Dinko avatar
    914 posts

    Posted 15 Jan 2018 Link to this post

    Hello Mateusz,

    To change the mentioned strings you can set the Culture property of the RadDateTimePicker. Check the following code snippet.
    public MainWindow()
        InitializeComponent();
        this.datePicker.Culture = new System.Globalization.CultureInfo("fr-FR");
    }

    Regards,
    Dinko
    Progress Telerik
    Want to extend the target reach of your WPF applications, leveraging iOS, Android, and UWP? Try UI for Xamarin, a suite of polished and feature-rich components for the Xamarin framework, which allow you to write beautiful native mobile apps using a single shared C# codebase.
  4. Mateusz
    Mateusz avatar
    14 posts
    Member since:
    Dec 2017

    Posted 17 Jan 2018 in reply to Dinko Link to this post

    Eh,

    I will quote myself with bold now:

     

    my Culture is not supported(...)

     

     

  5. Dinko
    Admin
    Dinko avatar
    914 posts

    Posted 19 Jan 2018 Link to this post

    Hi Mateusz,

    You can take a look at this MSDN help article which describes the supported cultures.

    Regards,
    Dinko
    Progress Telerik
    Want to extend the target reach of your WPF applications, leveraging iOS, Android, and UWP? Try UI for Xamarin, a suite of polished and feature-rich components for the Xamarin framework, which allow you to write beautiful native mobile apps using a single shared C# codebase.
  6. Mateusz
    Mateusz avatar
    14 posts
    Member since:
    Dec 2017

    Posted 22 Jan 2018 in reply to Dinko Link to this post

    Hi Dinko,

     

    Thank you for your answer, telerik documentation for Localization is quite different than msdn one, I'm familliar with both, does msdn affects datepicker only? Or there are more controlls in which I can base on msdn instead of telerik Culture property?

     

    Regards

  7. Dinko
    Admin
    Dinko avatar
    914 posts

    Posted 24 Jan 2018 Link to this post

    Hello Mateusz,

    There are several controls in our UI for WPF suite which use windows Localization strings. If you want to change the week and months name you can set custom string arrays for the current culture. Check the following code snippet.
    this.datePicker.Culture = new System.Globalization.CultureInfo("en-US");
    this.datePicker.Culture.DateTimeFormat.AbbreviatedDayNames = new string[] { "111", "222", "33", "44", "555", "666", "777" };
    this.datePicker.Culture.DateTimeFormat.AbbreviatedMonthNames = new string[] { "111", "222", "33", "44", "555", "666", "777", "888", "999", "1010", "1111", "12121", "13131" };
    this.datePicker.Culture.DateTimeFormat.MonthNames = new string[] { "111", "222", "33", "44", "555", "666", "777", "888", "999", "1010", "1111", "12121", "13131" };

    Give this approach a try and let me know if it works for you.

    Regards,
    Dinko
    Progress Telerik
    Want to extend the target reach of your WPF applications, leveraging iOS, Android, and UWP? Try UI for Xamarin, a suite of polished and feature-rich components for the Xamarin framework, which allow you to write beautiful native mobile apps using a single shared C# codebase.
  8. Mateusz
    Mateusz avatar
    14 posts
    Member since:
    Dec 2017

    Posted 25 Jan 2018 in reply to Dinko Link to this post

    Hi Dinko, 

    I was so excited about this approach, but, sadly, it doesn't work for me. Placed this code after InitializeComponent(); and it changed nothing.

     

    Regards

  9. Answer
    Dinko
    Admin
    Dinko avatar
    914 posts

    Posted 29 Jan 2018 Link to this post

    Hello Mateusz,

    I am attaching a sample project which demonstrates the approach explained in my previous approach. When you run the application open the drop-down content of the control. You can observe that the week names in the calendar are changed.

    Regards,
    Dinko
    Progress Telerik
    Want to extend the target reach of your WPF applications, leveraging iOS, Android, and UWP? Try UI for Xamarin, a suite of polished and feature-rich components for the Xamarin framework, which allow you to write beautiful native mobile apps using a single shared C# codebase.
  10. Mateusz
    Mateusz avatar
    14 posts
    Member since:
    Dec 2017

    Posted 29 Jan 2018 in reply to Dinko Link to this post

    Thank you very much Dinko, I'll try to make is done in my project.
Back to Top