[Bug]: Inconsistent behavior in the login page language
What happened?
There is inconsistency in the hosted login page using the Simple theme with the language of the form and the language selector if the user has a 4 letter browser language but the available languages are only two letter languages.
This causes confusion to the user thinking that the right language was selected.
The user has "ca-ES" as primary language but the selector has "ca" and "en" as available options only. The form is as expected but the selected language is "en" (the default) instead of "ca".
In the example the value of the navigator.languages in the browser is:
['ca-ES', 'en-US', 'en', 'es-ES', 'es', 'ca']
Steps to reporoduce
It is possible to reproduce using query params too.
- Have a fusionauth instance with at least two languages "en" and "es" for example.
- Deploy the Simple theme
- Access the login page passing "?locale=es-ES"
- The form will be in Spanish but the selector will have "en" selected as value.
- When the user logs in the passed query param will be "locale=en"
Expected behavior
The UI should be at least consistent otherwise the users are confused. It is preferrable to have the form behavior selecting the two letter code first.
Version
1.53.2
Affects Versions
No response
Thanks @z4m0 ! This seems to be a bug where the selector isn't properly updated by the parameter.
Thanks for the clear repro steps.