Closed salvalacruz closed 3 months ago
Apparently some of the processes are overwriting the cookie value? Apparently the cookie does not have a sessionId? Could that be a problem? Also, it could be interesting to list the logic with which we choose the language: default language is ONE of the params, maybe we are taking into account the system language? Location?
We have this priority at the moment of setting locale
:
getURLLocale(urlLanguage, languages) || getCookieLocale(cookie, languages) || getDefaultLocale(languages)
The problem is that we are always setting 'en' as the default language here, consequently the default locale of settings is never taken.
It's worth mentioning that with https://github.com/huridocs/uwazi/pull/6850 the fix is for new visitors.
@salvalacruz mentions login in and out of an instance and not seeing the changes in default language. This will continue being the case, and I think that's the intended experience. If I switch to a language that is not default, login in or out will not force me to navigate to the default language. New users (or returning users if their cookies expired) will have the instance in the default language.
In Uwazi instances with more than one language installed, it seems that the UI always appears in English at login.
To reproduce the problem:
Log in to an instance and install two or more languages from ‘/settings/languages’.
Select a default language other than English.
Log out of the system; log in to Uwazi again.
Problem: the instance is back to the English UI.
If you select another language, the UI changes accordingly, but when logging out and logging in again, it insists on English.
I believe that this behaviour was different some weeks ago.