Open aarifIg opened 8 years ago
I agree this should be built in, but here's what I did to get around it...
After the generated code is loaded, anywhere in javascript...
(function (win) { win.$oldL = $L; win.$L = function (options) { var retVal = $oldL(options.code); if (options.params) { for (var i = 0; i < options.params.length; i++) { var re = new RegExp("\\{" + i + "\\}","g"); retVal = retVal.replace(re, options.params[i]); } } return retVal; } }(this));
Then you just use it like... $L({code: 'your.message.code', params: ['optional', 'params']});
I have an entry in messages.properties with arguments like: user.login.success={0}, you have logged in.
how will i use it in java script.