Auth0 Home Blog Docs

Translate Email


#1

Hello

I need to translate the Password Reset Email in different languages. How can i provide more than one language?

Kind Regards


#2

you can use templates and liquid syntax, as explained here:


#3

Thank you for your response.

I found this, but the “lang” attribute is not filled up.

How can I access to the browser language?


#4

Lang is populated only if you actually set it elsewhere when you create/update your user, such as in you backend/mobile app/etc.

You can get the language from the browser with some code like this:

var language = navigator.userLanguage || navigator.language || navigator.browserLanguage || “en-US”;

But this won’t help you. You can’t execute javascript in most email clients, most of the times there is nothing like a “browser”. The liquid template system works on the server side, when the email is generated. So there is no way to get the user language from the browser, unless you store it to the user profile in advance.