[Vuejs]-Vee-validate and Vue-I18n localization not working

3👍

You have to pass a callback to custom message, not the translated value, so it will be called when to locale changes and generate new message.

vee-validate.js

extend("atLeastOneDigit", {
  validate(value) {
    var digitPattern = /\d+/g;
    return value.match(digitPattern) != null;
  },
  message: () => i18n.t("pwDigitError")
});

Leave a comment