Theme translation messages support
See original GitHub issueI would like to add translation files to the theme.
Expected behaviour
Keycloak documentation on internationalization states that in order to support a custom language two steps are neccessary:
- create a
messages*
file inside the theme folder - modify
theme.properties
by adding thelocales= ...
entry
Actual state
(1) Messages
I was investigating if translations are already supported. AFAIK the build theme script generateKeycloakThemeResources.js
only copies the resources
folder to the theme
folder. The messages
folder is not mentioned in the script.
To be clear what I was looking for: Keycloak expects the messages
folder next to the resources
folder.
META-INF/keycloak-themes.json
theme/mytheme/login/theme.properties
theme/mytheme/login/login.ftl
theme/mytheme/login/resources/css/styles.css
theme/mytheme/login/resources/img/image.png
theme/mytheme/login/messages/messages_en.properties
theme/mytheme/email/messages/messages_en.properties
Maybe I am missing something here, so any help regarding adding translation files would be much appreciated.
A workaround would be to add the messages
folder to the theme by updating a jar
package once it is compiled, but that is not a permanent solution.
(2) Modify theme.properties
I think this pull-request solves it: https://github.com/InseeFrLab/keycloakify/pull/18
Issue Analytics
- State:
- Created 2 years ago
- Comments:9
There is now a proper
i18n
API in Keycloakify v6 (6.0.0-beta.13
) 🥳https://docs.keycloakify.dev/v/v6/i18n
Hi @loki344,
Keycloak v6 is just around the corner (actually it’s even released in beta) and features an actual support for i18n customisation along side with significant optimisations on the bundle size.
It’s not fully documented yet but https://github.com/garronej/keycloakify-demo-app-css-only https://docs.keycloakify.dev/v/v6/