Quantcast
Channel: Active questions tagged blazor - Stack Overflow
Viewing all articles
Browse latest Browse all 4839

Blazor wasm localization showing just keys

$
0
0

Followed Dynamically set the culture from the Accept-Language header to localize my blazor wasm app.

WebUI.csproj

<BlazorWebAssemblyLoadAllGlobalizationData>true</BlazorWebAssemblyLoadAllGlobalizationData>

Program.cs

builder.Services.AddLocalization(options => options.ResourcesPath = "Resources");

Added folder:

Resources   Shared.resx   Shared.en.resx

_Imports.razor

@using WebUI.Resources

In view:

@using System.Globalization@inject IStringLocalizer<Shared> loc@CultureInfo.CurrentCulture@loc["countries"]

Culture is showing DE-DE. @loc["countries"] just prints countries instead of the localization. Any ideas why?


Viewing all articles
Browse latest Browse all 4839

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>