turquoiseowl / i18n

Smart internationalization for ASP.NET
Other
556 stars 156 forks source link

Is there a method or property to obtain the selected language? #353

Closed beckjin closed 6 years ago

beckjin commented 6 years ago

image

As follows:

Accept-Language:en-GB,en-US;q=0.8,en;q=0.6
Accept-Language:en-US,zh-CN;q=0.8,zh;q=0.6,en;q=0.4

I want to get the language that has been matched.

turquoiseowl commented 6 years ago

The GetPrincipalAppLanguageForRequest extension method to HttpContext can be called to access the PAL of the current request.

That should be it.