Skip to content

Commit

Permalink
UseAbpRequestLocalization
Browse files Browse the repository at this point in the history
  • Loading branch information
hikalkan committed Dec 18, 2018
1 parent 64021fb commit fd72d7a
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions abp_io/src/Volo.AbpWebSite.Web/AbpWebSiteWebModule.cs
Original file line number Diff line number Diff line change
Expand Up @@ -62,12 +62,21 @@ public override void ConfigureServices(ServiceConfigurationContext context)
var hostingEnvironment = context.Services.GetHostingEnvironment();
var configuration = context.Services.GetConfiguration();

ConfigureLanguages(context.Services);
ConfigureDatabaseServices(context.Services, configuration);
ConfigureVirtualFileSystem(context.Services, hostingEnvironment);
ConfigureBundles(context.Services);
ConfigureTheme(context.Services);
}

private static void ConfigureLanguages(IServiceCollection services)
{
services.Configure<AbpLocalizationOptions>(options =>
{
options.Languages.Add(new LanguageInfo("en-US", "en-US", "English"));
});
}

private static void ConfigureBundles(IServiceCollection services)
{
services.Configure<BundlingOptions>(options =>
Expand Down Expand Up @@ -138,12 +147,7 @@ public override void OnApplicationInitialization(ApplicationInitializationContex
var app = context.GetApplicationBuilder();
var env = context.GetEnvironment();

app.UseRequestLocalization(options =>
{
options.DefaultRequestCulture = new RequestCulture("en-US", "en-US");
options.AddSupportedCultures("en-US");
options.AddSupportedUICultures("en-US");
});
app.UseAbpRequestLocalization();

if (env.IsDevelopment())
{
Expand Down

0 comments on commit fd72d7a

Please sign in to comment.