var localizedStrings = {};

/**
 *  Provides internationalized version of message specified by given key.
 *  It can also get additional arguments which are used to specify parameters
 *  for message.
 *  Ex:
 *    // let suppose the message associated with the key "msg.my.key" is
 *    // "Hello, {0}! Your user name is '{1}'."
 *    myVar = getText ("msg.my.key", "John Smith", "jsmith");
 *    // now myVar is "Hello, John Smith! Your user name is 'jsmith'."
 *  @param key    message key
 *  @params       values to replace placeholders in the message
 *  @return       internationalized message
 */
function getText (key)
{
  var message;

  if (localizedStrings)
  {
    message = localizedStrings[key];
  }

  if (!message)
  {
    message = key;
  }
  else
  {
    var argCnt = arguments.length;

    for (var i = 1; i < argCnt; i++)
    {
      message = message.split ("{" + (i-1) + "}" ).join (arguments[i]);
    }
  }

  return message;
}
