I'm currently using the GridView component. But I see that the text above(Drag a column header and drop it here to group by that column) doesn't seems to change depending of the current localisation.
I've to do a fully multilanguage interface, how can I change this text?
Thank you :)
19 Answers, 1 is accepted
Please check this demo for more info.
Best wishes,Vlad
the Telerik team
Can I have an example of file loaded here "LocalizationManager.DefaultResourceManager = new ResourceManager("Telerik.Windows.Examples.GridView.Localization.English", Assembly.GetCallingAssembly());" ?
(it's not column name localization which interest me, but the "Click here to insert", ...
Thank you
The localization files for the default English language, German, Spanish and French are predefined and come together with the assemblies for the controls. If you want to create one of your own, you may take a look at our online documentation for a reference. Furthermore, I am sending you a sample project illustrating how you may define a Resource file on your own and use it as the default one in your application.
On the other hand, if you want to predefine just a string, you may create a simple class CustomLocalizationManager that inherits the default one and override this particular string:
public class CustomLocalizationManager : LocalizationManager
{
public override string GetStringOverride(string key)
{
switch (key)
{
case "GridViewAlwaysVisibleNewRow":
return "MyOk";
}
return base.GetStringOverride(key);
}
}
public MainPage()
{
InitializeComponent();
LocalizationManager.Manager = new CustomLocalizationManager();
}
Maya
the Telerik team
In order to provide you with an accurate solution, I would need a bit more details about the exact scenario you want to accomplish. When exactly do you want to use the predefined localization and when do you want to change it ? Do you want to change dynamically the languages used ?
Maya
the Telerik team
We have a program in which the user can select the language he wants to use, so the language we use is not in all case the language of the environnment.
The user can change the language through a menu.
Actually, everything is working, except telerik component, which stays in the environnment language, so I wish I ask:
"Hey telerik components, try now to use the language XYZ if you have a translation for it, otherwise use the default localisation(english)".
I hope my scenario is clear enough :)
Generally, you may take a look at our demo of Localizing RadGridView that demonstrates changing the language at runtime. The basic idea is that the element changing the language is outside the main view and once a selection is made, the grid is recreated with the chosen resource language file.
Maya
the Telerik team
LocalizationManager.DefaultResourceManager = new ResourceManager("Telerik.Windows.Examples.GridView.Localization.English", Assembly.GetCallingAssembly());
How can I do to don't specify them and use default en, fr, es, ... localisations?
The mechanism in the demos is slightly different as an invocation to the required resources assemblies is required. However, this is not necessary in a regular application. I am sending you a sample project illustrating how you may change the language at runtime.
Maya
the Telerik team
I'm already changing the current culture of the thread and the current UI thread, but I can't replace the current content, I've a lot of view, and from where I've the master window, I cannot know if my children(which contains Telerik UI components) are editing some data, and if they are, I will loose data. And like this I will lose a lot of process time to recreate all my UI components. It's really not an optimal and acceptable solution.
Julien
Another possible approach may be to implement a navigation logic using the Silverlight Navigation Framework. Thus you may "map" to the correct page with its specific localized strings. When setting the UriMapping, you may define a 'parameter' {culture} that will be responsible for separating the different pages and passing the corresponding culture.
Maya
the Telerik team
Please excuse me for the misunderstanding. As the target platform is WPF, you may implement the supported Navigation and the Frame class similarly to the example to in the sample I previously attached.
Let me know if you need any further assistance or a sample project.
Maya
the Telerik team
The idea behind the suggested approaches is to recreate the UI once the language has been changed. Generally, any appropriate for your particular scenario solution needs to implement this basic requirement and update the whole view with the new language. Otherwise, that change will not be visible and the string resources will not be translated.
Maya
the Telerik team
I'm currently using a simple library for all my text and I only need to ask to change locals. If a free-open-source solution provide this kind of language change, I think you can do better than reload all components, I've something like 200+ components, we create them at launch because it takes a lot of times, so it is just impossible to recreate them on the language change, reload all data, make again all bindings, ... It will makes us weeks of work only to change a language...
And you guaranted me that I can change easily the language as in your demo...
As mentioned previously, you may either benefit from the Navigation supported by WPF or recreate the controls you want to be localized. So, if the target control is RadGridView, you may recreate only it. The basic idea is to update to UI.
Maya
the Telerik team