[Multilingual Support] Resource strings are not displayed correctly

Hello, everyone.

I am suffering from a symptom that the Blazor project does not work as expected when I set up the multilingual settings.

I have added [en-US], [ja-JP], [de-DE] in the [Cultures settings] of Radzen and specified [en-US] as the default language. Resx files for the string resources have been created respectively, and the values there remain in the default English.

When I run this project, the display is not correct, as shown below. At design time, the English is displayed correctly.

Does anyone know how to solve this problem?

I referred to the following document on how to set up multilingual settings.
Blazor Internationalization (Blazor)

Hi @Yukishige,

I'm unable to reproduce such problem:




Hi , @enchev.
Thank you very much for testing to reproduce the issue.

After that,
I have checked again on my end and have the following new observations to add to the information.

(1) This current situation occurred in the case of Blazor - ClientSide (WebAssembly) project.
I have tried to reproduce twice, and both times it happened in the same way.
They were done using the same procedure from a new project.

  1. Create new Blazor Client-Side (WebAssembly) project [.NET 5].
  2. Create new DB with Sample Schema (SQL Server with local connect and Windows Authentication) .
  3. Create pages with CRUD option checked.
  4. Add [en-US],[ja-JP] Cultures as [en-US] default value.
  5. Run the project.

(2) For the Blazor - ServerSide project, this situation did not occur.
I tried twice and both are same result. It is working fine.

Are there any matters I should investigate from these results?

This is exactly what I've tested, except Windows security since it's not related.







Here is the application:
https://drive.google.com/file/d/1LFrWJkzkxJU8R26jEeTJIoZYRTWWNxBd/view?usp=sharing

Thanks, @enchev

I have downloaded the project you gave me and imported it into Radzen.
After that, I ran the project without making any changes, and the result is as you can see.

The problem has occurred.
It was the same on the other PC.

Can you try to clear your browser cache or open the app in incognito mode?

As far as I have experimented, this has happened on three different PCs as well. One thing they have in common is that the OS is Windows 10 Japanese version, but Blazor-ClientSideWassembly (configuration with both Client and Server) does not work correctly, while Blazor-ServerSide (configuration with only Server) works correctly (Server-only configuration).

My guess is that it is failing to load the string resource.
Isn't it a clue that Blazor-ServerSide has a single configuration, while Blazor-ClientSide has two independent configurations?

Not sure what kind of configurations you are referring - such problem was never reported before and I doubt that Japanese version of your OS is related. Try to clear your browser cache or open the application in browser incognito mode as I already suggested.

(1) Clear Cache
(2) Private mode on Firefox

(3) Private mode on Google Chrome

No effect...

then,
I did many try, and after changing the priority of the language used to English in the language settings on the Web browser side, the display became correct.

But,...

Since changes on the Web Browser side is something that we cannot handle without asking our customers, I would like to implement a solution for this problem on the Blazor side.

Do you have any ideas for a workaround?

This is the code that configures cultures in the application:

It seems that your browser is set to a culture not listed in supportedCultures?

I've read about that code on the MS site, and it's the same code in Blazor-ServerSide, and it works fine in Blazor-ServerSide, so I don't think it's a problem.

I found some information on the following site, is it related?

localization - Asp.Net Core Localized Resource in Separate Assembly - Stack Overflow

services.AddLocalization(ops => ops.ResourcesPath = "?????");

This code is for .NET Core application in general not for Blazor server-side only. Radzen will create WASM application hosted in a .NET server app.

I think that the issue can reproduce by changing the language setting of your browser as follows.

Could you please try it?

I was able to reproduce the problem - we will do our best to find a way to fix this.

It's great!

I am glad to hear that you were able to reproduce the problem and help you improve the quality of your product.
And most importantly, I hope you to solve this problem.

Best regards

It seems that it will work with parent cultures en and ja but not with specific cultures like en-US and ja-JP.


In the next update of Radzen we will list parent cultures as well - not only specific cultures:

Here is how cultures should be setup using the new version:


Thank you for providing the additional information.
I understand the situation now.

I changed all the language information strings to the parent language settings and ran it, but it did not make the problem better.
(I ran it on Visual Studio 2019)