Aspnetcore: Blazor client side satellite assembly loading for localization

Created on 22 Oct 2019  路  4Comments  路  Source: dotnet/aspnetcore

Hi,
I've created two .resx files (Localization and Localization.en-gb.resx). Both files have a build action set to "Embedded resource". After build I can see "en-gb" folder with sattelite assembly "MyApp.resources.dll".
When starting an app only MyApp.dll (main dll) is downloaded to the client so I can't use any of the resources defined in Localization.en-gb.resx file.

Is there any workaround for loading satellite assembly?

Is there any other (preferred) way to enable localization on blazor client side?

area-blazor question

All 4 comments

I use https://github.com/MarcStan/Resource.Embedder which embeds satellite assemblies inside the main assembly.
Then I use a JS interop script to get the browser language and change the current culture info.

@rborosak thanks for contacting us.

We are closing this issue as @campersau already provided a solution for this scenario.

@javiercn is this an official solution or just a current workaround? Should we do localization on blazor client side like this?

@rborosak No it isn't.

We haven't dive into this area as of yet. As we focus on blazor web assembly in the coming months it might be something we decide to tackle.

Was this page helpful?
0 / 5 - 0 ratings