aksoftware98 / multilanguages

AKSoftware.Localization.MultiLanguages is a package for .NET developers allows them to easily build apps target multiple languages with just few lines of code
MIT License
85 stars 14 forks source link

Switching language on Blazor-server affects all opened sites #31

Closed AmirImam closed 2 years ago

AmirImam commented 2 years ago

Hi, In blazor-server if the language has been changed, it will affects any opened site. I think this happening because the service life cycle is Singleton, not Scoped

aksoftware98 commented 2 years ago

Thank you so much for this important update. I will start working on that to get it fixed.

spyofborg commented 2 years ago

Hi, Sorry to ask, since this is from Jul 25, but has this been fixed?

I think my problem is related to this, as long as I have ONE website open, it seems to work, the moment the app is open on more than one browser I get an exception:

The current thread is not associated with the Dispatcher. Use InvokeAsync() to switch execution to the Dispatcher when triggering rendering or component state.

Is this issue related to the service life cycle not being scoped?

Thank you!

aksoftware98 commented 2 years ago

Hi

No worries thanks for reaching out!

I am currently working on version 6.0 of the library and the fix will be there for this issue, hopefully, the fix will be pushed by Sept 20th

Thanks

spyofborg commented 2 years ago

OK, that would be just in time.

I'm making a website for students and the new academic year has started, so I will have to push the website very soon.

If you will be able to push it by Sept 20th, that would be just in time, for now, I will disable the change language part.

Thank you very much, your work is appreciated since it is a lot less complex than using the Microsoft way.

aksoftware98 commented 2 years ago

@spyofborg Due to your high urgency situation, I have fixed the issue of Blazor Server before releasing version 6.0 which contains the big update

Thank you @AmirImam for your patience and sorry for the late reaction

The new version adds full support to Blazor Server and fixes all the problems all you need to do is upgrade the Blazor Library to version 1.5 and the Multilanguages library to version 5.8 and change this line of code in your Program.cs

And boom you are up and running Thanks again

AmirImam commented 1 year ago

@spyofborg Due to your high urgency situation, I have fixed the issue of Blazor Server before releasing version 6.0 which contains the big update

Thank you @AmirImam for your patience and sorry for the late reaction

The new version adds full support to Blazor Server and fixes all the problems all you need to do is upgrade the Blazor Library to version 1.5 and the Multilanguages library to version 5.8 and change this line of code in your Program.cs

And boom you are up and running Thanks again

What line must be changed in Program.cs?

spyofborg commented 1 year ago

Dear,

Thank you very very much for this update.

Everything works as a charm now!

Every website keeps their own language now, storage to keep the users chosen language, all works!

Great job!

Greets,

SpyofBorg

On 2022-09-18 15:15, AmirImam wrote:

@spyofborg [1] Due to your high urgency situation, I have fixed the issue of Blazor Server before releasing version 6.0 which contains the big update

Thank you @AmirImam [2] for your patience and sorry for the late reaction

The new version adds full support to Blazor Server and fixes all the problems all you need to do is upgrade the Blazor Library to version 1.5 and the Multilanguages library to version 5.8 and change this line of code in your Program.cs

And boom you are up and running Thanks again

What line must be changed in Program.cs?

-- Reply to this email directly, view it on GitHub [3], or unsubscribe [4]. You are receiving this because you were mentioned.Message ID: @.***>

Links:

[1] https://github.com/spyofborg [2] https://github.com/AmirImam [3] https://github.com/aksoftware98/multilanguages/issues/31#issuecomment-1250208611 [4] https://github.com/notifications/unsubscribe-auth/APBCCXOS4YHQLYWKUJZ7XS3V626R3ANCNFSM5XHWRTBQ

aksoftware98 commented 1 year ago

@spyofborg Due to your high urgency situation, I have fixed the issue of Blazor Server before releasing version 6.0 which contains the big update Thank you @AmirImam for your patience and sorry for the late reaction The new version adds full support to Blazor Server and fixes all the problems all you need to do is upgrade the Blazor Library to version 1.5 and the Multilanguages library to version 5.8 and change this line of code in your Program.cs And boom you are up and running Thanks again

What line must be changed in Program.cs?

Opps sorry @AmirImam I forgot to put the link in here What's New in Version 5,8.0

aksoftware98 commented 1 year ago

Dear, Thank you very very much for this update. Everything works as a charm now! Every website keeps their own language now, storage to keep the users chosen language, all works! Great job! Greets, SpyofBorg On 2022-09-18 15:15, AmirImam wrote: > @spyofborg [1] Due to your high urgency situation, I have fixed the > issue of Blazor Server before releasing version 6.0 which contains the > big update > > Thank you @AmirImam [2] for your patience and sorry for the late > reaction > > The new version adds full support to Blazor Server and fixes all the > problems all you need to do is upgrade the Blazor Library to version > 1.5 and the Multilanguages library to version 5.8 and change this line > of code in your Program.cs > > And boom you are up and running Thanks again What line must be changed in Program.cs? -- Reply to this email directly, view it on GitHub [3], or unsubscribe [4]. You are receiving this because you were mentioned.Message ID: @.***> Links: ------ [1] https://github.com/spyofborg [2] https://github.com/AmirImam [3] #31 (comment) [4] https://github.com/notifications/unsubscribe-auth/APBCCXOS4YHQLYWKUJZ7XS3V626R3ANCNFSM5XHWRTBQ

@spyofborg Thank you so much for nice feedback, so happy to hear that everything works fine for you Stay tuned for Version 6.0.0 where there will be a much more powerful translator and no longer use strings to access your keys, as the library will generate a static class for all your keys every time you build the project.

Thanks