Owin.Localization
1.0.0
See the version list below for details.
dotnet add package Owin.Localization --version 1.0.0
NuGet\Install-Package Owin.Localization -Version 1.0.0
<PackageReference Include="Owin.Localization" Version="1.0.0" />
paket add Owin.Localization --version 1.0.0
#r "nuget: Owin.Localization, 1.0.0"
// Install Owin.Localization as a Cake Addin #addin nuget:?package=Owin.Localization&version=1.0.0 // Install Owin.Localization as a Cake Tool #tool nuget:?package=Owin.Localization&version=1.0.0
Owin.Localization
Port of AspNetCore localization middleware (Microsoft.AspNetCore.Localization) to owin middleware. The allows a similar programming model as AspNetCore localization request providers making it much eaiser to write custom providers that multi-target both Owin and AspNetCore.
Localization middleware sets the requests culture and ui culture based a series of pluggable request culture providers.
Includes support for Accept-Header, Cookie, and Query string providers.
See https://github.com/dotnet/aspnetcore/tree/master/src/Middleware/Localization for details and documentation.
Installing
The package is available via NuGet.
Install-Package Owin.Localization
AspNet MVC projects
AspNet MVC projects require a small amount of additonal code to ensure that the assigned culture flows accross from the OWIN middleware to the AspNet request MVC pipeline, because of the way AspNet handles async Owin middleware.
For an AspNet Mvc (.NET Framework 4.7.1 or higher) project, override the Init() of the HttpApplication class as follows:
public override void Init()
{
base.Init();
// flow owin culture to every aspnet step
this.OnExecuteRequestStep((ctx, step) =>
{
if (ctx.Items.Contains(RequestLocalizationMiddleware.OwinEnvironmentKey))
ctx.GetOwinContext()?.RestoreCulture();
});
}
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET Framework | net462 is compatible. net463 was computed. net47 was computed. net471 was computed. net472 was computed. net48 was computed. net481 was computed. |
-
.NETFramework 4.6.2
- Microsoft.Net.Http.Headers (>= 2.2.8)
- Microsoft.Owin (>= 4.1.0)
NuGet packages (2)
Showing the top 2 NuGet packages that depend on Owin.Localization:
Package | Downloads |
---|---|
Owin.Localization.Unity
Adds support to allow IRequestCultureProviders instances to be resolve during the request using Unity container. This can be useful if the provider has external dependencies such as database connections etc that are best handled via DI |
|
Owin.Localization.Autofac
Adds support to allow IRequestCultureProviders instances to be resolve during the request using Autofac container. This can be useful if the provider has external dependencies such as database connections etc that are best handled via DI |
GitHub repositories
This package is not used by any popular GitHub repositories.