Search code examples
browserculturelocalization

How to have website think you're visiting from a different country?


I can test cultures well enough e.g. es-US or fr-CA but the .NET framework has a built in class called System.Globalization.CultureInfo which I believe is returning wrong values as I'm visiting from a US address.

Is there a way to fake the headers or a browser extension that can handle this sort of testing?

I've looked into proxies, but the site is only accessible through VPN.


Solution

  • Have you tried the article how-to-localize-asp-net-controls-based-on-browsers-language-and-culture-settings ?

    It is an example of how to use CultureInfo.CurrentUICulture when <%@ Page Language="C#" UICulture="auto" ... is set.

    In Step 6 of the article the autor shows how to simulate different languages in the browser

        Step 6:
    
        Now change language of your browser to Hindi (hi-IN). In Internet Explorer, go to:
    
        Tools -> Internet Options -> General tab -> Languages -> Add
    
        Now select Hindi (India) [hi-IN] from the drop down and click OK. 
        Move Hindi to top using Move up button.
    

    I donot know if this also work for System.Globalization.CultureInfo, too.