Skip to content

Instantly share code, notes, and snippets.

@medigeek
Created November 21, 2022 16:36
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save medigeek/490eb8137af1723e66eb8bc0982d329b to your computer and use it in GitHub Desktop.
Save medigeek/490eb8137af1723e66eb8bc0982d329b to your computer and use it in GitHub Desktop.
translate mailchimp error messages - plus mc_gdpr "Please choose an option." and others - mc-validate-messages.js
/**
Source: https://downloads.mailchimp.com/js/mc-validate-messages.js
Reason: Couldn't find "Please choose an option.".
Ended up discovering it myself, beautified the js link:
https://s3.amazonaws.com/downloads.mailchimp.com/js/mc-validate.js
Also found:
zipcodeUS: "The specified US ZIP Code is invalid",
skip_or_fill_minimum: "Please either skip these fields or fill at least {0} of them.",
skip_or_complete_group: "Please supply missing fields.",
Tried to contact mailchimp support but required me to create an account.
So if anyone has one, please redirect this to them to add the missing mc_gdpr and others
in https://downloads.mailchimp.com/js/mc-validate-messages.js
How to: To customize your embedded form validation messages, place this code before the closing script tag.
*/
$mcj.extend($mcj.validator.messages, {
required: "This field is required.",
remote: "Please fix this field.",
email: "Please enter a valid email address.",
url: "Please enter a valid URL.",
date: "Please enter a valid date.",
dateISO: "Please enter a valid date (ISO).",
number: "Please enter a valid number.",
digits: "Please enter only digits.",
creditcard: "Please enter a valid credit card number.",
equalTo: "Please enter the same value again.",
accept: "Please enter a value with a valid extension.",
maxlength: $mcj.validator.format("Please enter no more than {0} characters."),
minlength: $mcj.validator.format("Please enter at least {0} characters."),
rangelength: $mcj.validator.format("Please enter a value between {0} and {1} characters long."),
range: $mcj.validator.format("Please enter a value between {0} and {1}."),
max: $mcj.validator.format("Please enter a value less than or equal to {0}."),
min: $mcj.validator.format("Please enter a value greater than or equal to {0}."),
mc_birthday: "Please enter a valid month and day.",
mc_date: "Please enter a valid date.",
mc_phone: "Please enter a valid phone number.",
mc_gdpr: "Please choose an option.",
zipcodeUS: "The specified US ZIP Code is invalid",
skip_or_fill_minimum: "Please either skip these fields or fill at least {0} of them.",
skip_or_complete_group: "Please supply missing fields.",
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment