I am using just the classic universal login experience and I have english and japanese activated in the tenant settings. How do I make it so the login page is automatically translated based on the users location?
Additionally, I would also like to translate the signUpTerms that I have added.
Essentially all you need to do it set your language as part of the options that get initialised with Lock e.g for Spanish:
// Select a supported language
var options = {
language: 'es'
};
// Initiating our Auth0Lock
var lock = new Auth0Lock(
'{yourClientId}',
'{yourDomain}',
options
);
To get the browser language you might something like:
For Spanish for example, the browser may return es-ES and may not get a match with our supported language type in which case may need to to do some mapping e.g:
if (navigator.language === "es-ES") {
language= "es"
}
else {
language = navigator.language
}
Hopefully you’ll be able to get this to work for you.
The documentation does not suggest you can pass in multiple languages so I wouldn’t have thought so.
To translate the signUpTerms I believe you would need to provide the translations yourself. You could for example specify your own languageBaseUrl to point to a set of dictionaries that you host, which you can customise fully for each language you wish to support and provide translations for whatever you need.