I have following resourceBundle Javascript object.
var resourceBundle = {
en : {
"MSG1" : "Message 1",
"MSG2" : "Message 2"
}
}
As you see, this is for english. Then I can create another brance for, say, French(fr). No problem to get ‘Message 1’ , ‘Message 2’ as all I have to do is get resourceBundle[‘en’][key]. But what I can do if I want a message to be created using paramaters. Can I use methods, if so, how.
What I mean is something like this, I want to add MSG3 as;
"MSG3" : "welcome "+userName;
not exact way, a workaround
Try the following :
or using @David’s answer as a base :