/* gettext library */

var catalog = new Array();

function pluralidx(count) { return (count == 1) ? 0 : 1; }
catalog[' chars left.'] = ' znak\u00f3w.';
catalog[' chars.'] = ' znak\u00f3w.';
catalog['Cancel rating'] = 'Cofnij g\u0142os';
catalog['Epic fail... Reason being: '] = 'Pora\u017cka... Pow\u00f3d:';
catalog['Max length exteeded by '] = 'Max. d\u0142ugo\u015b\u0107 > o ';
catalog['Max review length!'] = 'Max. d\u0142ugo\u015b\u0107 recenzji!';
catalog['Only '] = 'Pozosta\u0142o tylko ';
catalog['Please log in to vote'] = 'Zaloguj si\u0119 aby zag\u0142osowa\u0107';
catalog['Review is too long (max 300 chars). You entered'] = 'Recenzja zbyt d\u0142uga (max. 300 znak\u00f3w). Wpisano';
catalog['Review is too short (at least 10 characters)!'] = 'Recenzja zbyt kr\u00f3tka (min. 10 znak\u00f3w)!';
catalog['You forgot to write a review!'] = 'A gdzie recenzja?';
catalog['You have not rated the movie.'] = 'Nie oceni\u0142e\u015b filmu.';


function gettext(msgid) {
  var value = catalog[msgid];
  if (typeof(value) == 'undefined') {
    return msgid;
  } else {
    return (typeof(value) == 'string') ? value : value[0];
  }
}

function ngettext(singular, plural, count) {
  value = catalog[singular];
  if (typeof(value) == 'undefined') {
    return (count == 1) ? singular : plural;
  } else {
    return value[pluralidx(count)];
  }
}

function gettext_noop(msgid) { return msgid; }

function interpolate(fmt, obj, named) {
  if (named) {
    return fmt.replace(/%\(\w+\)s/g, function(match){return String(obj[match.slice(2,-2)])});
  } else {
    return fmt.replace(/%s/g, function(match){return String(obj.shift())});
  }
}
