Community Health Toolkit

Where is CHT-User's locale setting stored?

Is CHT-User’s language setting saved per device or per user?
If I log-in as one of the CHT-User on CHT framework and change my default language from whatever was before to English, will it be updated on other device where same CHT-User is logged in? Is user preference stored on device user is logged or in the database?

1 Like

Prior to 3.9.0 the user’s language was stored in the database and set after logging in, so it was shared between devices.

In CHT Core 3.9.0 we added a locale picker to the login page. When an unknown user visits the login page the CHT attempts to pick the best language for the user based on the user’s browser settings or the configured default language. The user can pick their preferred language. When they log in this value is set in a cookie so even if they’re logged out in the future the login page will show in their selected language. If that same user goes to the login page on a new device then whatever they select from the locale picker will be stored in the cookie on the new device and the other device will not be updated.

In summary, before 3.9.0 the locale was stored on the user in the database, after 3.9.0 the locale is stored in one cookie per device and the value in the database is ignored.