I'm using angularJS and I want to translate the require messages that JQuery validate has. For translations I'm using grunt nggettext, which works perfectly. The problem is that is not filtering the translation.
This is my code:
app.factory('Translations', function(gettext, $filter){
return {
required: $filter('translate')(gettext("MANDATORY FIELD"))
}
});
function generateTranslations(translations){
$.extend($.validator.messages, {
required: translations.required
});
}
app.controller('HomeController', function(Translations){
generateTranslations(Translations);
});
HomeController is the one that belongs to the state.
It always print "MANDATRY FIELD", not it translation. Does anyone know how can I solve this?
Thank you!