Upgrading Lock SDK caused localization stopped working

Problem statement

I’m using the Classic Login Experience with the Lock SDK. For localization I use my own language dictionary files hosted on my own servers. The URLs look like

https://<my-domain>/lock-files/js/lock/11.30.6/en.js
https://<my-domain>/lock-files/js/lock/11.30.6/de.js
https://<my-domain>/lock-files/js/lock/11.30.6/fr.js

I have configured the languageBaseUrl like the below:

var lock = new Auth0Lock(config.clientID, config.auth0Domain, {
  // other configurations
  languageBaseUrl: 'https://<my-domain>/lock-files',
});

After upgrading to a newer version of Lock SDK, the localization doesn’t work anymore.

Symptoms

The localization of the classic login experience using Lock SDK doesn’t work after upgrading to the latest version. In the browser developer tools, I see requests to fetch the language dictionary files fail.

Cause

Lock SDK fetches the language dictionary file using a URL specific to its version.

Solution

When you set a language to the Lock SDK, it will fetch the language dictionary file by using the following URL:

https://<languageBaseUrl>/js/lock/<lock-version>/<language>.js​​​​​

If you’re using a languageBaseUrl of your own, ensure your directory structure reflects the value of your lock SDK version. If you upgrade your Classic Universal Login Page to a newer version, you must have your language dictionary files in a new folder under the version you’re upgrading to.