When removing English from the languages it still gets defaulted to in blazor-server.
Is there an existing issue for this?
- [X] I have searched the existing issues
Description
I was setting up a tiered Blazor-server project where I also was implementing the AuthServer in HttpApiHost. While I was removing the languages in the DomainModule and only enabling Dutch. I restarted the application (Blazor and Host) to check my changes to my suprise English was still selected by default.
When changing to the only other language (Dutch) the select dropdown goes away and the correct language gets selected.
I was searching on the internet but could not find any solutions. Like setting the default language in the OnApplicationInitialization doesn't work.
Any help would be really recommended and thanks in advance!
Reproduction Steps
New blazor server tiered project with basic theme. Remove all the languages except dutch and start the application.
Default english will be selected with the option to change to dutch. After changing you cannot go back to english because it shouldn't be enabled.
Expected behavior
Their is no language select dropdown and dutch will be selected and defaulted to.
Actual behavior
Their is a language dropdown with 1 option dutch and english is selected by default.
Regression?
No response
Known Workarounds
None
Version
8.3.3
User Interface
Blazor Server
Database Provider
EF Core (Default)
Tiered or separate authentication server
Tiered
Operation System
Linux
Other information
No response
language is also stored as a cookie. may it be that you did not clear it?
hi @Hyppothalamus
Can you share a test project to reproduce?
This is a test project I created. All the languages are disabled except for nl-BE in the DomainModule and in the SharedDomainModule default culture name is changed to nl-BE. This is a blazor-server tiered project with the latest abp framework.
I also cleared my cookies after changing the languages.
Thanks in advance!
hi
Thank you for the fix. This sounds like a default feature is there a reason why this isn't in the docs?
@maliming Thanks.I found this works for me. 1.change the code in ConfigureService 2.add code to the Blazor project's appsettings.json
"Settings": {
"Abp.Localization.DefaultLanguage": "zh-hans"
}