Skip to content

Localization in Asgardeo

Asgardeo lets you pick the language for the following interfaces exposed to business users.

  • User registration, sign-up, login and the account recovery flows.
  • My Account (self-care portal).

The default language on these interfaces is configured as explained in the language settings section.

Important

In the user sign-up and attribute consent screens, Asgardeo only translates the default user attributes.

These interfaces support i18n, allowing Asgardeo to load text content from i18n resource files. This ensures that your business users can experience these use cases in their preferred language.

Supported languages

Asgardeo provides i18n-supported user interfaces in the following languages.

Language Code
English en_US
French fr_FR
Spanish es_ES
Portuguese - Portugal pt_PT
Portuguese - Brazil pt_BR
German de_DE
Chinese zh-CN
Japanese ja-JP
Sinhalese si-LK

Configure language settings

You can use the following language settings to configure the Asgardeo interfaces exposed to the business user.

Language switcher

Users can use the language switcher available at the footer of the i18n-supported Asgardeo interfaces to select the preferred language.

Note

Asgardeo remembers this setting and applies it to all i18n-supported interfaces.

Browser-level settings

Asgardeo automatically adapts to each user's browser language preference as long as it's a supported language. Users can still manually change the language using the language switcher.

Application-level settings

You can configure the application to send the ui_locales parameter in the sign-in or authorization request when a user signs in to the application.

It works as follows,

  • You provide a list of strings, separated by a space, to define the locales.

  • Asgardeo searches through the list until it finds a supported locale.

  • If found, Asgardeo sets that language as the default locale. If not, it uses the browser-level setting.

Important

The ui_locale parameter works only with OIDC flows and not with SAML flows.

Consider the following examples:

  • If the ui_locales set to fr_FR, Asgardeo sets French as the default locale.
  • If the ui_locales set to fr_FR en_US, Asgardeo sets French as the default locale since it's the first language in the list that Asgardeo supports.
  • If the ui_locales set to it_IT en_US, Asgardeo sets English (en_US) as the default locale as it doesn't support it_IT.

The following examples show how to set the ui_locales parameter in your application.

  • Example 1: Using the SDK.

    The following sample illustrates how to set the ui_locales parameter in the signIn request using the JS/React SDK.

    Note

    Learn more about setting the signIn request using the Asgardeo SDKs.

        <SecureApp
            fallback={<div>Loading</div>}
            overrideSignIn={async () => {
                await signIn({
                    'ui_locales': 'fr_FR en_US'
                });
            }}
        >
            <AppContent/>
        </SecureApp>
    
  • Example 2: Directly in the authorization request.

    You can append the ui_locales directly in the authorization request as a query parameter as shown below.

    https://api.asgardeo.io/t/{organization_name}/oauth2/userinfo?scope={scope}\
    &response_type=code\
    &redirect_uri={redirect_uri}\
    &client_id={client_id}\
    &ui_locales={ locales list }
    

Translation of privacy policy and terms of conditions

Asgardeo attaches the ui_locales={ locales list } parameter to the privacy policy and terms of condition URLs set in the branding configurations. This allows you to show users the translated content.