I am working with MAUI Blazor 3 projects.
...App (MAUI hosting a Blazor View)
...App.Shared
...App.Web (Blazor Web)
I am having issues getting localization to work in this project. I have tried the following to try to solve the problem.
Program.cs (.Web Project)
builder.Services.AddLocalization(options => options.ResourcesPath = "Resources");var app = builder.Build();var supportedCultures = new[] { "en-GB", "en-US", "fr-FR", "en-ZA" };var localizationOptions = new RequestLocalizationOptions().SetDefaultCulture(supportedCultures[0]) .AddSupportedCultures(supportedCultures) .AddSupportedUICultures(supportedCultures);app.UseRequestLocalization(localizationOptions);Resources (.Shared Project)
My Resource file looks like this:
My Component UserMenu is located in the folder Layout > Top.
UserMenu.razor
@inject IStringLocalizer<Resources> Localizer@Localizer["MyProfileLabel"]Imports.razor
@using ...Shared.ResourcesThe output is MyProfileLabel
I have tried adding a RootNamespace in the assemblyinfo.cs in both the ...Shared and ...Web projects.
[assembly: RootNamespace("...App.Web")]
I also added the following reference to my ...App.Web & App.Shared project
I also tried to use a middleware to set the cookie on the request.
public class LocalisationMiddleware() : IMiddleware{ public async Task InvokeAsync(HttpContext context, RequestDelegate next) { // check if cookie already exists var cookie = context.Request.Cookies[CookieRequestCultureProvider.DefaultCookieName]; if (cookie != null) { context.Response.Cookies.Append( CookieRequestCultureProvider.DefaultCookieName, CookieRequestCultureProvider.MakeCookieValue( new RequestCulture( CultureInfo.CurrentCulture, CultureInfo.CurrentUICulture))); } await next(context); }}The output is MyProfileLabel
The App compiles and runs but no localization.


