Captcha placeholder 'Enter the code shown' language not dynamic

Problem statement

I can’t change the captcha placeholder when setting the “lang” variable when rendering the simple captcha with custom login pages (Auth0.js). The message always reads “Enter the code shown” in English, not the target language.

Cause

Currently, this value is the default template and not linked to the lang parameter:

Solution

Until support for using the lang parameter is added for Simple Captcha, the default template must be overridden:

var captcha = webAuth.renderCaptcha(
  document.querySelector('.captcha-container'), {
    templates: {
      auth0: function (challenge) {
        var message =
          challenge.type === 'code' ?
          'Enter the code shown above custom' :
          'Solve the formula shown above';
        return (
          '<div class="captcha-challenge">\n' +
          '  <img src="' +
          challenge.image +
          '" />\n' +
          '  <button type="button" class="captcha-reload">↺</button>\n' +
          '</div>\n' +
          '<input type="text" name="captcha"\n' +
          '  class="form-control captcha-control"\n' +
          '  placeholder="' +
          message +
          '" />'
        );
      }
    }
  }
);