Basic principles
In the Keycloak Admin Console you can enable localisation by selecting a set of language that you wish to support:

When Internationalization is enabled you will see a language dropdown select in your UIs:

If you eject some pages, you'll see in your component how the internationalization is actually implemented:

msg("backToLogin") gets rendered as « Back to LoginIf you want to see the base message translations you can navigate to the node_modules/keycloakify/src/login/i18n/messages_defaultSet/ directory:

As you can see, the translation message for the key backToLogin in English (en.ts) is:
We are <strong>sorry</strong> ...
As a result calling <p>{msg("backToLogin")}<p> returns the following JSX.Eement:
If you need to get the litteral string "We are <strong>sorry</strong> ..." instead of a JSX.Element you can use msgStr("backToLogin").
As a result calling <p>{@render msg("backToLogin")}</p> returns the following snippet:
As a result calling i18n.msgStr('errorTitleHtml') return the string "We are <strong>sorry</strong> ..." and you need to pass it sanitarized as [innerHTML] so that "sorry" be redered in bold:
What will actually be rendered in the DOM will be:
The purpose of the data-kc-msg attribute is to help you identify the i18n key of the text you want to change when inspecting the DOM.

Now that you get the main idea, let's see how to preview your pages in different languages:
Previewing Your Pages in Different LanguagesLast updated
Was this helpful?