Skip to content

Conversation

mario-s
Copy link

@mario-s mario-s commented Mar 24, 2014

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 mario-s changed the title customized messages #21: customized messages Mar 24, 2014
@mario-s mario-s changed the title #21: customized messages customized messages Mar 24, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant