Luiz Vaz
Luiz Vaz

Reputation: 1839

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" />

Upvotes: 1

Views: 2605

Answers (2)

Phan Huy Thanh
Phan Huy Thanh

Reputation: 11

go to Seed Folder and DefaultSettingsCreator file and then change:

AddSettingIfNotExists(LocalizationSettingNames.DefaultLanguage, "pt-BR", tenantId);

Upvotes: 1

Luiz Vaz
Luiz Vaz

Reputation: 1839

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';

Upvotes: 1

Related Questions