Good answer, but it can be simplified even more.
You don't need to manage the language yourself, ServiceNow does that for you. All you need is to call the gs.getMessage function.
javascript: gs.getMessage('myMessage');
Then you just add a message for...