locked
localizing links RRS feed

  • Question

  • User1019027780 posted

    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.

    Monday, February 23, 2009 12:49 PM

Answers

  • User12518661 posted

     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.

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Monday, February 23, 2009 1:27 PM