Last post Aug 09, 2012 04:51 PM by Trolderik
Jul 14, 2008 07:21 AM|souvik|LINK
In my application i need to localize web.sitemap file with a resource file named other than web.sitemap.resx in App_GlobalResources folder.
Actually this resource file already exists in App_GlobalResources for localization of other components of the web application.
I would like to add resouce keys for the web.sitemap inside this resx file.
Is it possible???
Any kind of help will be highly appreciated.
Thanks in advance.
Jul 15, 2008 01:33 AM|vivek_iit|LINK
This link might help:
Jul 16, 2008 05:43 AM|souvik|LINK
Thanks for your reply.
Well,here when you mention the text of the nodes in web.sitemap using syntax like $resources:ClassName,KeyName,DefaultValue it is working
perfectly.But if you change the language of your browser to another one for example French(fr-FR), web.sitemap is not pulling the text for nodes
from the other resource file though there exists two resouce files in App_GlobalResources folder like UserLang.resx (the default one)
and UserLang.fr-FR.resx (for French).It is always pulling the data from the default resource file (UserLang.resx).
As a result of this if you bind web.sitemap with a menu control it is showing text from the default resource file despite changing of language of
Jul 16, 2008 10:05 PM|vivek_iit|LINK
Are you changing the Culture as well as the UICulture of the thread? Paste me the code on how you are changing the locale.
Aug 09, 2012 04:51 PM|Trolderik|LINK
I'm trying here first, before opening a new thread on the same subject:
I need to localize my web.sitemap with a resource file that does not have the name web.sitemap.culture.resx, it is only named culture.resx.
I am setting the culture of the entire page based on the primary language of the browser using this code in global.asax
void Application_BeginRequest(object sender, EventArgs e)
case "da": // Danish
Thread.CurrentThread.CurrentCulture = new System.Globalization.CultureInfo("da");
Thread.CurrentThread.CurrentUICulture = new System.Globalization.CultureInfo("da");
case "da": // Swedish
Thread.CurrentThread.CurrentCulture = new System.Globalization.CultureInfo("sv");
Thread.CurrentThread.CurrentUICulture = new System.Globalization.CultureInfo("sv");
default: // everything else
Thread.CurrentThread.CurrentCulture = new System.Globalization.CultureInfo("en");
Thread.CurrentThread.CurrentUICulture = new System.Globalization.CultureInfo("en");
My question is, how do I programmatically select which resource file to use? (they are named da.resx, sv.resx and en.resx)