
Hi,
in our application we have the flexibility to change the culture at runtime and I would like to know if it's possible with Telerik?
Thank'
Alain
9 Answers, 1 is accepted
Yes, it's possible to change the culture at runtime. You can set it programmatically.
Thread.CurrentThread.CurrentCulture =
new
CultureInfo(
"de"
);
Thread.CurrentThread.CurrentUICulture =
new
CultureInfo(
"de"
);
If you have any other questions, please don't hesitate to contact us again.
Regards,
Dinko
Telerik

Hi Dinko,
this will change Telerik controls also (ie: RadScheduleView)???
Thank's
Alain
You can change the localization of RadScheduleView at runtime in a few steps. Firstly you can set the
DefaultCulture property of the LocalizationManager to the new culture. Then you need to reset the template of the RadScheduleView control in order for the changes to take effect. For example:
var cultureInfo = new CultureInfo("de-DE");
LocalizationManager.DefaultCulture = cultureInfo;
var myTemplate = this.MyScheduleView.Template;
this.MyScheduleView.Template = null;
this.MyScheduleView.Template = myTemplate;
You can also check the Localization help article and demo.
Hope this will help.
Regards,
Dinko
Telerik

Great Dinko :)
actually in our application we have multiple differents Telerik controls which can be created at the same time so I would like to know if it's possible when the localization of our application changeg, if I there is a way to search for all created Telerik controls an apply your logic to each one???
Thank's
Alain
You can change the localization of the Telerik controls at runtime in two ways. The first one is to set the static UseDynamicLocalization property of the LocalizationManager to true before calling the InitializeComponent() method of the application. This way when you change the localization manager's culture, the localized strings of the control will be updated. Keep in mind that this functionality is implemented only for part of our controls. For example, RadGridView and RadScheduleView won't work using this approach. The second one is to reset the template of the control as demonstrated in my previous answer.
To get all Telerik controls in your application, you can subscribe for their Loaded event using EventManager.RegisterClassHandler() method and store them in a collection. Then you can iterate through the collection and reset the templates of all it's elements.
EventManager.RegisterClassHandler(
typeof
(Control), Control.LoadedEvent,
new
RoutedEventHandler(OnControlLoaded));
Also, I have created a sample project with several Telerik controls where you can see how to implement these approaches.
Regards,
Dinko
Telerik

I have (still) the same problem.
Your recent sample, Dinko, solved most problems.But, the view selection button (navigation bar) is still not updated after culture change.
I would like to continue use our current version (2016.2.613), but I've also tested recent version (2017.3.1018).
What I have to do, do get navigation but to be updated too.
Thanks
Lukas

I wasn't able to reproduce the mentioned issues. The dialogs and the buttons language is changed properly. I also answered your ticket. Can you please get back there with more information on the matter.
Regards,
Martin Ivanov
Progress Telerik
