JQuery Validator Message in this implementation of multi-language

Source: Internet
Author: User
Tags extend valid valid email address drupal

Add the following JavaScript code fragment:

The code is as follows Copy Code
Jquery.extend (JQuery.validator.messages, {
Required: "This must be filled out." ",
Remote: "Please fix this." ",
Email: "Please enter a valid email address." ",
URL: "Please enter a legal URL." ",
Date: Please enter a legal date. ",
Dateiso: "Please enter a legal date (ISO format)." ",
Number: "Please enter the legal numbers." ",
Digits: "Please enter only numbers." ",
CreditCard: "Please enter a valid credit card number." ",
Equalto: "Please enter the same value again." ",
Maxlength:jQuery.validator.format ("Please enter no more than {0} characters.) "),
Minlength:jQuery.validator.format ("Please enter at least {0} characters.) "),
Rangelength:jQuery.validator.format ("Please enter a character value between {0} and {1}.") "),
Range:jQuery.validator.format ("Please enter a value between {0} and {1}.") "),
Max:jQuery.validator.format ("Please enter a value less than or equal to {0}.") "),
Min:jQuery.validator.format ("Please enter a value greater than or equal to {0}.") ")
});

Please leave a message to correct the deficiency of translation.

Drupal Javascript Multi-language Implementation jQuery Validator message localization
According to the previous article about Drupal JavaScript implementation multi-language, I also correspond to emit code.

The code is as follows Copy Code

Jquery.extend (JQuery.validator.messages, {
REQUIRED:DRUPAL.T ("This field is required."),
REMOTE:DRUPAL.T ("Please fix this field."),
EMAIL:DRUPAL.T ("Please enter a valid e-mail address."),
URL:DRUPAL.T ("Please enter a valid URL."),
DATE:DRUPAL.T ("Please enter a valid date."),
DATEISO:DRUPAL.T ("Please enter a valid date (ISO)."),
NUMBER:DRUPAL.T ("Please enter a valid number."),
DIGITS:DRUPAL.T ("Please enter only digits."),
CREDITCARD:DRUPAL.T ("Please enter a valid credit card number."),
EQUALTO:DRUPAL.T ("Please enter the same value again."),
Maxlength:jQuery.validator.format (drupal.t ("Please enter no more than {0} characters.")),
Minlength:jQuery.validator.format (drupal.t ("Please enter at least {0} characters."),
Rangelength:jQuery.validator.format (drupal.t ("Please enter a value between {0} and {1} characters long."),
Range:jQuery.validator.format (drupal.t ("Please enter a value between {0} and {1}."),
Max:jQuery.validator.format (drupal.t ("Please enter a value less than or equal to {0}."),
Min:jQuery.validator.format (drupal.t ("Please enter a value greater than or equal to {0}."))
});

The message for the

Custom rules can also be imported into a JS file directly for local speech or through a language pack.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.