0

Problem: There is no information in the keycloak documentation how to get locale information (which language was selected in the locale selector in the keycloak login page) in your app, after successfully logging in.

enter image description here

There is one place in the docs about localization (https://www.keycloak.org/docs/latest/server_admin/#enabling-internationalization) but it is not what i needed.

PS. I'm using keycloak-js lib.

Adi Dasler
  • 319
  • 4
  • 10

1 Answers1

0

Solution: 1) In the place where you init your app:

enter image description here

  1. After successful initialization, you can get parsed token:

enter image description here

And in that tokenParsed there is field named "locale"

enter image description here

Here is how to get parsed token in keycloak-js:

enter image description here enter image description here

Adi Dasler
  • 319
  • 4
  • 10