Customize Change Password Page Language
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.
- Password Reset
- Email Templates
- Classic Universal Login
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.
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.
-
In the Auth0 Dashboard, navigate to Branding > Email Templates.
-
Select the Password Reset template.
-
Replace the default
<a>tag with the following code. This code removes the trailing hash mark from theurlvariable and appends theui_localesparameter with the desired language code (e.g.,fr-FRfor French).<a href="{{ url | remove: "#" }}&ui_locales=fr-FR">Click Here</a> -
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>