Grand Total localization

5 posts, 0 answers
  1. Martin
    Martin avatar
    3 posts
    Member since:
    Jun 2018

    Posted 15 Jun 2018 Link to this post

    Hi,

    I try to change text of "Grand Total" with Localization Manager, set the localization for "Pivot_GrandTotal", but nothing happened. Other text, such as "Pivot_AggregateSum", "Pivot_AggregateCount", and other are translated successfully, but "Pivot_GrandTotal" not.

    Could you help me?

    Thanks

  2. Martin Ivanov
    Admin
    Martin Ivanov avatar
    2420 posts

    Posted 20 Jun 2018 Link to this post

    Hello Martin,

    I tested this in the CustomDateTimeGroupDescription SDK example, but the Grand Total string is localized properly. Can you try the attached project on your side and let me know if I am missing something? Also, you can you tell me what culture you are using?

    Regards,
    Martin Ivanov
    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.
  3. Martin
    Martin avatar
    3 posts
    Member since:
    Jun 2018

    Posted 20 Jun 2018 in reply to Martin Ivanov Link to this post

    Hello Martin,

    thanks you for your reply.

    Because my language is not in supported languages, I use method 

    string GetStringOverride(string key) inherited from class Telerik.Windows.Controls.LocalizationManager. Most of the texts are translatable, but few (Grand Total, Total and few others) not.

    Small example:

     

    public class CustomLocalizationManager : LocalizationManager
    {
            public override string GetStringOverride(string key)
            {
                if (key == "Pivot_GrandTotal") // method never receive key "Pivot_GrandTotal", so "Grand Total" string never translate
                {
                    return "MyGrandTotalCaption";
                }

                if (key == "Pivot_AggregateSum") // this key works, it will translate
                {
                    return "MyAggregateSumCaption";
                }

                return base.GetStringOverride(key);
            }
        }
    }

    Thank you for your tips.

    Best regards

    Martin

  4. Martin Ivanov
    Admin
    Martin Ivanov avatar
    2420 posts

    Posted 22 Jun 2018 Link to this post

    Hello Martin,

    Thank you for the provided information. I was able to reproduce the reported behavior when setting the custom localization manager after the InitializeComponent() call. It seems that at this point the GrandTotal text is already taken by the default localization manager and it is no longer required. This is why the custom manager doesn't work for it. To resolve this please move the manager's setting before the InitializeComponent() and let me know how it goes. For example:
    public MainWindow()
    {
        Thread.CurrentThread.CurrentCulture = new CultureInfo("cs");
        Thread.CurrentThread.CurrentUICulture = new CultureInfo("cs");
        LocalizationManager.Manager = new CustomLocalizationManager(); 
     
       InitializeComponent(); 
    }
    Alternatively, you can move it in the static constructor of the view.

    Regards,
    Martin Ivanov
    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.
  5. Martin
    Martin avatar
    3 posts
    Member since:
    Jun 2018

    Posted 22 Jun 2018 in reply to Martin Ivanov Link to this post

    Hi Martin,

    Thank you very much for your solution, it works great :-)

    Best regards

    Martin

Back to Top