简体   繁体   中英

Change Default Culture in AspNetBoilerplate

Even after reading this sources:

Add a setting to get/set default language

Set language per user or per domain #272

I could not set my application to start with a default language.

My languages are working fine. The user can choose what want after the page load. But the page must load as one culture other than default english.

I want my web.config stay with:

<system.web>
  <globalization culture="auto" uiCulture="auto" />

Tried this options, unsuccessfuly:

  • Change AppSettingProvider.cs in {template}.core , to add a new SettingDefinition
  • Added Configuration.Localization.Languages by hand in {template}.Web {template}WebModule.PreInitialize() method setting default true to LanguageInfo
  • Overrided SetCurrentCulture() in Global.asax

After all, the solution was very simple.

Just change the setting into database table AbpSettings where Name column is "Abp.Localization.DefaultLanguageName" and UserId is null:

update AbpSettings 
   set Value = 'pt-BR' 
 where UserId is null 
   and rtrim(Name) like 'Abp.Localization.DefaultLanguageName';

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM