
/* gettext library */

var catalog = new Array();

function pluralidx(count) { return (count == 1) ? 0 : 1; }
catalog[' (a)'] = ' (a)';
catalog[' (d)'] = ' (d)';
catalog['Are you sure you want to do delete?'] = 'Are you sure you want to delete?';
catalog['Are you sure you want to submit data with empty description?'] = 'Are you sure you want to submit data with empty description?';
catalog['Can\'t compute fuel price because quantity value is invalid.'] = 'Can\'t compute fuel price because quantity value is invalid.';
catalog['Can\'t compute fuel price because total cost value is invalid.'] = 'Can\'t compute fuel price because total cost value is invalid.';
catalog['Can\'t compute mileage since previous refueling! No refuelings yet.'] = 'Can\'t compute mileage since previous refueling! No refuelings yet.';
catalog['Can\'t compute mileage! No refuelings yet.'] = 'Can\'t compute mileage! No refuelings yet.';
catalog['Can\'t compute mileage! Value at \'Mileage since previous\' field is incorrect.'] = 'Can\'t compute mileage! Value at \'Mileage since previous\' field is incorrect.';
catalog['Can\'t compute mileage! Value at \'Note mileage\' field is incorrect.'] = 'Can\'t compute mileage! Value at \'Note mileage\' field is incorrect.';
catalog['Can\'t compute quantity because fuel price value is invalid.'] = 'Can\'t compute quantity because fuel price value is invalid.';
catalog['Can\'t compute quantity because total cost value is invalid.'] = 'Can\'t compute quantity because total cost value is invalid.';
catalog['Can\'t compute total cost because fuel price value is invalid.'] = 'Can\'t compute total cost because fuel price value is invalid.';
catalog['Can\'t compute total cost because quantity value is invalid.'] = 'Can\'t compute total cost because quantity value is invalid.';
catalog['Cancel'] = 'Cancel';
catalog['Confirm'] = 'Confirm';
catalog['Connection to server failed. Try to retry an action.'] = 'Connection to server failed. Try to retry an action.';
catalog['Do you want to update current vehicle mileage to \'%s\'?'] = 'Do you want to update current vehicle mileage to \'%s\'?';
catalog['Enter number between 1 and %(pages)s to go to this page'] = 'Enter number between 1 and %(pages)s to go to this page';
catalog['Entered mileage is same as mileage at previous refueling: \'%s\'! Are you sure you want to submit these data?'] = 'Entered mileage is same as mileage at previous refueling: \'%s\'! Are you sure you want to submit these data?';
catalog['Error occured while connecting to server. Try again...'] = 'Error occured while connecting to server. Try again...';
catalog['Error occured. Try to retry an action.'] = 'Error occured. Try to retry an action.';
catalog['Error'] = 'Error';
catalog['Errors'] = 'Errors';
catalog['Hide tags'] = 'Hide tags';
catalog['Information'] = 'Information';
catalog['Loading...'] = 'Loading...';
catalog['Maximum field size exceeded!'] = 'Maximum field size exceeded!';
catalog['Maximum number of characters is: '] = 'Maximum number of characters is: ';
catalog['Mileage'] = 'Mileage';
catalog['New value is lower than current. Are you sure you want to decrease mileage?'] = 'New value is lower than current. Are you sure you want to decrease mileage?';
catalog['Note mileage significantly differs than vehicle mileage. Please, check it.'] = 'Note mileage significantly differs than vehicle mileage. Please, check it.';
catalog['Please enter data of the vehicle that should be added to our system:'] = 'Please enter data of the vehicle that should be added to our system:';
catalog['Please, correct the errors first!'] = 'Please, correct the errors first!';
catalog['Show tags'] = 'Show tags';
catalog['Submit new vehicle data...'] = 'Submit new vehicle\'s data...';
catalog['Update'] = 'Update';
catalog['Updating mileage...'] = 'Updating mileage...';
catalog['Value is too big! Changed to 9999999'] = 'Value is too big! Changed to 9999999';
catalog['Value is too big! Changed to 9999999,99'] = 'Value is too big! Changed to 9999999,99';
catalog['Value too long! Truncated...'] = 'Value too long! Truncated...';
catalog['Warning'] = 'Warning';
catalog['You have to choose vehicle!'] = 'You have to choose vehicle!';
catalog['You have to enter a message!'] = 'You have to enter a message!';
catalog['You have to override handleGridderEvents!'] = 'You have to override handleGridderEvents!';
catalog['You\'re possibly using firebug FF extension. This may cause site to work slowly! It is recommended that you disable firebug for this site.'] = 'You\'re possibly using firebug FF extension. This may cause site to work slowly! It is recommended that you disable firebug for this site.';
catalog['Your message has been sent! You\'ll be informed when new vehicle is added.'] = 'Your message has been sent! You\'ll be informed when new vehicle is added.';
catalog['vehicle-that-should-be-added'] = 'Vehicle that should be added:\n Producer: \n Model: \n Version: \n Other:';


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())});
  }
}
