Browse Source

UseAbpRequestLocalization

pull/666/head
Halil ibrahim Kalkan 8 years ago
parent
commit
fd72d7a61f
  1. 16
      abp_io/src/Volo.AbpWebSite.Web/AbpWebSiteWebModule.cs

16
abp_io/src/Volo.AbpWebSite.Web/AbpWebSiteWebModule.cs

@ -62,12 +62,21 @@ namespace Volo.AbpWebSite
var hostingEnvironment = context.Services.GetHostingEnvironment(); var hostingEnvironment = context.Services.GetHostingEnvironment();
var configuration = context.Services.GetConfiguration(); var configuration = context.Services.GetConfiguration();
ConfigureLanguages(context.Services);
ConfigureDatabaseServices(context.Services, configuration); ConfigureDatabaseServices(context.Services, configuration);
ConfigureVirtualFileSystem(context.Services, hostingEnvironment); ConfigureVirtualFileSystem(context.Services, hostingEnvironment);
ConfigureBundles(context.Services); ConfigureBundles(context.Services);
ConfigureTheme(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) private static void ConfigureBundles(IServiceCollection services)
{ {
services.Configure<BundlingOptions>(options => services.Configure<BundlingOptions>(options =>
@ -138,12 +147,7 @@ namespace Volo.AbpWebSite
var app = context.GetApplicationBuilder(); var app = context.GetApplicationBuilder();
var env = context.GetEnvironment(); var env = context.GetEnvironment();
app.UseRequestLocalization(options => app.UseAbpRequestLocalization();
{
options.DefaultRequestCulture = new RequestCulture("en-US", "en-US");
options.AddSupportedCultures("en-US");
options.AddSupportedUICultures("en-US");
});
if (env.IsDevelopment()) if (env.IsDevelopment())
{ {

Loading…
Cancel
Save