Open JerseyTechGuy opened 2 years ago
Hi @JerseyTechGuy, I had no luck finding any way to implement the ResourcePath in WASM because all the localizer action happens in non async mode and loading resources would require an async context. Have a look at the examples, in the most recent version the wasm does load resources through embedded resources.
I have a Blazor App already using localization. It is a Wasm app with an API backend. I already had both French and English resx files in the Resources folder. Was configured in the Program.cs as follows.
builder.Services.AddLocalization(options => options.ResourcesPath = "Resources")
I created a new json file called localization in the Resources folder. Added the following to the program.cs in place of the above code.
The error I am getting is JsonFileList is required in Client WASM mode. I assume this is because it is not finding any json files? Any help you could provide diagnosing would be appreciated. I did check the json file and it is marked as an EmbeddedResource as was the Resx files.