Theme Localization

Overview

The FusionAuth theme can be localized to better server your end users. In each theme you may specify one to many language specific message bundles to translate text rendered in a theme into a user’s preferred language.

If you’re just looking into localizing your theme, take a look at our community provided and maintained message bundles. https://github.com/FusionAuth/fusionauth-localization

Messages

In the Messages tab of your theme editor you may specify one to many languages. Once you have specified a key and value the key may be used in any template to display a localized string.

Consider the following message bundle and theme usage example with English and German messages defined.

English
greeting=Good day
German
greeting=Guten Tag
Template
<p>${theme.message('greeting')}</p>

If I have selected German as my locale, I will be greeted with Guten Tag rendered on the page, if I have English selected I will instead find the greeting Good day.

Locale

The locale is determined by the locale value. The locale is resolved on each request using the following precedence:

  1. The locale request parameter if present on the HTTP request. This is useful if you already know the user’s preferred locale prior to redirecting them to FusionAuth to complete authentication.

    Example request

    GET /oauth2/authorize?client_id={client_id}&redirect_uri={redirect_uri}&response_type=code&tenantId={tenantId}&locale=fr

  2. The user selects a language during login using the locale selector

  3. The HTTP Accept-Language header if present on the HTTP request

  4. The system default locale as determined by the underlying operating system