.Net Core Localization

  • Thread starter Thread starter DaveIII
  • Start date Start date
D

DaveIII

Guest
Hi,

In my .NET Core Controller, I'd like to set localization to the value preferred by the client's browser. So, for example, if my #1 language/Culture preference is en-CA (English Canada), I'd like my web server to automatically reflect that.

In prior versions of .Net, this was accomplished via something like the following:

System.Threading.Thread.CurrentThread.CurrentCulture = CultureInfo.CreateSpecificCulture(Request.UserLanguages[0]);

How is that handled in .Net Core?

We are using VS 2017, Windows 10, .Net Core 1.04.

Continue reading...
 
Back
Top