RadMenu Localization

6 posts, 0 answers
  1. archimede
    archimede avatar
    103 posts
    Member since:
    Jul 2006

    Posted 20 Jul 2010 Link to this post

    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.
  2. Veronica
    Admin
    Veronica avatar
    1213 posts

    Posted 20 Jul 2010 Link to this post

    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
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. archimede
    archimede avatar
    103 posts
    Member since:
    Jul 2006

    Posted 20 Jul 2010 Link to this post

    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.
  5. Veronica
    Admin
    Veronica avatar
    1213 posts

    Posted 20 Jul 2010 Link to this post

    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
  6. archimede
    archimede avatar
    103 posts
    Member since:
    Jul 2006

    Posted 21 Jul 2010 Link to this post

    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.
  7. Veronica
    Admin
    Veronica avatar
    1213 posts

    Posted 23 Jul 2010 Link to this post

    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
Back to Top
UI for ASP.NET Ajax is Ready for VS 2017