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

Alternative languages for menu button text

3 Answers 52 Views
Menu
This is a migrated thread and some comments may be shown as answers.
Clive Hoggar
Top achievements
Rank 1
Clive Hoggar asked on 16 Jul 2009, 06:33 PM
Hi experts,

I need to be able to swap the text on menu and sub menu buttons according to the language that is
set in a session variable(for example) . What would be the best way to approach this? EG with the text variants 
in a database table or xml file.

Does anyone have any experience of this?

Thanks for an advice!

Clive

3 Answers, 1 is accepted

Sort by
0
Peter
Telerik team
answered on 17 Jul 2009, 03:17 PM
Hi Clive,

Please, see the following forum discussion which will provide you with ideas how to solve this problem:
http://www.telerik.com/community/forums/aspnet/menu/localization-help.aspx



Peter
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
0
ManniAT
Top achievements
Rank 2
answered on 20 Jul 2009, 02:16 PM
What I do is switching the sitemap datasource.
The reason - it "localizes" also breadcrumbs :)
My Providers are all named (for some reason) SMP...
Here the definition from web.config
 <add name="smpDE" description="Deutscher SiteMap provider." type="House1.Classes.HouseSitemapProvider" siteMapFile="DE.sitemap" securityTrimmingEnabled="true"/>  
 <add name="smpEN" description="English SiteMap provider." type="House1.Classes.HouseSitemapProvider" siteMapFile="EN.sitemap" securityTrimmingEnabled="true"/>  
 <add name="smpAdmin" description="Admin SiteMap provider." type="System.Web.XmlSiteMapProvider" siteMapFile="Admin.sitemap" securityTrimmingEnabled="true"/>  
 
All of the providers could be System.Web.XmlSiteMapProivder (I derivied because I need extra functionallity)
Here the code in my masterpage:
SiteMapProviderCollection smpCol = SiteMap.Providers;  
foreach (SiteMapProvider smP in smpCol) {  
    if (smP.Name.ToUpper() == "SMP" + strLng) { //found  
        dsSM.SiteMapProvider = smP.Name;  
        break;  
    }  
}  
 
<asp:SiteMapDataSource ID="dsSM" runat="server" ShowStartingNode="false" SiteMapProvider="XmlSiteMapProvider" /> 
Last not least strLng contains 2 letters from the client culture.

Regards

Manfred
0
Clive Hoggar
Top achievements
Rank 1
answered on 20 Jul 2009, 05:16 PM
Hi
Thanks a lot for this detailed response. I think I will do something along this line.
Clive
Tags
Menu
Asked by
Clive Hoggar
Top achievements
Rank 1
Answers by
Peter
Telerik team
ManniAT
Top achievements
Rank 2
Clive Hoggar
Top achievements
Rank 1
Share this question
or