I\'m building an ASP.NET web application, and all of my strings are stored in a resource file. I\'d like to add a second language to my application, and ideally, I\'d like t
This is a great question, as localization in ASP.NET is overlooked by many developers.
ASP.NET should automatically pick up on the user's browser settings and force the CultureInfo.CurrentCulture
to the user's browser language. You can force the issue with a line in Page_OnInit()
like:
Thread.CurrentThread.CurrentCulture = new CultureInfo(HttpContext.Current.Request.UserLanguages[0]);
How can you test this? Enter the languages panel on our browser and change settings.