This is a migrated thread and some comments may be shown as answers.

Grand Total localization

4 Answers 62 Views
PivotGrid
This is a migrated thread and some comments may be shown as answers.
Martin
Top achievements
Rank 1
Martin asked on 15 Jun 2018, 02:07 PM

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

4 Answers, 1 is accepted

Sort by
0
Martin Ivanov
Telerik team
answered on 20 Jun 2018, 12:25 PM
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.
0
Martin
Top achievements
Rank 1
answered on 20 Jun 2018, 02:07 PM

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

0
Martin Ivanov
Telerik team
answered on 22 Jun 2018, 11:27 AM
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.
0
Martin
Top achievements
Rank 1
answered on 22 Jun 2018, 02:10 PM

Hi Martin,

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

Best regards

Martin

Tags
PivotGrid
Asked by
Martin
Top achievements
Rank 1
Answers by
Martin Ivanov
Telerik team
Martin
Top achievements
Rank 1
Share this question
or