disable automatic translation
hugsbrugs opened this issue · comments
Hi !
I'm using your very nice plugin but today I'm facing an issue : I'm using angular-translate and obviously want to display some translated messages in growl notifications but not always !
Lets' take an example :
growl.error( $translate("ERROR") + ' : ' + JSON.stringify(data.message), {referenceId: 'admin-login', ttl: 5000});
this displays me :
[object Object] : "bad credentials" doesn't exist
Because I don't know what will be data.message, I only want to translate ERROR, but growl also tries to translate the whole message.
More problematic, if I set :
growl.error( $translate("ERROR"), {referenceId: 'admin-login', ttl: 5000});
I get an error :
TypeError: undefined is not a function
at Object.B (https://cdn.jsdelivr.net/angular.translate/2.4.2/angular-translate.min.js:6:773)
at Function.N.instant (https://cdn.jsdelivr.net/angular.translate/2.4.2/angular-translate.min.js:6:9275)
at c (https://cdn.jsdelivr.net/angular.translate/2.4.2/angular-translate.min.js:6:12965)
at u (http://mysite.com/js/angular/angular-growl-2/build/angular-growl.min.js:6:3470)
at v (http://mysite.com/js/angular/angular-growl-2/build/angular-growl.min.js:6:4168)
at Object.x as error
at http://mysite.com/js/app/Admin/AdminController.js:73:27
at https://ajax.googleapis.com/ajax/libs/angularjs/1.3.3/angular.min.js:80:169
at https://ajax.googleapis.com/ajax/libs/angularjs/1.3.3/angular.min.js:110:505
at k.$eval (https://ajax.googleapis.com/ajax/libs/angularjs/1.3.3/angular.min.js:124:325)
But if I only set :
growl.error( "ERROR", {referenceId: 'admin-login', ttl: 5000});
everything is displaying perfectly !
It would be very nice if we could set an option to manually handle transaltion behavior like :
growl.error(MY_MESSAGE, {translate: no});
Please let me know what you think about it ! Thanks
Hugo
just use { translateMessage: false }