Create function to translate error messages
it would be possible to include a function to breeze similar to the included in knockout-validation to translate error messages:
//quick function to override rule messages
ko.validation.localize = function (msgTranslations) {
var msg, rule;
//loop the properties in the object and assign the msg to the rule
for (rule in msgTranslations) {
if (ko.validation.rules.hasOwnProperty(rule)) {
ko.validation.rules[rule].message = msgTranslations[rule];
}
}
};
Related to: http://stackoverflow.com/questions/14316454/translate-breeze-validation-messages
8
votes