Update culture defaults and improve second-hand dropdown
Build and Push Docker Image / build-and-push (push) Successful in 1m21s

- Change default request culture to "nl-BE" and reorder supported cultures; remove "nl-NL"
- Refactor RegistryAdmin second-hand preference to use a string property for better nullable handling in the dropdown
This commit is contained in:
Arne Moerman
2026-07-01 15:27:49 +02:00
parent 50238b57c8
commit b1b7525759
4 changed files with 19 additions and 5 deletions
@@ -120,7 +120,7 @@ else
</div>
<div class="col-md-3">
<label class="form-label">@L["RegistryAdmin.SecondHandPreference"]</label>
<InputSelect class="form-select" @bind-Value="ItemModel.PreferSecondHand">
<InputSelect class="form-select" @bind-Value="PreferSecondHandString">
<option value="">@L["RegistryAdmin.SecondHandOptional"]</option>
<option value="true">@L["RegistryAdmin.PreferSecondHand"]</option>
<option value="false">@L["RegistryAdmin.NewOnly"]</option>
@@ -26,6 +26,21 @@ public partial class RegistryAdmin : ComponentBase
protected RegistrySettingsEditModel SettingsModel { get; } = new();
protected RegistryItemEditModel ItemModel { get; private set; } = new();
protected string PreferSecondHandString
{
get => ItemModel.PreferSecondHand switch
{
null => "",
true => "true",
false => "false"
};
set => ItemModel.PreferSecondHand = value switch
{
"true" => true,
"false" => false,
_ => null
};
}
protected IReadOnlyList<RegistryItemEditModel> Items { get; private set; } = [];
protected IReadOnlyList<RegistryItemCategoryEditModel> ItemCategories { get; private set; } = [];
protected string? NewCategoryName { get; set; }
@@ -8,9 +8,8 @@ internal sealed class LocalizationService(UserManager<ApplicationUser> userManag
{
private static readonly HashSet<string> SupportedCultureNames =
[
"en",
"nl-NL",
"nl-BE",
"en",
"fr-FR",
"qps-Ploc"
];
+2 -2
View File
@@ -149,8 +149,8 @@ builder.Services.AddLocalization(options =>
var supportedCultures = new List<CultureInfo>
{
new("en"),
new("nl-BE"),
new("en"),
new("fr-FR")
};
@@ -161,7 +161,7 @@ if (builder.Environment.IsDevelopment())
builder.Services.Configure<RequestLocalizationOptions>(options =>
{
options.DefaultRequestCulture = new RequestCulture("en");
options.DefaultRequestCulture = new RequestCulture("nl-BE");
options.SupportedCultures = supportedCultures;
options.SupportedUICultures = supportedCultures;
options.RequestCultureProviders =