[keycloak-dev] Shared messages between themes

Stian Thorgersen sthorger at redhat.com
Thu Sep 12 09:20:30 EDT 2019


On Thu, 12 Sep 2019 at 12:55, cedric at couralet.eu <cedric at couralet.eu> wrote:

> Do you mean copy all the messages which are in the
> theme/base/(account,login,admin...) and group them in an unique file in a
> theme-ressource?
>

One reason why it is split is that it makes it possible to translate only
for example login pages, but not have to translate admin console. For that
reason only common messages should be moved to the shared message bundle.


> I could be interested as it could ease doing translations.


Great


> Which module could be used for that (core, common, a new one)?
>

Should be added to:
themes/src/main/resources/theme-resources/messages/messages_en.properties

There's a small tweak that needs to be done to support this. Right now
built-in themes are loaded from KC_HOME/themes directory, which doesn't
have support for theme-resources. So I can see two options:

a) Add KC_HOME/theme_resources and have it loaded as a theme resource
b) Delete built-in themes from base, then go back to including themes as a
JAR. themes/README.md should then be updated to include instructions on how
to find built-in themes.

I'm in favour of option b as built-in themes should not be modified
directly. Should also make upgrading easier as the whole themes directory
can be copied from one version to the next, rather than now individual
themes within has to be copied separately to not override updated built-in
themes.


> What would need to be tested ?
>

Existing tests will test some of it I believe, but will probably be good to
add some additional tests to make sure that login, admin and account all
are able to load common messages. We'll probably also need to carefully
review the PR and do some manual testing when reviewing.


>
>
> Le Mercredi, Septembre 11, 2019 08:07 CEST, Stian Thorgersen <
> sthorger at redhat.com> a écrit:
>
> >  We recently had a contribution to enable messages in theme resources
> [1].
> > Messages from theme resources are loaded before any messages from themes
> > and are available to all themes.
> >
> > This would make it easy to create a built-in theme resource with shared
> > messages between all themes.
> >
> > Even better we can extract shared messages from the English message
> bundle.
> > Then other translations can be done later by the community as wanted.
> >
> > Anyone interested in picking this work up?
> >
> > [1] https://issues.jboss.org/browse/KEYCLOAK-8818
> > _______________________________________________
> > keycloak-dev mailing list
> > keycloak-dev at lists.jboss.org
> > https://lists.jboss.org/mailman/listinfo/keycloak-dev
>
>


More information about the keycloak-dev mailing list