ASP.NET Globalization Query RRS feed

  • Question

  • User-456111751 posted

    Hi All,

    I have created a webpage using .NET Globalization (Resource files) for 3 laungauges (Spanish, Portuguese and English). There are certain Javascript funtions in it. For Eg: A Javascript gives a Message, Are you sure you want to Submit. Press cancel to revalidate!

    I want to convert this Javascript message also to other laungauge (Spanish and portueguese) based on the laungauge selection. Right now it comes only in English.

    Please help to achieve this.

    Thursday, March 3, 2011 12:21 PM


  • User877341716 posted


    You can use the Navigator object in javascript to detect the language like the one below


    if (navigator.userLanguage) // Explorer
        l_lang = navigator.userLanguage;
      else if (navigator.language) // FF
        l_lang = navigator.language;


    And then you can use language specific  messages in the alert pop up

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Friday, March 4, 2011 7:33 AM