String bundles can be loaded at runtime. When a string bundle is loaded, and message that starts with msg. is introduced into the global scope as similarly named constant, whose value will be the contents of the message.

Any message that starts with msn. (short for message name) is introduced as a constant whose value will be the name of the message. Message names are typically used for messages that have placeholders for words that will be inserted at runtime. These message names are commonly used with the getMsg function.

Sample message definitions from venkman.properties...
msg.tmode.ignore     = Exceptions will now be ignored.
msg.tmode.trace      = Exceptions will now be traced.
msg.tmode.break      = Exceptions will now stop the debug target.
<... snip ...>
msn.no.cmdmatch      = No commands match ``%1$S''.
msn.cmdmatch         = Commands matching ``%1$S'' are [%2$S].
Loading a string bundle, from venkman-msg.js...
function initMsgs ()
{
<... snip ...>
    console.defaultBundle = 
        initStringBundle("chrome://venkman/locale/venkman.properties");
}

The initStringBundle show above will introduce five new variables into the global scope. MSG_TMODE_IGNORE will contain the string ``Exceptions will now be ignored.'' In the same fashion, MSG_TMODE_TRACE and MSG_TMODE_BREAK will contain the literal string for the message in question. These can be used in the application without going back to the string bundle.

The MSN_NO_CMDMATCH variable will contain the string ``msn.no.cmdmatch''. This is meant to be passed to the getMsg function, to combine the message with other words, at runtime.

Using messages, from various files
// MSG_* constants, used with no further processing...
switch (console.throwMode)
{
    case TMODE_IGNORE:
        feedback (e, MSG_TMODE_IGNORE);
        break;
    case TMODE_TRACE:
        feedback (e, MSG_TMODE_TRACE);
        break;
    case TMODE_BREAK:
        feedback (e, MSG_TMODE_BREAK);
        break;
}

// single parameter passed to getMsg, does not need to be in an array...
display (getMsg(MSN_NO_CMDMATCH, e.commandText), MT_ERROR);

// multiple parameters passed as an array of strings...
display (getMsg(MSN_CMDMATCH, [e.pattern, names]));