Comments (4)
Hi. did you find any solution??
from westwind.aspnetcore.
I believe I just used the built in functions e.g.
Thread.CurrentThread.CurrentCulture = new CultureInfo(request.CultureCode);
Thread.CurrentThread.CurrentUICulture = new CultureInfo(request.CultureCode);
from westwind.aspnetcore.
If I recall correctly this helper was removed since it couldn't generically auto-detect the browser language which was the main reason for this function.
from westwind.aspnetcore.
I added HttpContextExtensions.SetUserLocale which should now work as the old version did. The old version was dependent on HttpContext.Current to pick up the Accept-Languages - the new version explicitly requires the HttpContext/Request in order to do that so it seems best to add it as an extension method for HttpContext.
// uses browser locale from first language in Accept languages
HttpContext.SetUserLocale();
// specific locale
HttpContext.SetUserLocale("de-at");
from westwind.aspnetcore.
Related Issues (9)
- Change target framework to netstandard2.0 HOT 8
- Add licence HOT 2
- Issue with XSS HOT 4
- Change markdown renderer used HOT 2
- Cross site scripting vulnerability HOT 3
- Missing trailing slash causes out of index exception HOT 1
- Markdown now requires trailing slash for subsite HOT 1
- Custom Middleware add/remove headers HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from westwind.aspnetcore.