Localization issues for translating "Categories" when using LDAP
Description
When using LDAP authenticator, connected users always see categories (Music, Meeting, etc.) in english, although the rest of the interface is translated in the local language. It is observed for french localization at least.
Steps to Reproduce
- Configure Mobilizon with an LDAP authentication backend
- Connect as a new user, it will create the entry in the public.users DB table
- After refreshing cache, when connected as this user, categories appear in english (you may need to first create an event, categories will be translated, but then when displaying/creating new events it will switch to english. Caching issues I think, probably on my side)
- The remaining of the interface is still well translated
- Logout, refresh with shift-reload for cache, then as an unconnected user categories are well translated again
Expected behaviour:
Category names should be translated for connected users
Actual behaviour:
Category names are not translated for connected users
Reproduces how often:
Always
Versions
Mobilizon v3.0.4 Docker version, following the guide
Additional Information
After some digging :
- There are several localization settings :
- The browser localization in the GET query
- The user-locale key in the local storage of the browser. This one is updated when the user changes its settings in the settings page of Mobilizon
- The locale column of the public.users table in the postgresql server. This one is not updated when the user changes its settings in the settings page of Mobilizon
- When I create a user :
- If I use the LDAP backend, the locale column in the public.users table is 'en'
- If I do not use LDAP, the locale column in the public.users tables is 'fr' (which is more "local" for me...)
- If I change 'en' to 'fr' in the public.users table for an LDAP account (using command-line psql), categories become well translated !
So it seems that :
- public.users locale column is not customized during an LDAP creation
- public.users locale column is perhaps somewhat redundant with the local storage of the browser ?
- most of the interface uses the locales set in the local storage of the browser, whereas some parts such as categories use the public.users table, which may be a bug ?
- public.users locale column is not updated when the user changes its language in the settings pane of mastodon
Cheers !!!
François
Edited by Francois Lesueur