0
manojreddy created
We have support for localized string only on the client side, But If I want to send some exception to the client side, there is no support for localization. Do You have any approach for this?
4 Answer(s)
-
0
You can override abp.message.error:
var error = abp && abp.message && abp.message.error; if (error) { abp.message.error = function (message, title) { message = localize(message); title = localize(title); return error(message, title); }; } function localize(name) { return "[" + name + "]"; }
-
0
Where should I add the code mentioned by you?
this._testService.createTest(this.test) .subscribe(() => { this.notify.info(this.l('SavedSuccessfully')); this.modalSave.emit(this.test); this.router.navigate(['/app/tests']); });
public async Task CreateTest(TestInput input) { throw new UserFriendlyException("Test Code Already Exist"); }
I want to localize "Test Code Already Exist" message.
-
0
Why not localize on server side?
throw new UserFriendlyException(L("Test Code Already Exist"));
-
0
Thanks ,
My bad, I missed it.