-
Notifications
You must be signed in to change notification settings - Fork 0
/
LocalizationPipeline.cs
34 lines (28 loc) · 1.09 KB
/
LocalizationPipeline.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Localization;
using Microsoft.AspNetCore.Localization.Routing;
using System.Collections.Generic;
using System.Globalization;
namespace VoiConShop
{
public class LocalizationPipeline
{
public void Configure(IApplicationBuilder app)
{
var supportedCultures = new List<CultureInfo>
{
new CultureInfo("en"),
new CultureInfo("et"),
new CultureInfo("ru"),
};
var options = new RequestLocalizationOptions()
{
DefaultRequestCulture = new RequestCulture(culture: "en", uiCulture: "en"),
SupportedCultures = supportedCultures,
SupportedUICultures = supportedCultures
};
options.RequestCultureProviders = new[] { new RouteDataRequestCultureProvider() { Options = options } };
app.UseRequestLocalization(options);
}
}
}