Am using the JQuery Validator from http://bassistance.de/jquery-plugins/jquery-plugin-validation/. How can i make it so that the messages are custom and not in english.
If you look into the directory "localization", you could find different .js files that cointains error messages in different languages. [something like "messages_XX.js"]
Choose the file of the language you need and just add the following line, into the tag , after the inclusion of the jquery.validate.js
<script type="text/javascript" src="localization/messages_XX.js"></script>
Do it like this:
$(document).ready(function() { $("form#login").validate({ lang: 'en' // or whatever language option you have. }); });
If the language you wish to supply is not one of the default languages, then do this:
$.tools.validator.localize("fi", { '*' : 'Virheellinen arvo', ':email' : 'Virheellinen sähköpostiosoite', ':number' : 'Arvon on oltava numeerinen', ':url' : 'Virheellinen URL', '[max]' : 'Arvon on oltava pienempi, kuin $1', '[min]' : 'Arvon on oltava suurempi, kuin $1', '[required]' : 'Kentän arvo on annettava' }); $("form#login").validate({ lang: 'fi' });
See these instructions for more.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With