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

Blazor WASM language resource not loading in subdirectories

$
0
0

I am trying to add internationalization for my Blazor WASM project. Users can change the language manually. I have moves all of the resource files to a one location and configured for the app to load resource files from that location in Program.cs. It works for one page but not working for the other.Can't figure out what's wrong in here.

This is in program.cs file

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

enter image description here

I have this line in LoginComponent.razor@inject IStringLocalizer<LoginComponent> Locand this in Home.razor@inject IStringLocalizer<Home> Loc

Languages loads in the Home component but not loading in the LoginComponent.

If I move each resource files to the directory where it's razor components in, and remove the options part from the AddLocalizer() it works perfectly.


Viewing all articles
Browse latest Browse all 4839

Trending Articles



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