Can anyone help me out with localizing some links in my site? I have localized much content in my site to serve two languages, but i'm stuck at localizing some links. Here's my scenario..I have an aspx page in VB which can be displayed in two languages by
clicking a control to interchange locale, and pull text from resource files. On this page there is a link to a pdf, I have two pdf's for the two languages. How can open the english pdf when the locale is set to english, and the greek pdf when the locale is
set to greek? the pdf's url is in href, and i've tried localizing the href tag to no avail.
I createed 2 folders en-US and en-GB for the 2 locales and added the associated PDF files to these folders. now I dynamically created the URLs to access these PDFs by appending the folder names in the url.
culture is directly taken from current culture. if u add runat="server" in the <a> tag, you can access the anchor tag in code behind and set this url dynamically depending on the language.
Please: Don't forget to click "Mark as Answer" on the post that helped you. That way future readers will know which post solved your issue.
michael.giac...
Member
1 Points
11 Posts
localizing links
Feb 23, 2009 04:49 PM|LINK
Can anyone help me out with localizing some links in my site? I have localized much content in my site to serve two languages, but i'm stuck at localizing some links. Here's my scenario..I have an aspx page in VB which can be displayed in two languages by clicking a control to interchange locale, and pull text from resource files. On this page there is a link to a pdf, I have two pdf's for the two languages. How can open the english pdf when the locale is set to english, and the greek pdf when the locale is set to greek? the pdf's url is in href, and i've tried localizing the href tag to no avail.
nishanthnair
Participant
1714 Points
309 Posts
Re: localizing links
Feb 23, 2009 05:27 PM|LINK
here is what i did in the same situation.
I createed 2 folders en-US and en-GB for the 2 locales and added the associated PDF files to these folders. now I dynamically created the URLs to access these PDFs by appending the folder names in the url.
"http://hostname/" + Thread.CurrentThread.CurrentCulture.Name + "pdffile.pdf";
culture is directly taken from current culture. if u add runat="server" in the <a> tag, you can access the anchor tag in code behind and set this url dynamically depending on the language.
http://nishanthnair.com