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

Built-in localization for de?

10 Answers 166 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Björn
Top achievements
Rank 1
Björn asked on 20 Jul 2011, 01:45 PM
I want to use the Built-in localization for German 'de'.

I made following things according to localization-setting:
- <SupportedCultures>de-CH</SupportedCultures>
- startup:
    Thread.CurrentThread.CurrentCulture = new CultureInfo("de-CH");
    Thread.CurrentThread.CurrentUICulture = new CultureInfo("de-CH");

What's about the statement 'LocalizationManager.DefaultResourceManager = ES.ResourceManager' in the VB sample.
It's missing in the C# sample. What's wrong there?

When I opened the RadGridView -Filter it's still in English!
Are the resources for RadGridView translated into German?

Or I made something wrong?

If the translations are missing: which controls are translated at the moment in which language?
Can you send us the neutral language resx-file for the controls which are not translate at the moment.

Thanks
Björn.

10 Answers, 1 is accepted

Sort by
0
Maya
Telerik team
answered on 20 Jul 2011, 03:12 PM
Hi Björn,

Actually, the error is in the VB code. Thank you for pointing it out, it will be fixed immediately. The VB code will be appropriate in case you define your own resource and need to set the DefaultResourceManager. In your case it should not be necessary as the resources for the grid are localized in German.
However, please make sure that the corresponding Folder - "de" is available in the folder with the binaries. Considering the keys for the string resources, you may find them here

Greetings,
Maya
the Telerik team

Register for the Q2 2011 What's New Webinar Week. Mark your calendar for the week starting July 18th and book your seat for a walk through of all the exciting stuff we will ship with the new release!

0
Björn
Top achievements
Rank 1
answered on 21 Jul 2011, 10:07 AM
Hi Maya

It's still not working.

The Telerik.Windows.Controls.resources.dll is in the bin-Folder:
...\src\MyProject\bin\Debug\de
But not in the xap-File:
...\src\MyProject.Web\ClientBin\MyProject.xap

In the unzipped xap all the Telerik-dll's are there except the resources.dll one.

Thanks
Björn.
0
Maya
Telerik team
answered on 21 Jul 2011, 10:13 AM
Hello Björn,

I have tested again the issue and everything works as expected on my side. I am sending you a sample project illustrating the approach. Please take a look at it and let me know in case of any misunderstandings.

 

Kind regards,
Maya
the Telerik team

Register for the Q2 2011 What's New Webinar Week. Mark your calendar for the week starting July 18th and book your seat for a walk through of all the exciting stuff we will ship with the new release!

0
Björn
Top achievements
Rank 1
answered on 22 Jul 2011, 12:29 PM
Hi Maya
Found the problem.
According to the <SupportedCultures> configuration in the Silverlight-csproj file it will bind the resource-assemblies into the project.
Because we want to support the swiss languages, we defined only de-CH, fr-CH, where we also define our own resources.
But for these languages there are no resources from Telerik. So we have to define also the fallback languages de, fr - where resources from Telerik exists:
<SupportedCultures>fr,de,fr-CH,de-CH</SupportedCultures>

Maya - can you mark my reply as answer.

That's it
Björn.
0
Anne Lyon
Top achievements
Rank 1
answered on 18 Nov 2011, 12:14 PM
I would like to bring this question one step further: I have successfully managed to run the sample project where the text built into the GridControl is changed from English to German. But what about the column headers? What about the text on the buttons? How do I set text string in the XAML based on current language?

Anne
0
Maya
Telerik team
answered on 18 Nov 2011, 01:13 PM
Hi Anne Lyon,

You need to have the string resources for the headers localized as well. Please take a look at our demos for a reference. As you can see the headers of the columns are translated in German as well. 


All the best,
Maya
the Telerik team

Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

0
Anne Lyon
Top achievements
Rank 1
answered on 18 Nov 2011, 02:55 PM
Thanks,
Now at least I manage to get text from the language resource file to set text or content for other controls (labels, buttons etc.)
One thing I don't understand is how to switch between the supported languages. In your demo you load some Telerik localization assemblies, but how do I load my private LanguageResources.resx file?
I have read through your User Guide and it tells me to create files for each language:
LanguageResources.en.resx
LanguageResources.no.resx  (Norwegian)
LanguageResources.resx
where the last one gets the Access Modifier property set to Public.

Now I can access resource strings in the bottom file when I run my solution.
But if I want to switch to Norwegian? I have tried to set the no.resx file to Public, but the Designer.cs file that is generated is empty.
I have also set the
<SupportedCultures>en;no</SupportedCultures>
in the project.
But I do not manage to switch to my Norwegian resource file to display Norwegian text strings. Can you help?
0
Maya
Telerik team
answered on 18 Nov 2011, 04:35 PM
Hello Anne Lyon,

Would you clarify a bit on the exact scenario that you want to accomplish ? Do you want to load your application with Norwegian localization or you want to change it run time ?
Have you checked this article ?
 

All the best,
Maya
the Telerik team

Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

0
Anne Lyon
Top achievements
Rank 1
answered on 19 Nov 2011, 04:17 PM
I have already done what is described in your article, but the point is I don't just want to translate the text "inside" the RadControls, but also the text on Buttons, Labels, Tooltip etc. So I need my own private Language file which contains also the keys and translations for all these other items.

I want to build my app with English strings for my English customer, and I want to build my app with Norwegian strings for my Norwegian customer. I can only make my application use the strings from my LanguageResourses.resx file (which is in English) how do I load the file with Norwegian text, which is in the file LanguageResources.no.resx?

I hoped that the only thing I needed to do was to set the language file I want to use (in my case LanguageResources.no.resx) to 'Public' and then this file would be used automatically when building, but it doesn't work as described in my previous post.

I can of course rename the files so that the Language.Resources.resx file contains the language I want to build with, but what is then the point in having the other files with the other languages added to my solution?

So, if we follow the steps in your Localization chapter in the User Guide, how do I load for instance the GridResources.nl.resx file rather than the GridResources.resx file when I build my project? I have set the SupportedCultures to 'en;nl' - but how do I make the builder load the dutch file instead of the default one?
0
Maya
Telerik team
answered on 22 Nov 2011, 09:15 AM
Hello Anne Lyon,

You can specify the default resource manager as follows:

//MainPage.xaml.cs
public MainPage()
        {
            LocalizationManager.Manager = new LocalizationManager()
            {
                ResourceManager = DE.ResourceManager,
                Culture = new CultureInfo("de"),
            };
            InitializeComponent();     
        }
OR
//App.xaml.cs
public App()
        {
            Thread.CurrentThread.CurrentCulture = new CultureInfo("de");
            Thread.CurrentThread.CurrentUICulture = new CultureInfo("de");
 
 
            LocalizationManager.Manager = new LocalizationManager()
            {
                ResourceManager = DE.ResourceManager,
                Culture = new CultureInfo("de"),
            };
 
            this.Startup += this.Application_Startup;
            this.Exit += this.Application_Exit;
            this.UnhandledException += this.Application_UnhandledException;
 
            InitializeComponent();
        }

In both cases DE is the name of the Resource file containing the localized string resources. Thus they will be loaded directly from it and not from the default one. Let me know if you need any further assistance with it.
Furthermore, I would recommend you to run through this article for a reference that could be quite helpful when dealing with localizing Silverlight applications.
 

Kind regards,
Maya
the Telerik team

Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

Tags
GridView
Asked by
Björn
Top achievements
Rank 1
Answers by
Maya
Telerik team
Björn
Top achievements
Rank 1
Anne Lyon
Top achievements
Rank 1
Share this question
or