Language selection doesn't work as expected with country suffix

Hi folks,

we’ve implemented Auth0 on a React SPA, and stumbled on a weird issues with localisation.

The language selection works when the user has “German [de]” as an accepted language but not with “German (Germany) [de-DE]” nor “German - Austria (de-AT)”

Our app sends the parameter ui_locales=de en and and both German (en) and English (en) are enabled in Tenant Settings.

  • German locale seems to kick in only if the user has the specific German (de) language set in their browser. The actual Accept-Language: … string is German - Germany (de-DE) or German - Austria (de-AT)
  • Even with ui_locales=de en in the request, Auth0 will automatically fall back to the browser accepted languages, and not match ui_locales=de with Accept-Language: de-DE,en-GB;q=0.8,en-US;q=0.5,en;q=0.3

Any suggestion would be appreciated.

Thanks!

As I was writing this post, I realised that the problem may come from the “English (en)” language being there and being a better match than the others. It’s also not a common/default header and less relevant to us.

Praise the ducky!

1 Like

Thanks for letting others know!

1 Like

This topic was automatically closed 15 days after the last reply. New replies are no longer allowed.