locked
How to check the default browser language from the code RRS feed

  • Question

  • User-348694735 posted

     Hi,

    Lets say that I use resources files to enable multilanguage suport. And i have some labels, text boxes etc that i fill with text from my .cs page. 

    My question is how can i check browser selected language in order to display different messages?


    Example:

    if (browser.language == "UK-uk")
    {
    label.Text = "Somthing on english"
    }
    else
    {
    label.Text = "Something on the default app language";
    }

     Thanks

    Friday, February 27, 2009 3:47 AM

All replies

  • User-2064897223 posted

    <script language="javascript">
            function isFireFox() {
                return navigator.appName == "Netscape";
        }
        function whichLanguage()
            {
                if (isFireFox()) {
                    alert(navigator.language);
                }
                else {
                    alert(navigator.browserLanguage);
                }
            }
        </script>

    Friday, February 27, 2009 5:09 AM
  • User1500579645 posted

    HI 1)http://www.codeproject.com/KB/aspnet/ChangeCultures.aspx 2)http://aspalliance.com/821 Thanks Venky

    Friday, February 27, 2009 5:12 AM