Customize Change Password Page Language

Overview

This article explains how to properly localize the Password Reset page. When a user clicks the link in a Password Reset Email, the resulting page is not always displayed in the correct language and instead defaults to the language set in the browser's Accept-Language header. This guide provides steps to ensure the page language is set correctly by modifying the URL in the email template.

Applies To
  • Password Reset
  • Email Templates
  • Classic Universal Login
Cause

Passing the ui_locales parameter in the URL link to the /u/reset-password page is not effective out-of-the-box because the URL ends with a hash mark (#). Any characters appended to the URL are treated as a fragment instead of a query string parameter. This causes the language of the /u/reset-password page to default to the setting in the end-user's browser.

Solution

Follow the steps or video below:

To ensure the Password Reset page is correctly localized, modify the link within the Password Reset Email Template using Liquid syntax.

  1. In the Auth0 Dashboard, navigate to Branding > Email Templates.

  2. Select the Password Reset template.

  3. Replace the default <a> tag with the following code. This code removes the trailing hash mark from the url variable and appends the ui_locales parameter with the desired language code (e.g., fr-FR for French).

    <a href="{{ url | remove: "#" }}&ui_locales=fr-FR">Click Here</a>
    
  4. To set the language dynamically based on user preferences, store the language code in the user's metadata (e.g., {"lang":"fr-FR"}). Modify the link to use the metadata value.

    <a href="{{ url | remove: "#" }}&ui_locales={{user.user_metadata.lang}}">Click Here</a>

Related References

Recommended content

No recommended content found...