
Multilingual support and adding custom Locales in Keycloak
Keycloak 1.2.0 Final was released recently with tons of new features one of my favourites was Multilingual support for the login, account and admin pages. So this post will be a walkthrough on how to enable multilingual support in keycloak and how to add custom Local(messages in differnent languages) in keycloak.
- To create new Locales just go to the web Keycloak’s web admin console > select your realm>settings>Themes tab.
Here you can enable internationalization and type a Locale(if already not present in dropdown) and hit enter.
I am creating a new Locale called test,but its advisable that you give a more meaningful name that goes with the naming convention e.g. in-EN (for Indian English)
- Then you will have to create a property file for the messages(that will contain the text in the new language).I am giving an example for login page but you can use the same every where.
- open folder “KEYCLOAK_HOME/standalone/
configuration/themes/base/ login/messages” - create a file messages_NEWLOCALE.properties and enter the messages in the translated language(in our case the file name will be messages_test.properties).
You can use the existing properties files as reference.
Here KEYCLOAK_HOME is the location where keycloak is located and NEWLOCALE should be the name of the local you have created.
- open folder “KEYCLOAK_HOME/standalone/
- And that’s it ! Easy right?
You can go to the login page now and select from the dropdown to check.
I have demoed the login page but it is exactly the same process for the rest of the pages. Hoping this helps. Thanks for reading 🙂
This site uses Akismet to reduce spam. Learn how your comment data is processed.
Calendar
M | T | W | T | F | S | S |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | 5 | 6 | 7 |
8 | 9 | 10 | 11 | 12 | 13 | 14 |
15 | 16 | 17 | 18 | 19 | 20 | 21 |
22 | 23 | 24 | 25 | 26 | 27 | 28 |
29 | 30 |
Leave a Reply