There are a lot of guys and most have things that make my code not work so i guess i'm missing something.I have a server side blazor app and i want the default language of the ui, or computer, to be the language selected
var supportedCultures = new[] { "fr-CA", "en-CA" };var localizationOptions = new RequestLocalizationOptions() .SetDefaultCulture(supportedCultures[0]) .AddSupportedCultures(supportedCultures) .AddSupportedUICultures(supportedCultures);@inject IStringLocalizerFactory Loc@using System.Globalization<PageTitle>Produits</PageTitle><div class="row"><h1>Produits</h1> @if (ProductCategories != null && ProductCategories.Count() > 0 && SelectedProductCategory == null) { foreach (ProductCategory productCategory in ProductCategories) {<button class="square-button" @onclick="(() => OnSelectCategory(productCategory.ID))"><img class="small-img" src="@productCategory.Image" /><br /><span class="button-text">@(CultureInfo.CurrentUICulture.Name.Contains("fr") ? productCategory.NameFR : productCategory.NameEN)</span></button> } }