Overview
This article explains how to localize Errors when using the Custom Login Page with auth0.js by translating the errors from English to another language.
Applies To
- Classic Login
Solution
There is no easy way to localize all the errors when using the Custom Login Page with auth0.js. Please write the error messages in the required language corresponding to English errors directly in the Customize Login Page. Here is an example code for the Japanese language.
if(err.description == "Wrong email or password."){
errorMessage.innerText = "パスワードが間違っています";
} else {
errorMessage.innerText = err.description;
}
Please note that the complete list of the errors is not public, so it may be necessary to test various scenarios to get some common English error messages.
For a list of similar errors from Lock.js, see this Auth0 Github Page.
- NOTE: This is for Lock.js, which is different from auth0.js, so the errors may differ. Also, please note that the error messages can change at any time without notice.