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

RadMenu Localization

5 Answers 85 Views
This is a migrated thread and some comments may be shown as answers.
archimede
Top achievements
Rank 1
archimede asked on 20 Jul 2010, 02:03 PM
I'd like to localize menu items and put their Text into Resource.resx file. Is it possible? How?
I'd like not to change datasource programmatically or to use database.

5 Answers, 1 is accepted

Sort by
0
Veronica
Telerik team
answered on 20 Jul 2010, 02:59 PM
Hi archimede,

I've made a sample solution to show you how to change the culture of RadTreeViewContextMenu and RadMenu.

Here are the steps:

1. Set the Culture and UICulture attributes to the Page Directive to the desired culture. In my example it is "bg-BG".

2. Switch to design-time and choose Tools/Generate Local Resource. This will create a new folder App_LocalResources. There you'll have see a resource file called Default.aspx.resx.

3. Copy the content of the .resx file to new file with name: Default.aspx.bg-BG.resx. If you use another culture you should edit the name of the new .resx file to fit the new culture., e.g. if you want German Culture you should replace your file name with Default.aspx.de-DE.resx.

4. Set the values of the Default.aspx.bg-BG.resx file with desired names in desired culture, e.g:

 Name Value 
 
RadMenuItemResource2.Text 
Редактирай родител

You may find the full code in the attached .zip file.

Please let me know if this was helpful.

All the best,
Veronica Milcheva
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
archimede
Top achievements
Rank 1
answered on 20 Jul 2010, 03:42 PM
I've seen your example and it works.

I've tryed to " Switch to design-time and choose Tools/Generate Local Resource" but I couldn't find the item. Where is it?

Another problem is that I have to specify in page directive the language. Is it possible to do the same programmatically instead?

Thank you.
0
Veronica
Telerik team
answered on 20 Jul 2010, 04:56 PM
Hi archimede,

It seems that "Generate Local Resource" is missing in the Express versions of the Visual Studio. However if your Environment is Professional Edition or above and by some reason this menu item is still missing - try the solution from this blog.

You can set the UICulture and Culture programmaticaly. See in this article from MSDN how.

Please let me know if this was helpful.

Best wishes,
Veronica Milcheva
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
archimede
Top achievements
Rank 1
answered on 21 Jul 2010, 01:16 PM
Ok, I've manually added the Resource file and overrode the InitializeCulture of the Page and it works.

Intead of ovveriding the InizializeCulture in each Page of the web application I'd like to do this in my masterpage file if possible. Is it?

Thank you.
0
Veronica
Telerik team
answered on 23 Jul 2010, 02:46 PM
Hi archimede,

To be able to set the UI culture and culture for all pages is to add a globalization section to the Web.config file, and then set the uiculture and culture attributes, as shown in the following example:

<globalization uiCulture="es" culture="es-MX" />

All the best,
Veronica Milcheva
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Tags
Menu
Asked by
archimede
Top achievements
Rank 1
Answers by
Veronica
Telerik team
archimede
Top achievements
Rank 1
Share this question
or