dashboard
dashboard copied to clipboard
Add locale selector to log in page
The goal of this ticket is to add the Locale Selector to the login page of dashboard.
Currently it is only available in the slide-in menu once you are logged in (bottom-right of the slide-in).
I suggest adding it to the bottom-left of the login page - you should be able to leverage the control straight from the slide-in menu - see: TopLevelMenue.vue around line 362. You will need to extract that into a new component that can be used both in the TopLevelMenu and the login screen (shell/pages/auth/login.vue).
On the login screen, we don't know who the user is, so we can't retrieve their locale preference from the backend.
I suggest that we cache the locale in browser local storage
On the login screen:
- If there is no cached locale, we default to English, otherwise we use the locale that has been cached
- When the user changes the locale on the login screen, we update the cache and store in the app that the locale was changed
- Once the user logs in, we will have their locale preference from the backend
- if the locale was changed on the login screen, we update the user preference with the new locale - this will then be stored by the backend
- If the locale was not changed, we update the cached locale in the browser with the value from the user preference if this is different to what is currently cached