fix: split Bimby/Cookeo appliances, add missing i18n keys, improve use_all dialog
- .env: split 'Bimby/Moulinex Cookeo' into 'Bimby' and 'Moulinex Cookeo'
- translations (it/en/de): add use_all_confirm_*, throw_all_confirm_*,
confirm.cancel, confirm.proceed, location.dispensa/frigo/freezer
- app.js: when ANY opened package exists, always show disambiguation
dialog ('solo questa confezione?' vs 'tutto?') instead of silently
finishing one — was previously showing dialog only for 2+ opened packages
This commit is contained in:
+2
-11
@@ -7234,21 +7234,12 @@ async function _doSubmitUseAll() {
|
|||||||
const currentLoc = document.getElementById('use-location')?.value || '__all__';
|
const currentLoc = document.getElementById('use-location')?.value || '__all__';
|
||||||
const items = _useCurrentItems.filter(i => parseFloat(i.quantity) > 0);
|
const items = _useCurrentItems.filter(i => parseFloat(i.quantity) > 0);
|
||||||
|
|
||||||
const openedAtCurrentLoc = items.find(i => i.location === currentLoc && _isOpenedInventoryItem(i));
|
|
||||||
const allOpened = items.filter(_isOpenedInventoryItem);
|
const allOpened = items.filter(_isOpenedInventoryItem);
|
||||||
|
|
||||||
let useLocation;
|
let useLocation;
|
||||||
|
|
||||||
if (openedAtCurrentLoc) {
|
if (allOpened.length >= 1) {
|
||||||
// Opened package at the currently selected location → finish only the opened item.
|
// One or more opened packages → always ask the user what they mean
|
||||||
// The PHP backend fetches fractional (opened) rows first, so use_all on a specific
|
|
||||||
// location will clear the opened row and leave sealed packages untouched.
|
|
||||||
useLocation = currentLoc;
|
|
||||||
} else if (allOpened.length === 1) {
|
|
||||||
// One opened package somewhere else → almost certainly this is what the user means
|
|
||||||
useLocation = allOpened[0].location;
|
|
||||||
} else if (allOpened.length > 1) {
|
|
||||||
// Multiple opened packages at different locations → ask the user
|
|
||||||
showLoading(false);
|
showLoading(false);
|
||||||
_showUseAllDisambiguation(allOpened, items);
|
_showUseAllDisambiguation(allOpened, items);
|
||||||
return;
|
return;
|
||||||
|
|||||||
+15
-2
@@ -243,7 +243,13 @@
|
|||||||
"toast_opened_finished": "🔓 Geöffnete Packung von {name} aufgebraucht!",
|
"toast_opened_finished": "🔓 Geöffnete Packung von {name} aufgebraucht!",
|
||||||
"disambiguation_hint": "Was meinst du mit \"alles aufgebraucht\"?",
|
"disambiguation_hint": "Was meinst du mit \"alles aufgebraucht\"?",
|
||||||
"disambiguation_all": "🗑️ ALLES verbraucht ({qty})",
|
"disambiguation_all": "🗑️ ALLES verbraucht ({qty})",
|
||||||
"error_exceeds_stock": "⚠️ Du kannst nicht mehr verwenden als du verfügbar hast!"
|
"error_exceeds_stock": "⚠️ Du kannst nicht mehr verwenden als du verfügbar hast!",
|
||||||
|
"use_all_confirm_title": "✅ Alles aufbrauchen",
|
||||||
|
"use_all_confirm_msg": "Bestätige, dass du das Produkt vollständig aufgebraucht hast:",
|
||||||
|
"use_all_confirm_btn": "✅ Ja, aufgebraucht",
|
||||||
|
"throw_all_confirm_title": "🗑️ Alles entsorgen",
|
||||||
|
"throw_all_confirm_msg": "Möchtest du wirklich das gesamte Produkt entsorgen?",
|
||||||
|
"throw_all_confirm_btn": "🗑️ Ja, entsorgen"
|
||||||
},
|
},
|
||||||
"product": {
|
"product": {
|
||||||
"title_new": "Neues Produkt",
|
"title_new": "Neues Produkt",
|
||||||
@@ -746,7 +752,14 @@
|
|||||||
},
|
},
|
||||||
"confirm": {
|
"confirm": {
|
||||||
"remove_item": "Möchtest du dieses Produkt wirklich aus dem Bestand entfernen?",
|
"remove_item": "Möchtest du dieses Produkt wirklich aus dem Bestand entfernen?",
|
||||||
"kiosk_exit": "Kioskmodus verlassen?"
|
"kiosk_exit": "Kioskmodus verlassen?",
|
||||||
|
"cancel": "Abbrechen",
|
||||||
|
"proceed": "Bestätigen"
|
||||||
|
},
|
||||||
|
"location": {
|
||||||
|
"dispensa": "Vorratskammer",
|
||||||
|
"frigo": "Kühlschrank",
|
||||||
|
"freezer": "Gefrierschrank"
|
||||||
},
|
},
|
||||||
"edit": {
|
"edit": {
|
||||||
"title": "{name} bearbeiten",
|
"title": "{name} bearbeiten",
|
||||||
|
|||||||
+15
-2
@@ -242,7 +242,13 @@
|
|||||||
"toast_opened_finished": "🔓 Opened package of {name} finished!",
|
"toast_opened_finished": "🔓 Opened package of {name} finished!",
|
||||||
"disambiguation_hint": "What do you mean by \"all done\"?",
|
"disambiguation_hint": "What do you mean by \"all done\"?",
|
||||||
"disambiguation_all": "🗑️ Finish EVERYTHING ({qty})",
|
"disambiguation_all": "🗑️ Finish EVERYTHING ({qty})",
|
||||||
"error_exceeds_stock": "⚠️ You cannot use more than you have available!"
|
"error_exceeds_stock": "⚠️ You cannot use more than you have available!",
|
||||||
|
"use_all_confirm_title": "✅ Finish everything",
|
||||||
|
"use_all_confirm_msg": "Confirm that you have finished the product:",
|
||||||
|
"use_all_confirm_btn": "✅ Yes, finished",
|
||||||
|
"throw_all_confirm_title": "🗑️ Discard everything",
|
||||||
|
"throw_all_confirm_msg": "Do you really want to throw away the whole product?",
|
||||||
|
"throw_all_confirm_btn": "🗑️ Yes, discard"
|
||||||
},
|
},
|
||||||
"product": {
|
"product": {
|
||||||
"title_new": "New Product",
|
"title_new": "New Product",
|
||||||
@@ -745,7 +751,14 @@
|
|||||||
},
|
},
|
||||||
"confirm": {
|
"confirm": {
|
||||||
"remove_item": "Do you really want to remove this product from inventory?",
|
"remove_item": "Do you really want to remove this product from inventory?",
|
||||||
"kiosk_exit": "Exit kiosk mode?"
|
"kiosk_exit": "Exit kiosk mode?",
|
||||||
|
"cancel": "Cancel",
|
||||||
|
"proceed": "Confirm"
|
||||||
|
},
|
||||||
|
"location": {
|
||||||
|
"dispensa": "Pantry",
|
||||||
|
"frigo": "Fridge",
|
||||||
|
"freezer": "Freezer"
|
||||||
},
|
},
|
||||||
"edit": {
|
"edit": {
|
||||||
"title": "Edit {name}",
|
"title": "Edit {name}",
|
||||||
|
|||||||
+15
-2
@@ -242,7 +242,13 @@
|
|||||||
"toast_opened_finished": "🔓 Confezione aperta di {name} finita!",
|
"toast_opened_finished": "🔓 Confezione aperta di {name} finita!",
|
||||||
"disambiguation_hint": "Cosa intendi con \"finito tutto\"?",
|
"disambiguation_hint": "Cosa intendi con \"finito tutto\"?",
|
||||||
"disambiguation_all": "🗑️ Finito TUTTO ({qty})",
|
"disambiguation_all": "🗑️ Finito TUTTO ({qty})",
|
||||||
"error_exceeds_stock": "⚠️ Non puoi usare più di quanto hai disponibile!"
|
"error_exceeds_stock": "⚠️ Non puoi usare più di quanto hai disponibile!",
|
||||||
|
"use_all_confirm_title": "✅ Finisci tutto",
|
||||||
|
"use_all_confirm_msg": "Conferma che hai finito tutto il prodotto:",
|
||||||
|
"use_all_confirm_btn": "✅ Sì, finito",
|
||||||
|
"throw_all_confirm_title": "🗑️ Butta tutto",
|
||||||
|
"throw_all_confirm_msg": "Vuoi davvero buttare via tutto il prodotto?",
|
||||||
|
"throw_all_confirm_btn": "🗑️ Sì, butta"
|
||||||
},
|
},
|
||||||
"product": {
|
"product": {
|
||||||
"title_new": "Nuovo Prodotto",
|
"title_new": "Nuovo Prodotto",
|
||||||
@@ -745,7 +751,14 @@
|
|||||||
},
|
},
|
||||||
"confirm": {
|
"confirm": {
|
||||||
"remove_item": "Vuoi davvero rimuovere questo prodotto dall'inventario?",
|
"remove_item": "Vuoi davvero rimuovere questo prodotto dall'inventario?",
|
||||||
"kiosk_exit": "Uscire dalla modalità kiosk?"
|
"kiosk_exit": "Uscire dalla modalità kiosk?",
|
||||||
|
"cancel": "Annulla",
|
||||||
|
"proceed": "Conferma"
|
||||||
|
},
|
||||||
|
"location": {
|
||||||
|
"dispensa": "Dispensa",
|
||||||
|
"frigo": "Frigo",
|
||||||
|
"freezer": "Freezer"
|
||||||
},
|
},
|
||||||
"edit": {
|
"edit": {
|
||||||
"title": "Modifica {name}",
|
"title": "Modifica {name}",
|
||||||
|
|||||||
Reference in New Issue
Block a user