fusionauth-issues icon indicating copy to clipboard operation
fusionauth-issues copied to clipboard

[Bug]: Inconsistent behavior in the login page language

Open z4m0 opened this issue 1 year ago • 1 comments

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.

image 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.

  1. Have a fusionauth instance with at least two languages "en" and "es" for example.
  2. Deploy the Simple theme
  3. Access the login page passing "?locale=es-ES"
  4. The form will be in Spanish but the selector will have "en" selected as value.
  5. 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

z4m0 avatar Oct 08 '24 08:10 z4m0

Thanks @z4m0 ! This seems to be a bug where the selector isn't properly updated by the parameter.

Thanks for the clear repro steps.

mooreds avatar Oct 21 '24 22:10 mooreds