Refuse deleting the default language #23217
BackVolobox task: VolosoftWorkspace#1867
Description
On Language Management > Languages, the default language could be deleted: the UI offered Delete and the server accepted it.
LanguageAppService.DeleteAsyncnow refuses the default language with aBusinessException(Volo.Abp.LanguageManagement:010002): " is the default language and cannot be deleted. Set another language as the default first." (en + tr texts added; other cultures fall back to English).- MVC, Blazorise, MudBlazor and Angular no longer show Delete on the default language row.
- Tests:
DeleteAsyncnow deletes a non-default language; a newDeleteAsync_Should_Refuse_The_Default_Languagetest covers the refusal.
Note: the existing DefaultLanguageDeletionConfirmationMessage is left in place, since removing it would be a breaking change for overrides; it is simply no longer reached from the built-in UIs.
How to test it?
- Sign in as admin and open Language Management > Languages.
- The default language's Actions menu has no Delete; other languages still do.
- Call
DELETE /api/language-management/languages/{defaultLanguageId}: it returns 403 with the message above, and the language stays.
dotnet test for LanguageAppService_Tests: 11/11 passed. The Blazor and MudBlazor projects build; the Angular package was not built locally.
🤖 Generated with Claude Code