jqBootstrapValidation icon indicating copy to clipboard operation
jqBootstrapValidation copied to clipboard

customized messages

Open mario-s opened this issue 11 years ago • 0 comments

This patch is related to issue 21:

All default messages are merged into one map. It is possible to return a customized message for a single key by providing a different implementation for the resource function. If the user defined message is empty, then the default message from the map will be used. However the possible keys for the messages should be documented so that a user of the library knows what to customize.

A sample how the library can work together with the jquery i18n properties plugin:

$(function() {
            $.i18n.properties({name: 'messages', path: 'res/', mode: 'both', language: 'de'});
            $("input,textarea").not("[type=submit]").jqBootstrapValidation(
                    {
                        resource: function(key) {
                            return $.i18n.prop(key);
                        }
                    }
            );
    });

mario-s avatar Mar 24 '14 20:03 mario-s