function MissingTranslationData(text_id) {
  this.name = 'MissingTranslationData';
  this.message = "Missing translation: " + text_id;
};

function t(text_id) {
  try {
    return whiny_translate(text_id);
  } catch (ex) {
    notify_error(ex);
    return ex.message;
  };
};

function whiny_translate(text_id) {
  var text = TRANSLATIONS[text_id];
  if (text)
    return text;
  else
    throw new MissingTranslationData(text_id);
};

function t_url(id) {
  if (URLS[id])
    return URLS[id];
  else {
    var msg = "Unknown url in the JavaScript: " + id;
    notify_error(msg);
    throw(msg);
  }
};
