Properly pluralize quantity unit in success message on purchase/consume/inventory page

This commit is contained in:
Bernd Bestel 2018-10-20 14:09:19 +02:00
parent 7bf4421d44
commit 5318e79f55
No known key found for this signature in database
GPG Key ID: 71BD34C0D4891300
3 changed files with 3 additions and 3 deletions

View File

@ -16,7 +16,7 @@
Grocy.Api.Get('stock/consume-product/' + jsonForm.product_id + '/' + jsonForm.amount + '?spoiled=' + spoiled,
function(result)
{
toastr.success(L('Removed #1 #2 of #3 from stock', jsonForm.amount, productDetails.quantity_unit_stock.name, productDetails.product.name));
toastr.success(L('Removed #1 #2 of #3 from stock', jsonForm.amount, Pluralize(jsonForm.amount, productDetails.quantity_unit_stock.name, productDetails.quantity_unit_stock.name_plural), productDetails.product.name));
$('#amount').val(1);
Grocy.Components.ProductPicker.SetValue('');

View File

@ -32,7 +32,7 @@
);
}
toastr.success(L('Stock amount of #1 is now #2 #3', productDetails.product.name, jsonForm.new_amount, productDetails.quantity_unit_stock.name));
toastr.success(L('Stock amount of #1 is now #2 #3', productDetails.product.name, jsonForm.new_amount, Pluralize(jsonForm.new_amount, productDetails.quantity_unit_stock.name, productDetails.quantity_unit_stock.name_plural)));
if (addBarcode !== undefined)
{

View File

@ -40,7 +40,7 @@
);
}
toastr.success(L('Added #1 #2 of #3 to stock', amount, productDetails.quantity_unit_stock.name, productDetails.product.name));
toastr.success(L('Added #1 #2 of #3 to stock', amount, Pluralize(amount, productDetails.quantity_unit_stock.name, productDetails.quantity_unit_stock.name_plural), productDetails.product.name));
if (addBarcode !== undefined)
{