huridocs / uwazi

Uwazi is a web-based, open-source solution for building and sharing document collections
http://www.uwazi.io
MIT License
237 stars 79 forks source link

UI does not respect the default language #6843

Closed salvalacruz closed 3 months ago

salvalacruz commented 4 months ago

In Uwazi instances with more than one language installed, it seems that the UI always appears in English at login.

To reproduce the problem:

I believe that this behaviour was different some weeks ago.

RafaPolit commented 4 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?

mfacar commented 4 months ago

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.

Zasa-san commented 3 months ago

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.