How should we handle the default language on the login screen? (BAH-319 and beyond)

Continuing the discussion from Set Bahmni Login Locale to Spanish by Default:

Currently, the Bahmni login screen always defaults you to English, even if you’ve tried to configure a different language to come first. (@cristian describes in the other thread)

(The reason is that we have “en” hardcoded in the JavaScript code.)

I’d like to do a quick fix for this in this ticker, and potentially consider a larger fix in the future, so I’d like some input…

  1. As long as we have a language dropdown on the login screen, it should default to the configured first language, and not have English hardcoded as a default. (Nobody should disagree with this!)
    • if I log in in the secondary language, do some work, and log out (or my session times out), then the next time someone looks at the login screen in the same browser, should it default to the system’s configured first language, or to the language I last used?
  2. An alternative approach would be for user to (optionally) have a preferred language configured, so when they log in their preferred language is automatically activated. The OpenMRS Reference Application does it this way. (This might mean removing the language dropdown.) Would anyone prefer this to the current behavior?

The pattern I’ve seen that works well is a user language preference that defaults to “Last used” but can be set to a specific language. So, default behavior is to use whatever was last used. That pattern would work well when users use their own device.

To support situations where a device is shared, then you’d probably want an admin to be able to set a device default that, if set, would override any user preference.