Changing Language doesn't apply coherently
Closed this issue · 4 comments
Hi,
I have my Language buttons in my footer. I use the languageContainer in my footer and on the main page. My MainLayout is like this:
<div class="main"> @Body </div> <Footer />
When clicking on a language button the footer changes language immediately but on the mainpage is still the old text. I also use Blazored.LocalStorage.ILocalStorageService to store which language was selected last. I check this in OnInitializedAsync
of the MainLayout
Component and set the language. Now if I reload the page after changing the language the mainpage has applied the change but the footer is in default language.
In short:
Default Lang: en
press "German" button in the footer:
footer is German
Mainpage still english
reload the page right after that:
footer is english
mainpage is German
How can i make the change cascade down to all content?
Hi thank you so much for reaching out
Regarding this it is related to how Blazor renders the components
To make a cascade rendering I highly recommend this article for Microsoft that shows you how to do that step by step
https://docs.microsoft.com/en-us/aspnet/core/blazor/state-management?view=aspnetcore-3.1
Did you solve this issue @Krackerer ?
Hi thank you so much for reaching out
Regarding this it is related to how Blazor renders the components
To make a cascade rendering I highly recommend this article for Microsoft that shows you how to do that step by stephttps://docs.microsoft.com/en-us/aspnet/core/blazor/state-management?view=aspnetcore-3.1
did not get it can you explain? @aksoftware98
This is issue has been solved in the latest release of the library and now you have a new library to solve that issue kindly check out the documentation and the following library
AKSoftware.Localization.MultiLanguages.Blazor