Use named arguments for all gettext strings which have more than 1 argument (again closes #161)

This commit is contained in:
Bernd Bestel 2019-05-05 14:13:50 +02:00
parent 153ac61867
commit dd148a8fc3
No known key found for this signature in database
GPG Key ID: 71BD34C0D4891300
15 changed files with 45 additions and 48 deletions

View File

@ -265,7 +265,7 @@ msgstr ""
msgid "For purchases this amount of days will be added to today for the best before date suggestion" msgid "For purchases this amount of days will be added to today for the best before date suggestion"
msgstr "" msgstr ""
msgid "This means 1 %s purchased will be converted into %s %s in stock" msgid "This means 1 %1$s purchased will be converted into %2$s %3$s in stock"
msgstr "" msgstr ""
msgid "Login" msgid "Login"
@ -352,7 +352,7 @@ msgstr ""
msgid "This means it is estimated that a new execution of this chore is tracked %s days after the last was tracked" msgid "This means it is estimated that a new execution of this chore is tracked %s days after the last was tracked"
msgstr "" msgstr ""
msgid "Removed %s %s of %s from stock" msgid "Removed %1$s %2$s of %3$s from stock"
msgstr "" msgstr ""
msgid "About grocy" msgid "About grocy"
@ -364,19 +364,16 @@ msgstr ""
msgid "Released on" msgid "Released on"
msgstr "" msgstr ""
msgid "Consume %s %s of %s" msgid "Added %1$s %2$s of %3$s to stock"
msgstr "" msgstr ""
msgid "Added %s %s of %s to stock" msgid "Stock amount of %1$s is now %2$s %3$s"
msgstr "" msgstr ""
msgid "Stock amount of %s is now %s %s" msgid "Tracked execution of chore %1$s on %2$s"
msgstr "" msgstr ""
msgid "Tracked execution of chore %s on %s" msgid "Tracked charge cycle of battery %1$s on %2$s"
msgstr ""
msgid "Tracked charge cycle of battery %s on %s"
msgstr "" msgstr ""
msgid "Consume all %s which are currently in stock" msgid "Consume all %s which are currently in stock"
@ -495,7 +492,7 @@ msgstr ""
msgid "Recipe" msgid "Recipe"
msgstr "" msgstr ""
msgid "Not enough in stock, %s missing, %s already on shopping list" msgid "Not enough in stock, %1$s missing, %2$s already on shopping list"
msgstr "" msgstr ""
msgid "Show notes" msgid "Show notes"
@ -905,10 +902,10 @@ msgstr ""
msgid "Add all list items to stock" msgid "Add all list items to stock"
msgstr "" msgstr ""
msgid "Add %s %s of %s to stock" msgid "Add %1$s of %2$s to stock"
msgstr "" msgstr ""
msgid "Adding shopping list item %s of %s" msgid "Adding shopping list item %1$s of %2$s"
msgstr "" msgstr ""
msgid "Use a specific stock item" msgid "Use a specific stock item"
@ -917,7 +914,7 @@ msgstr ""
msgid "The first item in this list would be picked by the default rule which is \"First expiring first, then first in first out\"" msgid "The first item in this list would be picked by the default rule which is \"First expiring first, then first in first out\""
msgstr "" msgstr ""
msgid "Mark %s of %s as open" msgid "Mark %1$s of %2$s as open"
msgstr "" msgstr ""
msgid "When a product was marked as opened, the best before date will be replaced by today + this amount of days (a value of 0 disables this)" msgid "When a product was marked as opened, the best before date will be replaced by today + this amount of days (a value of 0 disables this)"
@ -926,13 +923,13 @@ msgstr ""
msgid "Default best before days after opened" msgid "Default best before days after opened"
msgstr "" msgstr ""
msgid "Marked %s %s of %s as opened" msgid "Marked %1$s of %2$s as opened"
msgstr "" msgstr ""
msgid "Mark as opened" msgid "Mark as opened"
msgstr "" msgstr ""
msgid "Expires on %s; Bought on %s" msgid "Expires on %1$s; Bought on %2$s"
msgstr "" msgstr ""
msgid "Not opened" msgid "Not opened"
@ -1061,7 +1058,7 @@ msgstr ""
msgid "Changelog" msgid "Changelog"
msgstr "" msgstr ""
msgid "will be multiplied a factor of %s to get %s" msgid "will be multiplied a factor of %1$s to get %2$s"
msgstr "" msgstr ""
msgid "The given date is earlier than today, are you sure?" msgid "The given date is earlier than today, are you sure?"
@ -1115,7 +1112,7 @@ msgstr ""
msgid "Show less" msgid "Show less"
msgstr "" msgstr ""
msgid "The amount must be between %s and %s" msgid "The amount must be between %1$s and %2$s"
msgstr "" msgstr ""
msgid "Day of month" msgid "Day of month"
@ -1201,10 +1198,7 @@ msgid_plural "Not enough in stock, %s ingredients missing"
msgstr[0] "" msgstr[0] ""
msgstr[1] "" msgstr[1] ""
msgid "Consume %s of %s" msgid "The amount cannot be lower than %1$s or equal %2$s"
msgstr ""
msgid "The amount cannot be lower than %s or equal %s"
msgstr "" msgstr ""
msgid "Not enough in stock, but already on the shopping list" msgid "Not enough in stock, but already on the shopping list"
@ -1233,3 +1227,6 @@ msgstr ""
msgid "When enabled only the day of an execution is tracked, not the time" msgid "When enabled only the day of an execution is tracked, not the time"
msgstr "" msgstr ""
msgid "Consume %1$s of %2$s"
msgstr ""

View File

@ -107,7 +107,7 @@ $(document).on('click', '.track-charge-cycle-button', function(e)
} }
Grocy.FrontendHelpers.EndUiBusy(); Grocy.FrontendHelpers.EndUiBusy();
toastr.success(__t('Tracked charge cycle of battery %s on %s', batteryName, trackedTime)); toastr.success(__t('Tracked charge cycle of battery %1$s on %2$s', batteryName, trackedTime));
RefreshContextualTimeago(); RefreshContextualTimeago();
RefreshStatistics(); RefreshStatistics();
}, },

View File

@ -12,7 +12,7 @@
function(result) function(result)
{ {
Grocy.FrontendHelpers.EndUiBusy("batterytracking-form"); Grocy.FrontendHelpers.EndUiBusy("batterytracking-form");
toastr.success(__t('Tracked charge cycle of battery %s on %s', batteryDetails.battery.name, $('#tracked_time').find('input').val()) + '<br><a class="btn btn-secondary btn-sm mt-2" href="#" onclick="UndoChargeCycle(' + result.id + ')"><i class="fas fa-undo"></i> ' + __t("Undo") + '</a>'); toastr.success(__t('Tracked charge cycle of battery %1$s on %2$s', batteryDetails.battery.name, $('#tracked_time').find('input').val()) + '<br><a class="btn btn-secondary btn-sm mt-2" href="#" onclick="UndoChargeCycle(' + result.id + ')"><i class="fas fa-undo"></i> ' + __t("Undo") + '</a>');
$('#battery_id').val(''); $('#battery_id').val('');
$('#battery_id_text_input').focus(); $('#battery_id_text_input').focus();

View File

@ -117,6 +117,6 @@ $('.input-group-chore-period-type').on('change', function(e)
$("label[for='period_days']").text(__t("Day of month")); $("label[for='period_days']").text(__t("Day of month"));
$("#period_days").attr("min", "1"); $("#period_days").attr("min", "1");
$("#period_days").attr("max", "31"); $("#period_days").attr("max", "31");
$("#period_days").parent().find(".invalid-feedback").text(__t('The amount must be between %s and %s', "1", "31")); $("#period_days").parent().find(".invalid-feedback").text(__t('The amount must be between %1$s and %2$s', "1", "31"));
} }
}); });

View File

@ -115,7 +115,7 @@ $(document).on('click', '.track-chore-button', function(e)
} }
Grocy.FrontendHelpers.EndUiBusy(); Grocy.FrontendHelpers.EndUiBusy();
toastr.success(__t('Tracked execution of chore %s on %s', choreName, trackedTime)); toastr.success(__t('Tracked execution of chore %1$s on %2$s', choreName, trackedTime));
RefreshContextualTimeago(); RefreshContextualTimeago();
RefreshStatistics(); RefreshStatistics();
}, },

View File

@ -12,7 +12,7 @@
function(result) function(result)
{ {
Grocy.FrontendHelpers.EndUiBusy("choretracking-form"); Grocy.FrontendHelpers.EndUiBusy("choretracking-form");
toastr.success(__t('Tracked execution of chore %s on %s', choreDetails.chore.name, Grocy.Components.DateTimePicker.GetValue()) + '<br><a class="btn btn-secondary btn-sm mt-2" href="#" onclick="UndoChoreExecution(' + result.id + ')"><i class="fas fa-undo"></i> ' + __t("Undo") + '</a>'); toastr.success(__t('Tracked execution of chore %1$s on %2$s', choreDetails.chore.name, Grocy.Components.DateTimePicker.GetValue()) + '<br><a class="btn btn-secondary btn-sm mt-2" href="#" onclick="UndoChoreExecution(' + result.id + ')"><i class="fas fa-undo"></i> ' + __t("Undo") + '</a>');
$('#chore_id').val(''); $('#chore_id').val('');
$('#chore_id_text_input').focus(); $('#chore_id_text_input').focus();

View File

@ -66,7 +66,7 @@
} }
Grocy.FrontendHelpers.EndUiBusy("consume-form"); Grocy.FrontendHelpers.EndUiBusy("consume-form");
toastr.success(__t('Removed %s %s of %s from stock', Math.abs(result.amount), __n(Math.abs(result.amount), productDetails.quantity_unit_stock.name, productDetails.quantity_unit_stock.name_plural), productDetails.product.name) + '<br><a class="btn btn-secondary btn-sm mt-2" href="#" onclick="UndoStockBooking(' + result.id + ')"><i class="fas fa-undo"></i> ' + __t("Undo") + '</a>'); toastr.success(__t('Removed %1$s %2$s of %3$s from stock', Math.abs(result.amount), __n(Math.abs(result.amount), productDetails.quantity_unit_stock.name, productDetails.quantity_unit_stock.name_plural), productDetails.product.name) + '<br><a class="btn btn-secondary btn-sm mt-2" href="#" onclick="UndoStockBooking(' + result.id + ')"><i class="fas fa-undo"></i> ' + __t("Undo") + '</a>');
$("#amount").attr("min", "1"); $("#amount").attr("min", "1");
$("#amount").attr("max", "999999"); $("#amount").attr("max", "999999");
@ -133,7 +133,7 @@ $('#save-mark-as-open-button').on('click', function(e)
} }
Grocy.FrontendHelpers.EndUiBusy("consume-form"); Grocy.FrontendHelpers.EndUiBusy("consume-form");
toastr.success(__t('Marked %s %s of %s as opened', jsonForm.amount, __n(jsonForm.amount, productDetails.quantity_unit_stock.name, productDetails.quantity_unit_stock.name_plural), productDetails.product.name) + '<br><a class="btn btn-secondary btn-sm mt-2" href="#" onclick="UndoStockBooking(' + result.id + ')"><i class="fas fa-undo"></i> ' + __t("Undo") + '</a>'); toastr.success(__t('Marked %1$s of %2$s as opened', jsonForm.amount + " " + __n(jsonForm.amount, productDetails.quantity_unit_stock.name, productDetails.quantity_unit_stock.name_plural), productDetails.product.name) + '<br><a class="btn btn-secondary btn-sm mt-2" href="#" onclick="UndoStockBooking(' + result.id + ')"><i class="fas fa-undo"></i> ' + __t("Undo") + '</a>');
$('#amount').val(Grocy.UserSettings.stock_default_consume_amount); $('#amount').val(Grocy.UserSettings.stock_default_consume_amount);
Grocy.Components.ProductPicker.Clear(); Grocy.Components.ProductPicker.Clear();
@ -179,20 +179,20 @@ Grocy.Components.ProductPicker.GetPicker().on('change', function(e)
{ {
$("#amount").attr("min", "0.01"); $("#amount").attr("min", "0.01");
$("#amount").attr("step", "0.01"); $("#amount").attr("step", "0.01");
$("#amount").parent().find(".invalid-feedback").text(__t('The amount must be between %s and %s', 0.01.toLocaleString(), parseFloat(productDetails.stock_amount).toLocaleString())); $("#amount").parent().find(".invalid-feedback").text(__t('The amount must be between %1$s and %2$s', 0.01.toLocaleString(), parseFloat(productDetails.stock_amount).toLocaleString()));
} }
else else
{ {
$("#amount").attr("min", "1"); $("#amount").attr("min", "1");
$("#amount").attr("step", "1"); $("#amount").attr("step", "1");
$("#amount").parent().find(".invalid-feedback").text(__t('The amount must be between %s and %s', "1", parseFloat(productDetails.stock_amount).toLocaleString())); $("#amount").parent().find(".invalid-feedback").text(__t('The amount must be between %1$s and %2$s', "1", parseFloat(productDetails.stock_amount).toLocaleString()));
} }
if (productDetails.product.enable_tare_weight_handling == 1) if (productDetails.product.enable_tare_weight_handling == 1)
{ {
$("#amount").attr("min", productDetails.product.tare_weight); $("#amount").attr("min", productDetails.product.tare_weight);
$('#amount').attr('max', parseFloat(productDetails.stock_amount) + parseFloat(productDetails.product.tare_weight)); $('#amount').attr('max', parseFloat(productDetails.stock_amount) + parseFloat(productDetails.product.tare_weight));
$("#amount").parent().find(".invalid-feedback").text(__t('The amount must be between %s and %s', parseFloat(productDetails.product.tare_weight).toLocaleString(), (parseFloat(productDetails.stock_amount) + parseFloat(productDetails.product.tare_weight)).toLocaleString())); $("#amount").parent().find(".invalid-feedback").text(__t('The amount must be between %1$s and %2$s', parseFloat(productDetails.product.tare_weight).toLocaleString(), (parseFloat(productDetails.stock_amount) + parseFloat(productDetails.product.tare_weight)).toLocaleString()));
$("#tare-weight-handling-info").removeClass("d-none"); $("#tare-weight-handling-info").removeClass("d-none");
} }
else else
@ -244,7 +244,7 @@ Grocy.Components.ProductPicker.GetPicker().on('change', function(e)
{ {
$("#specific_stock_entry").append($("<option>", { $("#specific_stock_entry").append($("<option>", {
value: stockEntry.stock_id, value: stockEntry.stock_id,
text: __t("Expires on %s; Bought on %s", moment(stockEntry.best_before_date).format("YYYY-MM-DD"), moment(stockEntry.purchased_date).format("YYYY-MM-DD")) + "; " + openTxt text: __t("Expires on %1$s; Bought on %2$s", moment(stockEntry.best_before_date).format("YYYY-MM-DD"), moment(stockEntry.purchased_date).format("YYYY-MM-DD")) + "; " + openTxt
})); }));
} }
}); });

View File

@ -51,7 +51,7 @@
} }
Grocy.FrontendHelpers.EndUiBusy("inventory-form"); Grocy.FrontendHelpers.EndUiBusy("inventory-form");
toastr.success(__t('Stock amount of %s is now %s %s', productDetails.product.name, jsonForm.new_amount, __n(jsonForm.new_amount, productDetails.quantity_unit_stock.name, productDetails.quantity_unit_stock.name_plural)) + '<br><a class="btn btn-secondary btn-sm mt-2" href="#" onclick="UndoStockBooking(' + result.id + ')"><i class="fas fa-undo"></i> ' + __t("Undo") + '</a>'); toastr.success(__t('Stock amount of %1$s is now %2$s %3$s', productDetails.product.name, jsonForm.new_amount, __n(jsonForm.new_amount, productDetails.quantity_unit_stock.name, productDetails.quantity_unit_stock.name_plural)) + '<br><a class="btn btn-secondary btn-sm mt-2" href="#" onclick="UndoStockBooking(' + result.id + ')"><i class="fas fa-undo"></i> ' + __t("Undo") + '</a>');
$('#inventory-change-info').addClass('d-none'); $('#inventory-change-info').addClass('d-none');
$("#tare-weight-handling-info").addClass("d-none"); $("#tare-weight-handling-info").addClass("d-none");
@ -99,19 +99,19 @@ Grocy.Components.ProductPicker.GetPicker().on('change', function(e)
{ {
$("#new_amount").attr("min", "0.01"); $("#new_amount").attr("min", "0.01");
$("#new_amount").attr("step", "0.01"); $("#new_amount").attr("step", "0.01");
$("#new_amount").parent().find(".invalid-feedback").text(__t('The amount cannot be lower than %s or equal %s', 0.01.toLocaleString(), productDetails.stock_amount.toLocaleString())); $("#new_amount").parent().find(".invalid-feedback").text(__t('The amount cannot be lower than %1$s or equal %2$s', 0.01.toLocaleString(), productDetails.stock_amount.toLocaleString()));
} }
else else
{ {
$("#new_amount").attr("min", "0"); $("#new_amount").attr("min", "0");
$("#new_amount").attr("step", "1"); $("#new_amount").attr("step", "1");
$("#new_amount").parent().find(".invalid-feedback").text(__t('The amount cannot be lower than %s or equal %s', '0', productDetails.stock_amount.toLocaleString())); $("#new_amount").parent().find(".invalid-feedback").text(__t('The amount cannot be lower than %1$s or equal %2$s', '0', productDetails.stock_amount.toLocaleString()));
} }
if (productDetails.product.enable_tare_weight_handling == 1) if (productDetails.product.enable_tare_weight_handling == 1)
{ {
$("#new_amount").attr("min", productDetails.product.tare_weight); $("#new_amount").attr("min", productDetails.product.tare_weight);
$("#new_amount").parent().find(".invalid-feedback").text(__t('The amount cannot be lower than %s or equal %s', parseFloat(productDetails.product.tare_weight).toLocaleString({ minimumFractionDigits: 0, maximumFractionDigits: 2 }), productDetails.stock_amount.toLocaleString())); $("#new_amount").parent().find(".invalid-feedback").text(__t('The amount cannot be lower than %1$s or equal %2$s', parseFloat(productDetails.product.tare_weight).toLocaleString({ minimumFractionDigits: 0, maximumFractionDigits: 2 }), productDetails.stock_amount.toLocaleString()));
$("#tare-weight-handling-info").removeClass("d-none"); $("#tare-weight-handling-info").removeClass("d-none");
} }
else else

View File

@ -168,7 +168,7 @@ $('.input-group-qu').on('change', function(e)
if (factor > 1) if (factor > 1)
{ {
$('#qu-conversion-info').text(__t('This means 1 %s purchased will be converted into %s %s in stock', $("#qu_id_purchase option:selected").text(), (1 * factor).toString(), $("#qu_id_stock option:selected").text())); $('#qu-conversion-info').text(__t('This means 1 %1$s purchased will be converted into %2$s %3$s in stock', $("#qu_id_purchase option:selected").text(), (1 * factor).toString(), $("#qu_id_stock option:selected").text()));
$('#qu-conversion-info').removeClass('d-none'); $('#qu-conversion-info').removeClass('d-none');
} }
else else

View File

@ -53,7 +53,7 @@
); );
} }
var successMessage = __t('Added %s %s of %s to stock', result.amount, __n(result.amount, productDetails.quantity_unit_stock.name, productDetails.quantity_unit_stock.name_plural), productDetails.product.name) + '<br><a class="btn btn-secondary btn-sm mt-2" href="#" onclick="UndoStockBooking(' + result.id + ')"><i class="fas fa-undo"></i> ' + __t("Undo") + '</a>'; var successMessage = __t('Added %1$s %2$s of %3$s to stock', result.amount, __n(result.amount, productDetails.quantity_unit_stock.name, productDetails.quantity_unit_stock.name_plural), productDetails.product.name) + '<br><a class="btn btn-secondary btn-sm mt-2" href="#" onclick="UndoStockBooking(' + result.id + ')"><i class="fas fa-undo"></i> ' + __t("Undo") + '</a>';
if (GetUriParam("flow") === "shoppinglistitemtostock" && typeof GetUriParam("embedded") !== undefined) if (GetUriParam("flow") === "shoppinglistitemtostock" && typeof GetUriParam("embedded") !== undefined)
{ {
@ -115,7 +115,7 @@ Grocy.Components.ProductPicker.GetPicker().on('change', function(e)
} }
else else
{ {
$('#amount_qu_unit').text(productDetails.quantity_unit_purchase.name + " (" + __t("will be multiplied a factor of %s to get %s", parseInt(productDetails.product.qu_factor_purchase_to_stock).toString(), __n(2, productDetails.quantity_unit_stock.name, productDetails.quantity_unit_stock.name_plural)) + ")"); $('#amount_qu_unit').text(productDetails.quantity_unit_purchase.name + " (" + __t("will be multiplied a factor of %1$s to get %2$s", parseInt(productDetails.product.qu_factor_purchase_to_stock).toString(), __n(2, productDetails.quantity_unit_stock.name, productDetails.quantity_unit_stock.name_plural)) + ")");
} }
if (productDetails.product.allow_partial_units_in_stock == 1) if (productDetails.product.allow_partial_units_in_stock == 1)

View File

@ -192,7 +192,7 @@ $(document).on('click', '.shopping-list-stock-add-workflow-list-item-button', fu
if (Grocy.ShoppingListToStockWorkflowAll) if (Grocy.ShoppingListToStockWorkflowAll)
{ {
$("#shopping-list-stock-add-workflow-purchase-item-count").removeClass("d-none"); $("#shopping-list-stock-add-workflow-purchase-item-count").removeClass("d-none");
$("#shopping-list-stock-add-workflow-purchase-item-count").text(__t("Adding shopping list item %s of %s", Grocy.ShoppingListToStockWorkflowCurrent, Grocy.ShoppingListToStockWorkflowCount)); $("#shopping-list-stock-add-workflow-purchase-item-count").text(__t("Adding shopping list item %1$s of %2$s", Grocy.ShoppingListToStockWorkflowCurrent, Grocy.ShoppingListToStockWorkflowCount));
$("#shopping-list-stock-add-workflow-skip-button").removeClass("d-none"); $("#shopping-list-stock-add-workflow-skip-button").removeClass("d-none");
} }
else else

View File

@ -156,7 +156,7 @@ $(document).on('click', '.product-consume-button', function(e)
} }
Grocy.FrontendHelpers.EndUiBusy(); Grocy.FrontendHelpers.EndUiBusy();
toastr.success(__t('Removed %s %s of %s from stock', consumeAmount, productQuName, productName)); toastr.success(__t('Removed %1$s %2$s of %3$s from stock', consumeAmount, productQuName, productName));
RefreshContextualTimeago(); RefreshContextualTimeago();
RefreshStatistics(); RefreshStatistics();
}, },
@ -231,7 +231,7 @@ $(document).on('click', '.product-open-button', function(e)
} }
Grocy.FrontendHelpers.EndUiBusy(); Grocy.FrontendHelpers.EndUiBusy();
toastr.success(__t('Marked %s %s of %s as opened', 1, productQuName, productName)); toastr.success(__t('Marked %1$s of %2$s as opened', 1 + " " + productQuName, productName));
RefreshContextualTimeago(); RefreshContextualTimeago();
RefreshStatistics(); RefreshStatistics();
}, },

View File

@ -190,7 +190,7 @@
@endif @endif
{{ $__n($selectedRecipePosition->recipe_amount, FindObjectInArrayByPropertyValue($quantityunits, 'id', $selectedRecipePosition->qu_id)->name, FindObjectInArrayByPropertyValue($quantityunits, 'id', $selectedRecipePosition->qu_id)->name_plural) }} {{ FindObjectInArrayByPropertyValue($products, 'id', $selectedRecipePosition->product_id)->name }} {{ $__n($selectedRecipePosition->recipe_amount, FindObjectInArrayByPropertyValue($quantityunits, 'id', $selectedRecipePosition->qu_id)->name, FindObjectInArrayByPropertyValue($quantityunits, 'id', $selectedRecipePosition->qu_id)->name_plural) }} {{ FindObjectInArrayByPropertyValue($products, 'id', $selectedRecipePosition->product_id)->name }}
@if($selectedRecipePosition->need_fulfilled == 1)<i class="fas fa-check text-success"></i>@elseif($selectedRecipePosition->need_fulfilled_with_shopping_list == 1)<i class="fas fa-exclamation text-warning"></i>@else<i class="fas fa-times text-danger"></i>@endif @if($selectedRecipePosition->need_fulfilled == 1)<i class="fas fa-check text-success"></i>@elseif($selectedRecipePosition->need_fulfilled_with_shopping_list == 1)<i class="fas fa-exclamation text-warning"></i>@else<i class="fas fa-times text-danger"></i>@endif
<span class="timeago-contextual">@if(FindObjectInArrayByPropertyValue($selectedRecipeSubRecipesPositions, 'recipe_pos_id', $selectedRecipePosition->id)->need_fulfilled == 1) {{ $__t('Enough in stock') }} @else {{ $__t('Not enough in stock, %s missing, %s already on shopping list', round(FindObjectInArrayByPropertyValue($selectedRecipeSubRecipesPositions, 'recipe_pos_id', $selectedRecipePosition->id)->missing_amount, 2), round(FindObjectInArrayByPropertyValue($selectedRecipeSubRecipesPositions, 'recipe_pos_id', $selectedRecipePosition->id)->amount_on_shopping_list, 2)) }} @endif</span> <span class="timeago-contextual">@if(FindObjectInArrayByPropertyValue($selectedRecipeSubRecipesPositions, 'recipe_pos_id', $selectedRecipePosition->id)->need_fulfilled == 1) {{ $__t('Enough in stock') }} @else {{ $__t('Not enough in stock, %1$s missing, %2$s already on shopping list', round(FindObjectInArrayByPropertyValue($selectedRecipeSubRecipesPositions, 'recipe_pos_id', $selectedRecipePosition->id)->missing_amount, 2), round(FindObjectInArrayByPropertyValue($selectedRecipeSubRecipesPositions, 'recipe_pos_id', $selectedRecipePosition->id)->amount_on_shopping_list, 2)) }} @endif</span>
@if(!empty($selectedRecipePosition->note)) @if(!empty($selectedRecipePosition->note))
<div class="text-muted">{!! nl2br($selectedRecipePosition->note) !!}</div> <div class="text-muted">{!! nl2br($selectedRecipePosition->note) !!}</div>
@ -231,7 +231,7 @@
@endif @endif
{{ $__n($selectedRecipePosition->recipe_amount, FindObjectInArrayByPropertyValue($quantityunits, 'id', $selectedRecipePosition->qu_id)->name, FindObjectInArrayByPropertyValue($quantityunits, 'id', $selectedRecipePosition->qu_id)->name_plural) }} {{ FindObjectInArrayByPropertyValue($products, 'id', $selectedRecipePosition->product_id)->name }} {{ $__n($selectedRecipePosition->recipe_amount, FindObjectInArrayByPropertyValue($quantityunits, 'id', $selectedRecipePosition->qu_id)->name, FindObjectInArrayByPropertyValue($quantityunits, 'id', $selectedRecipePosition->qu_id)->name_plural) }} {{ FindObjectInArrayByPropertyValue($products, 'id', $selectedRecipePosition->product_id)->name }}
@if($selectedRecipePosition->need_fulfilled == 1)<i class="fas fa-check text-success"></i>@elseif($selectedRecipePosition->need_fulfilled_with_shopping_list == 1)<i class="fas fa-exclamation text-warning"></i>@else<i class="fas fa-times text-danger"></i>@endif @if($selectedRecipePosition->need_fulfilled == 1)<i class="fas fa-check text-success"></i>@elseif($selectedRecipePosition->need_fulfilled_with_shopping_list == 1)<i class="fas fa-exclamation text-warning"></i>@else<i class="fas fa-times text-danger"></i>@endif
<span class="timeago-contextual">@if(FindObjectInArrayByPropertyValue($recipePositionsResolved, 'recipe_pos_id', $selectedRecipePosition->id)->need_fulfilled == 1) {{ $__t('Enough in stock') }} @else {{ $__t('Not enough in stock, %s missing, %s already on shopping list', round(FindObjectInArrayByPropertyValue($recipePositionsResolved, 'recipe_pos_id', $selectedRecipePosition->id)->missing_amount, 2), round(FindObjectInArrayByPropertyValue($recipePositionsResolved, 'recipe_pos_id', $selectedRecipePosition->id)->amount_on_shopping_list, 2)) }} @endif</span> <span class="timeago-contextual">@if(FindObjectInArrayByPropertyValue($recipePositionsResolved, 'recipe_pos_id', $selectedRecipePosition->id)->need_fulfilled == 1) {{ $__t('Enough in stock') }} @else {{ $__t('Not enough in stock, %1$s missing, %2$s already on shopping list', round(FindObjectInArrayByPropertyValue($recipePositionsResolved, 'recipe_pos_id', $selectedRecipePosition->id)->missing_amount, 2), round(FindObjectInArrayByPropertyValue($recipePositionsResolved, 'recipe_pos_id', $selectedRecipePosition->id)->amount_on_shopping_list, 2)) }} @endif</span>
@if(!empty($selectedRecipePosition->note)) @if(!empty($selectedRecipePosition->note))
<div class="text-muted">{!! nl2br($selectedRecipePosition->note) !!}</div> <div class="text-muted">{!! nl2br($selectedRecipePosition->note) !!}</div>

View File

@ -33,7 +33,7 @@
<i class="fas fa-box"></i> {{ $__t('Add all list items to stock') }} <i class="fas fa-box"></i> {{ $__t('Add all list items to stock') }}
</a> </a>
</h1> </h1>
<p data-status-filter="belowminstockamount" class="btn btn-lg btn-info status-filter-button responsive-button">{{ $__n(count($missingProducts), $__t('%s product is below defined min. stock amount', count($missingProducts)), $__t('%s products are below defined min. stock amount', count($missingProducts))) }}</p> <p data-status-filter="belowminstockamount" class="btn btn-lg btn-info status-filter-button responsive-button">{{ $__n(count($missingProducts), '%s product is below defined min. stock amount', '%s products are below defined min. stock amount') }}</p>
</div> </div>
</div> </div>
@ -93,7 +93,7 @@
<a class="btn btn-sm btn-danger shoppinglist-delete-button" href="#" data-shoppinglist-id="{{ $listItem->id }}"> <a class="btn btn-sm btn-danger shoppinglist-delete-button" href="#" data-shoppinglist-id="{{ $listItem->id }}">
<i class="fas fa-trash"></i> <i class="fas fa-trash"></i>
</a> </a>
<a class="btn btn-sm btn-primary @if(empty($listItem->product_id)) disabled @else shopping-list-stock-add-workflow-list-item-button @endif" href="{{ $U('/purchase?embedded&flow=shoppinglistitemtostock&product=') }}{{ $listItem->product_id }}&amount={{ $listItem->amount }}&listitemid={{ $listItem->id }}" @if(!empty($listItem->product_id)) data-toggle="tooltip" title="{{ $__t('Add %s %s of %s to stock', $__n($listItem->amount, FindObjectInArrayByPropertyValue($quantityunits, 'id', FindObjectInArrayByPropertyValue($products, 'id', $listItem->product_id)->qu_id_purchase)->name, FindObjectInArrayByPropertyValue($quantityunits, 'id', FindObjectInArrayByPropertyValue($products, 'id', $listItem->product_id)->qu_id_purchase)->name_plural), FindObjectInArrayByPropertyValue($products, 'id', $listItem->product_id)->name, $listItem->amount) }}" @endif> <a class="btn btn-sm btn-primary @if(empty($listItem->product_id)) disabled @else shopping-list-stock-add-workflow-list-item-button @endif" href="{{ $U('/purchase?embedded&flow=shoppinglistitemtostock&product=') }}{{ $listItem->product_id }}&amount={{ $listItem->amount }}&listitemid={{ $listItem->id }}" @if(!empty($listItem->product_id)) data-toggle="tooltip" title="{{ $__t('Add %1$s of %2$s to stock', $listItem->amount . ' ' . $__n($listItem->amount, FindObjectInArrayByPropertyValue($quantityunits, 'id', FindObjectInArrayByPropertyValue($products, 'id', $listItem->product_id)->qu_id_purchase)->name, FindObjectInArrayByPropertyValue($quantityunits, 'id', FindObjectInArrayByPropertyValue($products, 'id', $listItem->product_id)->qu_id_purchase)->name_plural), FindObjectInArrayByPropertyValue($products, 'id', $listItem->product_id)->name, $listItem->amount) }}" @endif>
<i class="fas fa-box"></i> <i class="fas fa-box"></i>
</a> </a>
</td> </td>

View File

@ -88,7 +88,7 @@
@foreach($currentStock as $currentStockEntry) @foreach($currentStock as $currentStockEntry)
<tr id="product-{{ $currentStockEntry->product_id }}-row" class="@if($currentStockEntry->best_before_date < date('Y-m-d 23:59:59', strtotime('-1 days')) && $currentStockEntry->amount > 0) table-danger @elseif($currentStockEntry->best_before_date < date('Y-m-d 23:59:59', strtotime("+$nextXDays days")) && $currentStockEntry->amount > 0) table-warning @elseif (FindObjectInArrayByPropertyValue($missingProducts, 'id', $currentStockEntry->product_id) !== null) table-info @endif"> <tr id="product-{{ $currentStockEntry->product_id }}-row" class="@if($currentStockEntry->best_before_date < date('Y-m-d 23:59:59', strtotime('-1 days')) && $currentStockEntry->amount > 0) table-danger @elseif($currentStockEntry->best_before_date < date('Y-m-d 23:59:59', strtotime("+$nextXDays days")) && $currentStockEntry->amount > 0) table-warning @elseif (FindObjectInArrayByPropertyValue($missingProducts, 'id', $currentStockEntry->product_id) !== null) table-info @endif">
<td class="fit-content border-right"> <td class="fit-content border-right">
<a class="btn btn-success btn-sm product-consume-button @if($currentStockEntry->amount < 1) disabled @endif" href="#" data-toggle="tooltip" data-placement="left" title="{{ $__t('Consume %s of %s', '1 ' . FindObjectInArrayByPropertyValue($quantityunits, 'id', FindObjectInArrayByPropertyValue($products, 'id', $currentStockEntry->product_id)->qu_id_stock)->name, FindObjectInArrayByPropertyValue($products, 'id', $currentStockEntry->product_id)->name) }}" <a class="btn btn-success btn-sm product-consume-button @if($currentStockEntry->amount < 1) disabled @endif" href="#" data-toggle="tooltip" data-placement="left" title="{{ $__t('Consume %1$s of %2$s', '1 ' . FindObjectInArrayByPropertyValue($quantityunits, 'id', FindObjectInArrayByPropertyValue($products, 'id', $currentStockEntry->product_id)->qu_id_stock)->name, FindObjectInArrayByPropertyValue($products, 'id', $currentStockEntry->product_id)->name) }}"
data-product-id="{{ $currentStockEntry->product_id }}" data-product-id="{{ $currentStockEntry->product_id }}"
data-product-name="{{ FindObjectInArrayByPropertyValue($products, 'id', $currentStockEntry->product_id)->name }}" data-product-name="{{ FindObjectInArrayByPropertyValue($products, 'id', $currentStockEntry->product_id)->name }}"
data-product-qu-name="{{ FindObjectInArrayByPropertyValue($quantityunits, 'id', FindObjectInArrayByPropertyValue($products, 'id', $currentStockEntry->product_id)->qu_id_stock)->name }}" data-product-qu-name="{{ FindObjectInArrayByPropertyValue($quantityunits, 'id', FindObjectInArrayByPropertyValue($products, 'id', $currentStockEntry->product_id)->qu_id_stock)->name }}"
@ -102,7 +102,7 @@
data-consume-amount="{{ $currentStockEntry->amount }}"> data-consume-amount="{{ $currentStockEntry->amount }}">
<i class="fas fa-utensils"></i> {{ $__t('All') }} <i class="fas fa-utensils"></i> {{ $__t('All') }}
</a> </a>
<a class="btn btn-success btn-sm product-open-button @if($currentStockEntry->amount < 1 || $currentStockEntry->amount == $currentStockEntry->amount_opened) disabled @endif" href="#" data-toggle="tooltip" data-placement="left" title="{{ $__t('Mark %s of %s as open', '1 ' . FindObjectInArrayByPropertyValue($quantityunits, 'id', FindObjectInArrayByPropertyValue($products, 'id', $currentStockEntry->product_id)->qu_id_stock)->name, FindObjectInArrayByPropertyValue($products, 'id', $currentStockEntry->product_id)->name) }}" <a class="btn btn-success btn-sm product-open-button @if($currentStockEntry->amount < 1 || $currentStockEntry->amount == $currentStockEntry->amount_opened) disabled @endif" href="#" data-toggle="tooltip" data-placement="left" title="{{ $__t('Mark %1$s of %2$s as open', '1 ' . FindObjectInArrayByPropertyValue($quantityunits, 'id', FindObjectInArrayByPropertyValue($products, 'id', $currentStockEntry->product_id)->qu_id_stock)->name, FindObjectInArrayByPropertyValue($products, 'id', $currentStockEntry->product_id)->name) }}"
data-product-id="{{ $currentStockEntry->product_id }}" data-product-id="{{ $currentStockEntry->product_id }}"
data-product-name="{{ FindObjectInArrayByPropertyValue($products, 'id', $currentStockEntry->product_id)->name }}" data-product-name="{{ FindObjectInArrayByPropertyValue($products, 'id', $currentStockEntry->product_id)->name }}"
data-product-qu-name="{{ FindObjectInArrayByPropertyValue($quantityunits, 'id', FindObjectInArrayByPropertyValue($products, 'id', $currentStockEntry->product_id)->qu_id_stock)->name }}"> data-product-qu-name="{{ FindObjectInArrayByPropertyValue($quantityunits, 'id', FindObjectInArrayByPropertyValue($products, 'id', $currentStockEntry->product_id)->qu_id_stock)->name }}">