modxcms / revolution

MODX Revolution - Content Management Framework
https://modx.com/
GNU General Public License v2.0
1.36k stars 529 forks source link

The selected language of the manager panel is reset after exiting the manager #16072

Open Ruslan-Aleev opened 2 years ago

Ruslan-Aleev commented 2 years ago

Bug report

Summary

My current system language is "Russian", I choose, for example, "German", I work with the manager in "German", everything is fine. But then I exit the manager, and when I enter the manager, on the login form, everything will be in "Russian" again, and I again need to select "German".

When you log out from the manger, the session is destroyed and the manager_language setting is gone. That's the issue here.

The only option is to save this in a cookie or in the local storage, but thats not part of this fix and has to be done elsewhere...

Originally posted by @Jako in https://github.com/modxcms/revolution/pull/16069#issuecomment-1047782380

Expected behavior

The selected language must be saved, otherwise the meaning of changing the language is lost

Related issue(s)/PR(s)

https://github.com/modxcms/revolution/issues/14694 https://github.com/modxcms/revolution/pull/16069

Environment

MODX 3

opengeek commented 2 years ago

Why would you not set the manager_language for the user?

Ruslan-Aleev commented 2 years ago

Well, that would probably work as a quick fix. But I'm talking about the fact that extra actions appeared in MODX 3 and the language will not be saved at all, although this was not the case either in MODX 2 or in any product where you can change the language. What is the point of changing the language if it is reset when you log out? Does this require discussion?

Ruslan-Aleev commented 2 years ago

Maybe it's worth returning the system setting (or add user setting), in which the value of the selected language would be written?

opengeek commented 2 years ago

I'm lost on why the user_setting is not being set. That's how you change the language if it is a user-specific change.

Jako commented 2 years ago

My current opinion on this issue:

This problem can be solved quite easily by changing/adding a user setting. So should the user setting be changed permanently when switching the language? Not for me, as changing the user setting does not happen very often and is 4-5 clicks away in the manager. We can think about a default language combination on the security/profile page to reduce these clicks. Maybe the user setting grid can be added to that page by option.

prbt2016 commented 2 years ago

Hello,

Even i face the same issue when I tried installing MODX 3.0.0-pl from https://modx.com/download with Traditional installation package with Spanish language .

After installation when I login to manager I see that the language is reset to English.

This happens also while upgrading from 2.8.3-pl to 3.0.0-pl.

Is there any turnaround or fix for this rather than manually setting language each time via the language toggle in admin panel?.

Jako commented 2 years ago

The manager will use the browser default language as first selected language (if I remember right): https://www.computerhope.com/issues/ch001904.htm

But to have this permanently changed for a user, create or edit a user setting manager_language and set this to the wanted language.

dimasites commented 7 months ago

I just installed MODX 3 for my client and confused with manager language: image

I confirm cool UX with browser default language as @Jako said, and when Login page appears on my browser language it looks great!

BUT when i chage language on manager and re-login (exit then login again) i expect manually changed laguage, but when my session was destroed, i see "cool feature with browser language" and it is not cool for me in that case.

May be we just make redirect to Login page with GET/POST-param to prefer selected manager language and its resolve this issue. I make simple test and solution looks as not complex: image

@Ruslan-Aleev WDYT ?

Ruslan-Aleev commented 7 months ago

@dimasites The simpler the solution, the better =) So if the get parameter fixes this problem, I'm all for it.