Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Localization of custom keycloak login theme

Tags:

keycloak

I am implementing a custom login page for keycloak (version 2.5), by following this guide. I added my own custom styling, now I am trying to add the Dutch locale. Currently no Dutch locale is provided, so I provided following properties files:

  • themes/mytheme/login/messages/messages_en.properties
  • themes/mytheme/account/messages/messages_en.properties
  • themes/mytheme/email/messages/messages_en.properties

with the locale_nl=Nederlands property. After that I added the messages_nl.properties files with the translation strings.

Next I added the locales=en,nl,de property to following files:

  • themes/mytheme/login/messages/theme.properties
  • themes/mytheme/account/messages/theme.properties
  • themes/mytheme/email/messages/theme.properties

There is only one thing left to do: add the Dutch locale in the admin console. But I can't select the NL locale after I enabled internationalization. I can only select the English and German locale, my just created Dutch locale is not available:

enter image description here

According to Multilingual support and adding custom Locales in Keycloak, I should be able to add my own locale by just typing the locale and hitting 'enter', but that does not do anything.

I am missing a step here?

like image 246
Jacob van Lingen Avatar asked Jan 25 '17 15:01

Jacob van Lingen


1 Answers

After reading the code, I understood only adding the files is not enough. You need to enable your theme not only for the login theme, but also for the account and email themes:

enter image description here

As I only changed the login theme to my own 'custom-theme', the Dutch locale did not show up.

like image 78
Jacob van Lingen Avatar answered Sep 19 '22 14:09

Jacob van Lingen



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!