[keycloak-dev] Shared messages between themes

Stian Thorgersen sthorger at redhat.com
Thu Sep 19 03:40:31 EDT 2019


Started a separate thread on removing built-in themes from themes
directory, just to make sure there's no objections. People may miss it when
it's discussed as part of this thread.

On Thu, 19 Sep 2019 at 09:37, Stian Thorgersen <sthorger at redhat.com> wrote:

>
> On Tue, 17 Sep 2019 at 21:29, cedric at couralet.eu <cedric at couralet.eu>
> wrote:
>
>> Le Jeudi, Septembre 12, 2019 15:20 CEST, Stian Thorgersen <
>> sthorger at redhat.com> a écrit:
>>
>> > 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.
>> >
>>
>> ok, for now I took the messages which appear more than one time (same
>> key, same value) in one of the messages_en.properties, but it will need to
>> be validated.
>>
>> >
>> > > 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.
>> >
>>
>> I am not familiar with how is built keycloak on top on wildfly (and I
>> don't see much documentaiton about that). What I did was create a module
>> keycloak-theme and change the keycloak-server xml (in wildfly module) to
>> add the theme module keycloak-theme. It seems to work but not sure if it is
>> the right way ?
>>
>
> That is the correct way
>
>
>>
>>
>> >
>> > > 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.
>> >
>>
>> Before I create that PR, is there a JIRA with that idea ? Should I create
>> one?
>>
>
> Added JIRA https://issues.jboss.org/browse/KEYCLOAK-11489
>
>
>> > >
>> > >
>> > > 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