Although there are several same questions, I'm very curious regarding this specific case.
jQuery(document).ready(function () {
if ($('#msg').val() != '' && $('#msgSuccess').val() == 'true') {
var msg = $('#msg').val();
var t = $('#msg').val().toString();
toastr.success("@_localizer[t]");
}
});
variable t
has some message which represents the key for my localization file.
I have issue to pass that variable (string) to my mvc _localizer.
Where I go wrong with this?
If I add simple console.log(t)
it works. So Im guessing that is the localizer is a problem.
I'm using @inject IViewLocalizer _localizer
from AspNetCore.Mvc.Localization