keycloak-scim/server_admin/topics/realms/themes.adoc

77 lines
3.3 KiB
Text
Raw Normal View History

[[_themes]]
= Configuring themes and internationalization
2016-05-13 19:49:56 +00:00
For a given realm, you can change the appearance of any UI, including the language that appears, in {project_name} by using themes.
2016-05-13 19:49:56 +00:00
.Procedure
2016-05-13 19:49:56 +00:00
. Click *Realm Setting* in the menu.
2016-05-13 19:49:56 +00:00
. Click the *Themes* tab.
+
.Themes Tab
image:{project_images}/themes-tab.png[Themes Tab]
2016-05-13 19:49:56 +00:00
. Pick the theme you want for each UI category and click *Save*.
+
2016-05-13 19:49:56 +00:00
Login Theme::
Username password entry, OTP entry, new user registration, and other similar screens related to login.
2016-05-13 19:49:56 +00:00
Account Theme::
Each user has an User Account Management UI.
2016-05-13 19:49:56 +00:00
Admin Console Theme::
2017-08-28 12:50:14 +00:00
The skin of the {project_name} Admin Console.
2016-05-13 19:49:56 +00:00
Email Theme::
2017-08-28 12:50:14 +00:00
Whenever {project_name} has to send out an email, it uses templates defined in this theme to craft the email.
2016-05-13 19:49:56 +00:00
.Additional resources
* The link:{developerguide_link}[{developerguide_name}] describes how to create a new theme or modify existing ones.
== Enabling internationalization
Every UI screen is internationalized in {project_name}. The default language is English, but you can choose which locales you want to support and what the default locale
will be.
.Procedure
. Click *Realm Settings* in the menu.
2016-05-13 19:49:56 +00:00
. Click the *Theme* tab.
2016-05-13 19:49:56 +00:00
. Set *Internationalization* to *ON*.
2016-05-14 14:48:22 +00:00
The next time a user logs in, that user can choose a language on the login page to use for the login screens, Account Console, and Admin Console.
2016-05-14 14:48:22 +00:00
.Additional resources
* The link:{developerguide_link}[{developerguide_name}] explains
how you can offer additional languages. All internationalized texts which are provided by the theme can be overwritten by realm-specific texts on the *Localization* tab.
[[_user_locale_selection]]
== User Locale selection
A locale selector provider suggests the best locale on the information available. However, it is often unknown who the user is. For this reason, the previously authenticated user's locale is remembered in a persisted cookie.
The logic for selecting the locale uses the first of the following that is available:
* User selected - when the user has selected a locale using the drop-down locale selector
* User profile - when there is an authenticated user and the user has a preferred locale set
* Client selected - passed by the client using for example ui_locales parameter
* Cookie - last locale selected on the browser
* Accepted language - locale from *Accept-Language* header
* Realm default
* If none of the above, fall back to English
When a user is authenticated an action is triggered to update the locale in the persisted cookie mentioned earlier. If the
user has actively switched the locale through the locale selector on the login pages the users locale is also updated at
this point.
If you want to change the logic for selecting the locale, you have an option to create custom `LocaleSelectorProvider`. For details, please refer to the
link:{developerguide_link}#_locale_selector[{developerguide_name}].
When a user is authenticated, an action is triggered to update the locale in the persisted cookie mentioned earlier. If the user has actively switched the locale through the locale selector on the login pages, the user's locale is also updated at this point.
If you want to change the logic for selecting the locale, you have an option to create a custom `LocaleSelectorProvider`. For details, see the
link:{developerguide_link}#_locale_selector[{developerguide_name}].