Merge branch 'mealie-next' into fix/translation-issues-when-scraping

This commit is contained in:
Michael Genson 2024-02-07 09:58:45 -06:00 committed by GitHub
commit d4de15ba1e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
47 changed files with 419 additions and 217 deletions

View File

@ -43,7 +43,7 @@ export const usePublicFoodStore = function (groupSlug: string) {
},
};
if (!foodStore.value) {
if (!foodStore.value || foodStore.value.length === 0) {
foodStore = actions.getAll();
}
@ -61,7 +61,7 @@ export const useFoodStore = function () {
},
};
if (!foodStore) {
if (!foodStore.value || foodStore.value.length === 0) {
foodStore = actions.getAll();
}

View File

@ -33,11 +33,11 @@ export function useLabelStore() {
const actions = {
...useStoreActions<MultiPurposeLabelOut>(api.multiPurposeLabels, labelStore, loading),
flushStore() {
labelStore.value =[];
labelStore.value = [];
},
};
if (!labelStore.value) {
if (!labelStore.value || labelStore.value?.length === 0) {
labelStore = actions.getAll();
}

View File

@ -44,7 +44,7 @@ export const useUnitStore = function () {
},
};
if (!unitStore.value) {
if (!unitStore.value || unitStore.value.length === 0) {
unitStore = actions.getAll();
}

View File

@ -199,7 +199,8 @@
"upload-file": "Laai dokument op",
"created-on-date": "Geskep op: {0}",
"unsaved-changes": "You have unsaved changes. Do you want to save before leaving? Okay to save, Cancel to discard changes.",
"clipboard-copy-failure": "Failed to copy to the clipboard."
"clipboard-copy-failure": "Failed to copy to the clipboard.",
"confirm-delete-generic-items": "Are you sure you want to delete the following items?"
},
"group": {
"are-you-sure-you-want-to-delete-the-group": "Is jy seker jy wil <b>{groupName}<b/> uitvee?",
@ -1185,6 +1186,8 @@
"require-all-tags": "Vereis alle merkers",
"require-all-tools": "Vereis alle kookgerei",
"cookbook-name": "Naam van die kookboek",
"cookbook-with-name": "Kookboek {0}"
"cookbook-with-name": "Kookboek {0}",
"create-a-cookbook": "Create a Cookbook",
"cookbook": "Cookbook"
}
}

View File

@ -199,7 +199,8 @@
"upload-file": "تحميل الملف",
"created-on-date": "تم الإنشاء في {0}",
"unsaved-changes": "You have unsaved changes. Do you want to save before leaving? Okay to save, Cancel to discard changes.",
"clipboard-copy-failure": "Failed to copy to the clipboard."
"clipboard-copy-failure": "Failed to copy to the clipboard.",
"confirm-delete-generic-items": "Are you sure you want to delete the following items?"
},
"group": {
"are-you-sure-you-want-to-delete-the-group": "هل انت متأكد من رغبتك في حذف <b>{groupName}<b/>؟",
@ -1185,6 +1186,8 @@
"require-all-tags": "Require All Tags",
"require-all-tools": "Require All Tools",
"cookbook-name": "Cookbook Name",
"cookbook-with-name": "Cookbook {0}"
"cookbook-with-name": "Cookbook {0}",
"create-a-cookbook": "Create a Cookbook",
"cookbook": "Cookbook"
}
}

View File

@ -199,7 +199,8 @@
"upload-file": "Качване на файл",
"created-on-date": "Създадено на {0}",
"unsaved-changes": "Имате незапазени промени. Желаете ли да ги запазите преди да излезете? Натиснете Ок за запазване и Отказ за отхвърляне на промените.",
"clipboard-copy-failure": "Линкът към рецептата е копиран в клипборда."
"clipboard-copy-failure": "Линкът към рецептата е копиран в клипборда.",
"confirm-delete-generic-items": "Are you sure you want to delete the following items?"
},
"group": {
"are-you-sure-you-want-to-delete-the-group": "Сигурни ли сте, че искате да изтриете <b>{groupName}<b/>?",
@ -1185,6 +1186,8 @@
"require-all-tags": "Изискване на всички тагове",
"require-all-tools": "Изискване на всички инструменти",
"cookbook-name": "Име на книгата с рецепти",
"cookbook-with-name": "Книга с рецепти {0}"
"cookbook-with-name": "Книга с рецепти {0}",
"create-a-cookbook": "Create a Cookbook",
"cookbook": "Cookbook"
}
}

View File

@ -199,7 +199,8 @@
"upload-file": "Puja un fitxer",
"created-on-date": "Creat el: {0}",
"unsaved-changes": "Tens canvis que no estan guardats. Vols guardar-los abans de sortir? Clica d'acord per guardar-los o cancel·lar per descartar els canvis.",
"clipboard-copy-failure": "No s'ha pogut copiar al porta-retalls."
"clipboard-copy-failure": "No s'ha pogut copiar al porta-retalls.",
"confirm-delete-generic-items": "Are you sure you want to delete the following items?"
},
"group": {
"are-you-sure-you-want-to-delete-the-group": "Esteu segur de voler suprimir el grup <b>{groupName}<b/>?",
@ -1185,6 +1186,8 @@
"require-all-tags": "Requereix totes les etiquetes",
"require-all-tools": "Requereix tots els utensilis",
"cookbook-name": "Nom del receptari",
"cookbook-with-name": "Receptari {0}"
"cookbook-with-name": "Receptari {0}",
"create-a-cookbook": "Create a Cookbook",
"cookbook": "Cookbook"
}
}

View File

@ -199,7 +199,8 @@
"upload-file": "Nahrát soubor",
"created-on-date": "Vytvořeno dne: {0}",
"unsaved-changes": "You have unsaved changes. Do you want to save before leaving? Okay to save, Cancel to discard changes.",
"clipboard-copy-failure": "Failed to copy to the clipboard."
"clipboard-copy-failure": "Failed to copy to the clipboard.",
"confirm-delete-generic-items": "Are you sure you want to delete the following items?"
},
"group": {
"are-you-sure-you-want-to-delete-the-group": "Jste si jisti, že chcete smazat <b>{groupName}<b/>?",
@ -1185,6 +1186,8 @@
"require-all-tags": "Vyžadovat všechny štítky",
"require-all-tools": "Vyžadovat všechny nástroje",
"cookbook-name": "Název kuchařky",
"cookbook-with-name": "Kuchařka {0}"
"cookbook-with-name": "Kuchařka {0}",
"create-a-cookbook": "Create a Cookbook",
"cookbook": "Cookbook"
}
}

View File

@ -199,7 +199,8 @@
"upload-file": "Upload Fil",
"created-on-date": "Oprettet den: {0}",
"unsaved-changes": "Du har ændringer som ikke er gemt. Vil du gemme før du forlader? Vælg \"Okay\" for at gemme, eller \"Annullér\" for at kassere ændringer.",
"clipboard-copy-failure": "Failed to copy to the clipboard."
"clipboard-copy-failure": "Failed to copy to the clipboard.",
"confirm-delete-generic-items": "Are you sure you want to delete the following items?"
},
"group": {
"are-you-sure-you-want-to-delete-the-group": "Er du sikker på, du vil slette <b>{groupName}<b/>?",
@ -1185,6 +1186,8 @@
"require-all-tags": "Kræv Alle Mærker",
"require-all-tools": "Kræv Alle Værktøjer",
"cookbook-name": "Navn på kogebog",
"cookbook-with-name": "Kogebog {0}"
"cookbook-with-name": "Kogebog {0}",
"create-a-cookbook": "Opret en ny kogebog",
"cookbook": "Kogebog"
}
}

View File

@ -199,7 +199,8 @@
"upload-file": "Datei hochladen",
"created-on-date": "Erstellt am: {0}",
"unsaved-changes": "Du hast ungespeicherte Änderungen. Möchtest du vor dem Verlassen speichern? OK um zu speichern, Cancel um Änderungen zu verwerfen.",
"clipboard-copy-failure": "Fehler beim Kopieren in die Zwischenablage."
"clipboard-copy-failure": "Fehler beim Kopieren in die Zwischenablage.",
"confirm-delete-generic-items": "Bist du dir sicher, dass du die folgenden Einträge löschen möchtest?"
},
"group": {
"are-you-sure-you-want-to-delete-the-group": "Bist du dir sicher, dass du die Gruppe <b>{groupName}<b/> löschen möchtest?",
@ -1185,6 +1186,8 @@
"require-all-tags": "Alle Schlagwörter erforderlich",
"require-all-tools": "Alle Utensilien erforderlich",
"cookbook-name": "Kochbuch Name",
"cookbook-with-name": "Kochbuch {0}"
"cookbook-with-name": "Kochbuch {0}",
"create-a-cookbook": "Ein Kochbuch erstellen",
"cookbook": "Kochbuch"
}
}

View File

@ -199,7 +199,8 @@
"upload-file": "Μεταφόρτωση αρχείου",
"created-on-date": "Δημιουργήθηκε στις: {0}",
"unsaved-changes": "You have unsaved changes. Do you want to save before leaving? Okay to save, Cancel to discard changes.",
"clipboard-copy-failure": "Failed to copy to the clipboard."
"clipboard-copy-failure": "Failed to copy to the clipboard.",
"confirm-delete-generic-items": "Are you sure you want to delete the following items?"
},
"group": {
"are-you-sure-you-want-to-delete-the-group": "Είστε βέβαιοι ότι θέλετε να διαγράψετε αυτό τον ασφαλή σύνδεσμο <b>{groupName}<b/>;",
@ -1185,6 +1186,8 @@
"require-all-tags": "Require All Tags",
"require-all-tools": "Require All Tools",
"cookbook-name": "Cookbook Name",
"cookbook-with-name": "Cookbook {0}"
"cookbook-with-name": "Cookbook {0}",
"create-a-cookbook": "Create a Cookbook",
"cookbook": "Cookbook"
}
}

View File

@ -199,7 +199,8 @@
"upload-file": "Upload File",
"created-on-date": "Created on: {0}",
"unsaved-changes": "You have unsaved changes. Do you want to save before leaving? Okay to save, Cancel to discard changes.",
"clipboard-copy-failure": "Failed to copy to the clipboard."
"clipboard-copy-failure": "Failed to copy to the clipboard.",
"confirm-delete-generic-items": "Are you sure you want to delete the following items?"
},
"group": {
"are-you-sure-you-want-to-delete-the-group": "Are you sure you want to delete <b>{groupName}<b/>?",
@ -1185,6 +1186,8 @@
"require-all-tags": "Require All Tags",
"require-all-tools": "Require All Tools",
"cookbook-name": "Cookbook Name",
"cookbook-with-name": "Cookbook {0}"
"cookbook-with-name": "Cookbook {0}",
"create-a-cookbook": "Create a Cookbook",
"cookbook": "Cookbook"
}
}

View File

@ -199,7 +199,8 @@
"upload-file": "Subir Archivo",
"created-on-date": "Creado el {0}",
"unsaved-changes": "Tienes cambios sin guardar. ¿Quieres guardar antes de salir? Aceptar para guardar, Cancelar para descartar cambios.",
"clipboard-copy-failure": "No se pudo copiar al portapapeles."
"clipboard-copy-failure": "No se pudo copiar al portapapeles.",
"confirm-delete-generic-items": "Are you sure you want to delete the following items?"
},
"group": {
"are-you-sure-you-want-to-delete-the-group": "Por favor, confirma que deseas eliminar <b>{groupName}<b/>",
@ -1185,6 +1186,8 @@
"require-all-tags": "Requerir todas las etiquetas",
"require-all-tools": "Requiere todos los utensilios",
"cookbook-name": "Nombre del recetario",
"cookbook-with-name": "Recetario {0}"
"cookbook-with-name": "Recetario {0}",
"create-a-cookbook": "Create a Cookbook",
"cookbook": "Cookbook"
}
}

View File

@ -199,7 +199,8 @@
"upload-file": "Tuo tiedosto",
"created-on-date": "Luotu {0}",
"unsaved-changes": "You have unsaved changes. Do you want to save before leaving? Okay to save, Cancel to discard changes.",
"clipboard-copy-failure": "Failed to copy to the clipboard."
"clipboard-copy-failure": "Failed to copy to the clipboard.",
"confirm-delete-generic-items": "Are you sure you want to delete the following items?"
},
"group": {
"are-you-sure-you-want-to-delete-the-group": "Haluatko varmasti poistaa ryhmän <b>{groupName}<b/>?",
@ -1185,6 +1186,8 @@
"require-all-tags": "Vaadi Kaikki Tunnisteet",
"require-all-tools": "Vaadi Kaikki Työkalut",
"cookbook-name": "Keittokirjan Nimi",
"cookbook-with-name": "Keittokirja {0}"
"cookbook-with-name": "Keittokirja {0}",
"create-a-cookbook": "Create a Cookbook",
"cookbook": "Cookbook"
}
}

View File

@ -199,7 +199,8 @@
"upload-file": "Transférer un fichier",
"created-on-date": "Créé le {0}",
"unsaved-changes": "Vous avez des modifications non enregistrées. Voulez-vous les enregistrer? Ok pour enregistrer, annuler pour ignorer les modifications.",
"clipboard-copy-failure": "Échec de la copie vers le presse-papiers."
"clipboard-copy-failure": "Échec de la copie vers le presse-papiers.",
"confirm-delete-generic-items": "Êtes-vous sûr de vouloir supprimer les éléments suivants ?"
},
"group": {
"are-you-sure-you-want-to-delete-the-group": "Êtes-vous certain de vouloir supprimer <b>{groupName}<b/>?",
@ -1185,6 +1186,8 @@
"require-all-tags": "Nécessite tous les mots-clés",
"require-all-tools": "Nécessite tous les ustensiles",
"cookbook-name": "Nom du livre de recettes",
"cookbook-with-name": "Livre de recettes {0}"
"cookbook-with-name": "Livre de recettes {0}",
"create-a-cookbook": "Créer un nouveau livre de recettes",
"cookbook": "Livre de recettes"
}
}

View File

@ -199,7 +199,8 @@
"upload-file": "Transférer un fichier",
"created-on-date": "Créé le {0}",
"unsaved-changes": "Vous avez des modifications non enregistrées. Voulez-vous enregistrer avant de partir? OK pour enregistrer, Annuler pour ignorer les modifications.",
"clipboard-copy-failure": "Échec de la copie dans le presse-papiers."
"clipboard-copy-failure": "Échec de la copie dans le presse-papiers.",
"confirm-delete-generic-items": "Êtes-vous sûr de vouloir supprimer les éléments suivants ?"
},
"group": {
"are-you-sure-you-want-to-delete-the-group": "Voulez-vous vraiment supprimer <b>{groupName}<b/>?",
@ -1185,6 +1186,8 @@
"require-all-tags": "Nécessite tous les mots-clés",
"require-all-tools": "Nécessite tous les ustensiles",
"cookbook-name": "Nom du livre de recettes",
"cookbook-with-name": "Livre de recettes {0}"
"cookbook-with-name": "Livre de recettes {0}",
"create-a-cookbook": "Create a Cookbook",
"cookbook": "Cookbook"
}
}

View File

@ -199,7 +199,8 @@
"upload-file": "Upload File",
"created-on-date": "Created on: {0}",
"unsaved-changes": "You have unsaved changes. Do you want to save before leaving? Okay to save, Cancel to discard changes.",
"clipboard-copy-failure": "Failed to copy to the clipboard."
"clipboard-copy-failure": "Failed to copy to the clipboard.",
"confirm-delete-generic-items": "Are you sure you want to delete the following items?"
},
"group": {
"are-you-sure-you-want-to-delete-the-group": "Are you sure you want to delete <b>{groupName}<b/>?",
@ -1185,6 +1186,8 @@
"require-all-tags": "Require All Tags",
"require-all-tools": "Require All Tools",
"cookbook-name": "Cookbook Name",
"cookbook-with-name": "Cookbook {0}"
"cookbook-with-name": "Cookbook {0}",
"create-a-cookbook": "Create a Cookbook",
"cookbook": "Cookbook"
}
}

View File

@ -199,7 +199,8 @@
"upload-file": "העלאת קבצים",
"created-on-date": "נוצר ב-{0}",
"unsaved-changes": "יש שינויים שלא נשמרו. לצאת לפני שמירה? אשר לשמירה, בטל למחיקת שינויים.",
"clipboard-copy-failure": "כשלון בהעתקה ללוח ההדבקה."
"clipboard-copy-failure": "כשלון בהעתקה ללוח ההדבקה.",
"confirm-delete-generic-items": "Are you sure you want to delete the following items?"
},
"group": {
"are-you-sure-you-want-to-delete-the-group": "האם את/ה בטוח/ה שברצונך למחוק את <b>{groupName}<b/>?",
@ -1185,6 +1186,8 @@
"require-all-tags": "זקוק לכל התגיות",
"require-all-tools": "זקוק לכל הכלים",
"cookbook-name": "שם ספר בישול",
"cookbook-with-name": "ספר בישול {0}"
"cookbook-with-name": "ספר בישול {0}",
"create-a-cookbook": "Create a Cookbook",
"cookbook": "Cookbook"
}
}

View File

@ -199,7 +199,8 @@
"upload-file": "Prenesi Datoteku",
"created-on-date": "Kreirano dana: {0}",
"unsaved-changes": "You have unsaved changes. Do you want to save before leaving? Okay to save, Cancel to discard changes.",
"clipboard-copy-failure": "Failed to copy to the clipboard."
"clipboard-copy-failure": "Failed to copy to the clipboard.",
"confirm-delete-generic-items": "Are you sure you want to delete the following items?"
},
"group": {
"are-you-sure-you-want-to-delete-the-group": "Jeste li sigurni da želite izbrisati <b>{groupName}<b/>?",
@ -1185,6 +1186,8 @@
"require-all-tags": "Zahtijevaj sve oznake",
"require-all-tools": "Zahtijevaj sve Alate",
"cookbook-name": "Naziv Zbirke recepata",
"cookbook-with-name": "ZbirkaRecepata {0}"
"cookbook-with-name": "ZbirkaRecepata {0}",
"create-a-cookbook": "Create a Cookbook",
"cookbook": "Cookbook"
}
}

View File

@ -199,7 +199,8 @@
"upload-file": "Fájl feltöltése",
"created-on-date": "Létrehozva: {0}",
"unsaved-changes": "El nem mentett módosításai vannak. Szeretné elmenteni, mielőtt kilép? A mentéshez kattintson az Ok, a módosítások elvetéséhez a Mégsem gombra.",
"clipboard-copy-failure": "Nem sikerült a vágólapra másolás."
"clipboard-copy-failure": "Nem sikerült a vágólapra másolás.",
"confirm-delete-generic-items": "Biztos benne, hogy törölni szeretné az alábbi tételeket?"
},
"group": {
"are-you-sure-you-want-to-delete-the-group": "Biztosan törölni szeretnéd ezt: <b>{groupName}<b/>?",
@ -1185,6 +1186,8 @@
"require-all-tags": "Minden címke szükséges",
"require-all-tools": "Minden szükséges eszköz",
"cookbook-name": "Szakácskönyv neve",
"cookbook-with-name": "Szakácskönyv {0}"
"cookbook-with-name": "Szakácskönyv {0}",
"create-a-cookbook": "Szakácskönyv létrehozása",
"cookbook": "Szakácskönyv"
}
}

View File

@ -199,7 +199,8 @@
"upload-file": "Upload File",
"created-on-date": "Created on: {0}",
"unsaved-changes": "You have unsaved changes. Do you want to save before leaving? Okay to save, Cancel to discard changes.",
"clipboard-copy-failure": "Failed to copy to the clipboard."
"clipboard-copy-failure": "Failed to copy to the clipboard.",
"confirm-delete-generic-items": "Are you sure you want to delete the following items?"
},
"group": {
"are-you-sure-you-want-to-delete-the-group": "Are you sure you want to delete <b>{groupName}<b/>?",
@ -1185,6 +1186,8 @@
"require-all-tags": "Require All Tags",
"require-all-tools": "Require All Tools",
"cookbook-name": "Cookbook Name",
"cookbook-with-name": "Cookbook {0}"
"cookbook-with-name": "Cookbook {0}",
"create-a-cookbook": "Create a Cookbook",
"cookbook": "Cookbook"
}
}

View File

@ -199,7 +199,8 @@
"upload-file": "Carica file",
"created-on-date": "Creato il: {0}",
"unsaved-changes": "Sono state apportate modifiche non salvate. Salvare prima di uscire? Premi Ok per salvare, Annulla per scartare le modifiche.",
"clipboard-copy-failure": "Impossibile copiare negli appunti."
"clipboard-copy-failure": "Impossibile copiare negli appunti.",
"confirm-delete-generic-items": "Sei sicuro di voler eliminare i seguenti elementi?"
},
"group": {
"are-you-sure-you-want-to-delete-the-group": "Sei sicuro di volerlo eliminare <b>{groupName}<b/>'?",
@ -1185,6 +1186,8 @@
"require-all-tags": "Richiedi Tutti I Tag",
"require-all-tools": "Richiedi Tutti Gli Strumenti",
"cookbook-name": "Nome Ricettario",
"cookbook-with-name": "Ricettario {0}"
"cookbook-with-name": "Ricettario {0}",
"create-a-cookbook": "Crea un libro di cucina",
"cookbook": "Libro di cucina"
}
}

View File

@ -199,7 +199,8 @@
"upload-file": "ファイルのアップロード",
"created-on-date": "Created on: {0}",
"unsaved-changes": "You have unsaved changes. Do you want to save before leaving? Okay to save, Cancel to discard changes.",
"clipboard-copy-failure": "Failed to copy to the clipboard."
"clipboard-copy-failure": "Failed to copy to the clipboard.",
"confirm-delete-generic-items": "Are you sure you want to delete the following items?"
},
"group": {
"are-you-sure-you-want-to-delete-the-group": "<b>{groupName}<b/> を削除しますか?",
@ -1185,6 +1186,8 @@
"require-all-tags": "Require All Tags",
"require-all-tools": "Require All Tools",
"cookbook-name": "Cookbook Name",
"cookbook-with-name": "Cookbook {0}"
"cookbook-with-name": "Cookbook {0}",
"create-a-cookbook": "Create a Cookbook",
"cookbook": "Cookbook"
}
}

View File

@ -199,7 +199,8 @@
"upload-file": "Upload File",
"created-on-date": "Created on: {0}",
"unsaved-changes": "You have unsaved changes. Do you want to save before leaving? Okay to save, Cancel to discard changes.",
"clipboard-copy-failure": "Failed to copy to the clipboard."
"clipboard-copy-failure": "Failed to copy to the clipboard.",
"confirm-delete-generic-items": "Are you sure you want to delete the following items?"
},
"group": {
"are-you-sure-you-want-to-delete-the-group": "Are you sure you want to delete <b>{groupName}<b/>?",
@ -1185,6 +1186,8 @@
"require-all-tags": "Require All Tags",
"require-all-tools": "Require All Tools",
"cookbook-name": "Cookbook Name",
"cookbook-with-name": "Cookbook {0}"
"cookbook-with-name": "Cookbook {0}",
"create-a-cookbook": "Create a Cookbook",
"cookbook": "Cookbook"
}
}

View File

@ -199,7 +199,8 @@
"upload-file": "Įkelti failą",
"created-on-date": "Sukurta: {0}",
"unsaved-changes": "You have unsaved changes. Do you want to save before leaving? Okay to save, Cancel to discard changes.",
"clipboard-copy-failure": "Failed to copy to the clipboard."
"clipboard-copy-failure": "Failed to copy to the clipboard.",
"confirm-delete-generic-items": "Are you sure you want to delete the following items?"
},
"group": {
"are-you-sure-you-want-to-delete-the-group": "Ar tikrai norite ištrinti <b>{groupName}<b/>?",
@ -1185,6 +1186,8 @@
"require-all-tags": "Būtinos visos žymos",
"require-all-tools": "Būtini visi įrankiai",
"cookbook-name": "Receptų knygos pavadinimas",
"cookbook-with-name": "Receptų knyga {0}"
"cookbook-with-name": "Receptų knyga {0}",
"create-a-cookbook": "Create a Cookbook",
"cookbook": "Cookbook"
}
}

View File

@ -199,7 +199,8 @@
"upload-file": "Upload File",
"created-on-date": "Created on: {0}",
"unsaved-changes": "You have unsaved changes. Do you want to save before leaving? Okay to save, Cancel to discard changes.",
"clipboard-copy-failure": "Failed to copy to the clipboard."
"clipboard-copy-failure": "Failed to copy to the clipboard.",
"confirm-delete-generic-items": "Are you sure you want to delete the following items?"
},
"group": {
"are-you-sure-you-want-to-delete-the-group": "Are you sure you want to delete <b>{groupName}<b/>?",
@ -1185,6 +1186,8 @@
"require-all-tags": "Require All Tags",
"require-all-tools": "Require All Tools",
"cookbook-name": "Cookbook Name",
"cookbook-with-name": "Cookbook {0}"
"cookbook-with-name": "Cookbook {0}",
"create-a-cookbook": "Create a Cookbook",
"cookbook": "Cookbook"
}
}

View File

@ -53,7 +53,7 @@
"apprise-url": "Apprise URL",
"database": "Database",
"delete-event": "Gebeurtenis verwijderen",
"event-delete-confirmation": "Weet je zeker dat je deze gebeurtenis wil verwijderen?",
"event-delete-confirmation": "Weet je zeker dat je deze gebeurtenis wilt verwijderen?",
"event-deleted": "Gebeurtenis verwijderd",
"event-updated": "Gebeurtenis bijgewerkt",
"new-notification-form-description": "Mealie gebruikt de notificatieservices van Apprise om notificaties te genereren. Apprise biedt diverse services aan om notificaties te versturen. Raadpleeg hun wiki voor een uitgebreide handleiding over het creëren van een link voor je service. Afhankelijk van de gekozen service zijn er mogelijk extra functionaliteiten beschikbaar.",
@ -84,7 +84,7 @@
"clear": "Wissen",
"close": "Sluiten",
"confirm": "Bevestigen",
"confirm-delete-generic": "Weet je zeker dat je dit wil verwijderen?",
"confirm-delete-generic": "Weet je zeker dat je dit wilt verwijderen?",
"copied_message": "Gekopieerd!",
"create": "Aanmaken",
"created": "Aangemaakt op",
@ -199,7 +199,8 @@
"upload-file": "Bestand uploaden",
"created-on-date": "Gemaakt op {0}",
"unsaved-changes": "Er zijn niet-opgeslagen wijzigingen. Wil je eerst opslaan voordat je vertrekt? Okay om op te slaan, Annuleren om wijzigingen ongedaan te maken.",
"clipboard-copy-failure": "Kopiëren naar klembord mislukt."
"clipboard-copy-failure": "Kopiëren naar klembord mislukt.",
"confirm-delete-generic-items": "Are you sure you want to delete the following items?"
},
"group": {
"are-you-sure-you-want-to-delete-the-group": "Weet je zeker dat je <b>{groupName}<b/> wil verwijderen?",
@ -559,7 +560,7 @@
"recipe-yield": "Recept Opbrengst",
"unit": "Eenheid",
"upload-image": "Afbeelding uploaden",
"screen-awake": "Scherm laten aan staan",
"screen-awake": "Scherm aan laten staan",
"remove-image": "Afbeelding verwijderen",
"nextStep": "Volgende stap"
},
@ -736,7 +737,7 @@
"shopping-lists": "Boodschappenlijsten",
"food": "Voedsel",
"note": "Notitie",
"label": "Etiket",
"label": "Label",
"linked-item-warning": "Dit element is gekoppeld aan een of meer recepten. Het aanpassen van de eenheden of ingrediënten zal onverwachte resultaten opleveren bij het toevoegen of verwijderen van het recept uit deze lijst.",
"toggle-food": "Voedsel schakelen",
"manage-labels": "Labels beheren",
@ -746,10 +747,10 @@
"delete-checked": "Selectie verwijderen",
"toggle-label-sort": "Label sortering in-/uitschakelen",
"reorder-labels": "Labels opnieuw indelen",
"uncheck-all-items": "Deselecteer alle Items",
"check-all-items": "Alle producten controleren",
"uncheck-all-items": "Deselecteer alle items",
"check-all-items": "Selecteer alle items",
"linked-recipes-count": "Geen Gelinkte Recepten Eén Gekoppeld Recept{count} Gekoppelde Recepten",
"items-checked-count": "Geen items aangevinkt, Eén item gecontroleerd{count} items gecontroleerd",
"items-checked-count": "Geen items geselecteerd|Eén item geselecteerd|{count} items geselecteerd",
"no-label": "Geen label",
"completed-on": "Afgemaakt op {date}"
},
@ -1185,6 +1186,8 @@
"require-all-tags": "Vereis alle tags",
"require-all-tools": "Vereis al het kookgerei",
"cookbook-name": "Naam van het kookboek",
"cookbook-with-name": "Kookboek {0}"
"cookbook-with-name": "Kookboek {0}",
"create-a-cookbook": "Maak een kookboek",
"cookbook": "Kookboek"
}
}

View File

@ -199,7 +199,8 @@
"upload-file": "Last opp fil",
"created-on-date": "Opprettet: {0}",
"unsaved-changes": "Du har ulagrede endringer. Ønsker du å lagre før du forlater? Trykk 'OK' for å lagre, 'Avbryt' for å forkaste endringene.",
"clipboard-copy-failure": "Kunne ikke kopiere til utklippstavlen."
"clipboard-copy-failure": "Kunne ikke kopiere til utklippstavlen.",
"confirm-delete-generic-items": "Are you sure you want to delete the following items?"
},
"group": {
"are-you-sure-you-want-to-delete-the-group": "Er du sikker på at du vil slette <b>{groupName}<b/>?",
@ -1185,6 +1186,8 @@
"require-all-tags": "Krev alle emneord",
"require-all-tools": "Krev alle kjøkkenredskaper",
"cookbook-name": "Navn på kokebok",
"cookbook-with-name": "Kokebok {0}"
"cookbook-with-name": "Kokebok {0}",
"create-a-cookbook": "Create a Cookbook",
"cookbook": "Cookbook"
}
}

View File

@ -117,7 +117,7 @@
"loading": "Ładowanie",
"loading-events": "Ładowanie wydarzeń",
"loading-recipe": "Ładowanie przepisów...",
"loading-ocr-data": "Loading OCR data...",
"loading-ocr-data": "Wczytywanie danych OCR...",
"loading-recipes": "Ładowanie przepisów",
"message": "Wiadomość",
"monday": "Poniedziałek",
@ -198,8 +198,9 @@
"refresh": "Odśwież",
"upload-file": "Prześlij plik",
"created-on-date": "Utworzono dnia: {0}",
"unsaved-changes": "You have unsaved changes. Do you want to save before leaving? Okay to save, Cancel to discard changes.",
"clipboard-copy-failure": "Failed to copy to the clipboard."
"unsaved-changes": "Masz niezapisane zmiany. Czy chcesz zapisać przed wyjściem? Ok, aby zapisać, Anuluj, żeby odrzucić zmiany.",
"clipboard-copy-failure": "Failed to copy to the clipboard.",
"confirm-delete-generic-items": "Are you sure you want to delete the following items?"
},
"group": {
"are-you-sure-you-want-to-delete-the-group": "Czy na pewno chcesz usunąć <b>{groupName}<b/>?",
@ -258,7 +259,7 @@
},
"meal-plan": {
"create-a-new-meal-plan": "Utwórz nowy plan posiłku",
"update-this-meal-plan": "Update this Meal Plan",
"update-this-meal-plan": "Zaktualizuj plan posiłku",
"dinner-this-week": "Obiad w tym tygodniu",
"dinner-today": "Obiad dziś",
"dinner-tonight": "OBIAD DZIŚ",
@ -473,7 +474,7 @@
"add-to-timeline": "Dodaj do osi czasu",
"recipe-added-to-list": "Przepis dodany do listy",
"recipes-added-to-list": "Przepisy dodane do listy",
"successfully-added-to-list": "Successfully added to list",
"successfully-added-to-list": "Pomyślnie dodano do listy",
"recipe-added-to-mealplan": "Przepis dodany do planu posiłków",
"failed-to-add-recipes-to-list": "Nie udało się dodać przepisu do listy",
"failed-to-add-recipe-to-mealplan": "Nie udało się dodać przepisu do planu posiłków",
@ -806,7 +807,7 @@
"create-new-tool": "Utwórz nowe narzędzie",
"on-hand-checkbox-label": "Pokaż jako Posiadane (Zaznaczono)",
"required-tools": "Wymagane Narzędzia",
"tool": "Tool"
"tool": "Narzędzie"
},
"user": {
"admin": "Administrator",
@ -944,7 +945,7 @@
"fraction": "Ułamki",
"example-unit-singular": "np. Łyżka stołowa",
"example-unit-plural": "np. Łyżki stołowe",
"example-unit-abbreviation-singular": "ex: Tbsp",
"example-unit-abbreviation-singular": "na przykład: Łyżka stołowa",
"example-unit-abbreviation-plural": "ex: Tbsps"
},
"labels": {
@ -1185,6 +1186,8 @@
"require-all-tags": "Wymagaj wszystkich tagów",
"require-all-tools": "Wymagaj wszystkich narzędzi",
"cookbook-name": "Nazwa książki kucharskiej",
"cookbook-with-name": "Książka kucharska {0}"
"cookbook-with-name": "Książka kucharska {0}",
"create-a-cookbook": "Utwórz nową książkę kucharską",
"cookbook": "Książka kucharska"
}
}

View File

@ -199,7 +199,8 @@
"upload-file": "Enviar arquivo",
"created-on-date": "Criado em {0}",
"unsaved-changes": "Você possui alterações não salvas. Deseja salvar antes de sair? Ok para salvar, Cancelar para descartar alterações.",
"clipboard-copy-failure": "Failed to copy to the clipboard."
"clipboard-copy-failure": "Failed to copy to the clipboard.",
"confirm-delete-generic-items": "Are you sure you want to delete the following items?"
},
"group": {
"are-you-sure-you-want-to-delete-the-group": "Tem certeza que deseja excluir o grupo <b>{groupName}<b/>?",
@ -1185,6 +1186,8 @@
"require-all-tags": "Exigir todos os marcadores",
"require-all-tools": "Exigir todas as ferramentas",
"cookbook-name": "Nome do Livro de Receitas",
"cookbook-with-name": "Livro de Receitas {0}"
"cookbook-with-name": "Livro de Receitas {0}",
"create-a-cookbook": "Create a Cookbook",
"cookbook": "Cookbook"
}
}

View File

@ -199,7 +199,8 @@
"upload-file": "Carregar ficheiro",
"created-on-date": "Criado em: {0}",
"unsaved-changes": "Tem alterações por gravar. Quer gravar antes de sair? OK para gravar, Cancelar para descartar alterações.",
"clipboard-copy-failure": "Erro ao copiar para a área de transferência."
"clipboard-copy-failure": "Erro ao copiar para a área de transferência.",
"confirm-delete-generic-items": "Tem a certeza de que deseja eliminar os seguintes itens?"
},
"group": {
"are-you-sure-you-want-to-delete-the-group": "Tem a certeza que quer eliminar <b>{groupName}</b>?",
@ -1185,6 +1186,8 @@
"require-all-tags": "Requer todas as etiquetas",
"require-all-tools": "Requer todas os utensílios",
"cookbook-name": "Nome do Livro de Receitas",
"cookbook-with-name": "Livro de Receitas {0}"
"cookbook-with-name": "Livro de Receitas {0}",
"create-a-cookbook": "Criar um Livro de Receitas",
"cookbook": "Livro de Receitas"
}
}

View File

@ -199,7 +199,8 @@
"upload-file": "Încărcă fișier",
"created-on-date": "Creat pe {0}",
"unsaved-changes": "Aveți modificări nesalvate. Doriți să salvați înainte de a închide aplicația? Apăsați \"OK\" pentru a salva sau \"Anulare\" pentru a renunța la modificări.",
"clipboard-copy-failure": "Copierea în clipboard a eșuat."
"clipboard-copy-failure": "Copierea în clipboard a eșuat.",
"confirm-delete-generic-items": "Are you sure you want to delete the following items?"
},
"group": {
"are-you-sure-you-want-to-delete-the-group": "Sunteți sigur că doriți să ștergeți <b>{groupName}<b/>?",
@ -1185,6 +1186,8 @@
"require-all-tags": "Require All Tags",
"require-all-tools": "Require All Tools",
"cookbook-name": "Cookbook Name",
"cookbook-with-name": "Cookbook {0}"
"cookbook-with-name": "Cookbook {0}",
"create-a-cookbook": "Create a Cookbook",
"cookbook": "Cookbook"
}
}

View File

@ -199,7 +199,8 @@
"upload-file": "Загрузить файл",
"created-on-date": "Создано: {0}",
"unsaved-changes": "У вас есть несохраненные изменения. Вы хотите сохранить их перед выходом?",
"clipboard-copy-failure": "Не удалось скопировать текст."
"clipboard-copy-failure": "Не удалось скопировать текст.",
"confirm-delete-generic-items": "Вы уверены, что хотите удалить следующие элементы?"
},
"group": {
"are-you-sure-you-want-to-delete-the-group": "Вы действительно хотите удалить <b>{groupName}<b/>?",
@ -1185,6 +1186,8 @@
"require-all-tags": "Требовать все теги",
"require-all-tools": "Требовать все инструменты",
"cookbook-name": "Название книги рецептов",
"cookbook-with-name": "Книга рецептов {0}"
"cookbook-with-name": "Книга рецептов {0}",
"create-a-cookbook": "Создать книгу рецептов",
"cookbook": "Книга рецептов"
}
}

View File

@ -199,7 +199,8 @@
"upload-file": "Nahrať súbor",
"created-on-date": "Vytvorené: {0}",
"unsaved-changes": "You have unsaved changes. Do you want to save before leaving? Okay to save, Cancel to discard changes.",
"clipboard-copy-failure": "Failed to copy to the clipboard."
"clipboard-copy-failure": "Failed to copy to the clipboard.",
"confirm-delete-generic-items": "Are you sure you want to delete the following items?"
},
"group": {
"are-you-sure-you-want-to-delete-the-group": "Naozaj chcete odstrániť <b>{groupName}<b/>?",
@ -1185,6 +1186,8 @@
"require-all-tags": "Vyžadovať všetky štítky",
"require-all-tools": "Vyžadovať všetky nástroje",
"cookbook-name": "Názov kuchárky",
"cookbook-with-name": "Kuchárka {0}"
"cookbook-with-name": "Kuchárka {0}",
"create-a-cookbook": "Create a Cookbook",
"cookbook": "Cookbook"
}
}

View File

@ -199,7 +199,8 @@
"upload-file": "Naloži datoteko",
"created-on-date": "Created on: {0}",
"unsaved-changes": "You have unsaved changes. Do you want to save before leaving? Okay to save, Cancel to discard changes.",
"clipboard-copy-failure": "Failed to copy to the clipboard."
"clipboard-copy-failure": "Failed to copy to the clipboard.",
"confirm-delete-generic-items": "Are you sure you want to delete the following items?"
},
"group": {
"are-you-sure-you-want-to-delete-the-group": "Ste prepričani, da želite izbrisati <b>{groupName}<b/>?",
@ -1185,6 +1186,8 @@
"require-all-tags": "Require All Tags",
"require-all-tools": "Require All Tools",
"cookbook-name": "Cookbook Name",
"cookbook-with-name": "Cookbook {0}"
"cookbook-with-name": "Cookbook {0}",
"create-a-cookbook": "Create a Cookbook",
"cookbook": "Cookbook"
}
}

View File

@ -199,7 +199,8 @@
"upload-file": "Учитај датотеку",
"created-on-date": "Крерирано: {0}",
"unsaved-changes": "You have unsaved changes. Do you want to save before leaving? Okay to save, Cancel to discard changes.",
"clipboard-copy-failure": "Failed to copy to the clipboard."
"clipboard-copy-failure": "Failed to copy to the clipboard.",
"confirm-delete-generic-items": "Are you sure you want to delete the following items?"
},
"group": {
"are-you-sure-you-want-to-delete-the-group": "Да ли сте сигурни да желите да обришете <b>{groupName}<b/>?",
@ -1185,6 +1186,8 @@
"require-all-tags": "Захтевај све ознаке",
"require-all-tools": "Захтева сав прибор",
"cookbook-name": "Cookbook Name",
"cookbook-with-name": "Кувар {0}"
"cookbook-with-name": "Кувар {0}",
"create-a-cookbook": "Create a Cookbook",
"cookbook": "Cookbook"
}
}

View File

@ -199,7 +199,8 @@
"upload-file": "Ladda upp fil",
"created-on-date": "Skapad {0}",
"unsaved-changes": "Du har osparade ändringar. Vill du spara innan du lämnar? Tryck Okej att spara, Avbryt för att ignorera ändringar.",
"clipboard-copy-failure": "Det gick inte att kopiera till urklipp."
"clipboard-copy-failure": "Det gick inte att kopiera till urklipp.",
"confirm-delete-generic-items": "Är du säker på att du vill radera följande objekt?"
},
"group": {
"are-you-sure-you-want-to-delete-the-group": "Är du säker på att du vill radera <b>{groupName}<b/>?",
@ -1185,6 +1186,8 @@
"require-all-tags": "Kräv alla taggar",
"require-all-tools": "Kräv alla verktyg",
"cookbook-name": "Namn på kokbok",
"cookbook-with-name": "Kokbok {0}"
"cookbook-with-name": "Kokbok {0}",
"create-a-cookbook": "Create a Cookbook",
"cookbook": "Cookbook"
}
}

View File

@ -199,7 +199,8 @@
"upload-file": "Dosya Yükle",
"created-on-date": "{0} tarihinde oluşturuldu",
"unsaved-changes": "Kaydedilmemiş değişiklikleriniz mevcut. Ayrılmadan önce kaydetmek ister misiniz? Kaydetmek için Tamam'ı, değişiklikleri iptal etmek için İptal'i seçin.",
"clipboard-copy-failure": "Panoya kopyalanamadı."
"clipboard-copy-failure": "Panoya kopyalanamadı.",
"confirm-delete-generic-items": "Aşağıdaki öğeleri silmek istediğinizden emin misiniz?"
},
"group": {
"are-you-sure-you-want-to-delete-the-group": "<b>{groupName}<b/>'i silmek istediğine emin misin?",
@ -1185,6 +1186,8 @@
"require-all-tags": "Require All Tags",
"require-all-tools": "Require All Tools",
"cookbook-name": "Cookbook Name",
"cookbook-with-name": "Cookbook {0}"
"cookbook-with-name": "Cookbook {0}",
"create-a-cookbook": "Yemek Kitabı Oluştur",
"cookbook": "Yemek kitabı"
}
}

View File

@ -199,7 +199,8 @@
"upload-file": "Вивантажити файл",
"created-on-date": "Створено: {0}",
"unsaved-changes": "У вас є незбережені зміни. Ви хочете зберегти їх перед виходом? Гаразд, щоб зберегти, Скасувати, щоб скасувати.",
"clipboard-copy-failure": "Не вдалося скопіювати до буфера обміну."
"clipboard-copy-failure": "Не вдалося скопіювати до буфера обміну.",
"confirm-delete-generic-items": "Ви впевнені, що хочете видалити вибрані елементи?"
},
"group": {
"are-you-sure-you-want-to-delete-the-group": "Ви дійсно бажаєте видалити <b>{groupName}<b/>?",
@ -1185,6 +1186,8 @@
"require-all-tags": "Вимагати всі мітки",
"require-all-tools": "Вимагати всі інструменти",
"cookbook-name": "Назва кулінарної книги",
"cookbook-with-name": "Кулінарна книга {0}"
"cookbook-with-name": "Кулінарна книга {0}",
"create-a-cookbook": "Створити кулінарну книгу",
"cookbook": "Кулінарна книга"
}
}

View File

@ -199,7 +199,8 @@
"upload-file": "Upload File",
"created-on-date": "Created on: {0}",
"unsaved-changes": "You have unsaved changes. Do you want to save before leaving? Okay to save, Cancel to discard changes.",
"clipboard-copy-failure": "Failed to copy to the clipboard."
"clipboard-copy-failure": "Failed to copy to the clipboard.",
"confirm-delete-generic-items": "Are you sure you want to delete the following items?"
},
"group": {
"are-you-sure-you-want-to-delete-the-group": "Are you sure you want to delete <b>{groupName}<b/>?",
@ -1185,6 +1186,8 @@
"require-all-tags": "Require All Tags",
"require-all-tools": "Require All Tools",
"cookbook-name": "Cookbook Name",
"cookbook-with-name": "Cookbook {0}"
"cookbook-with-name": "Cookbook {0}",
"create-a-cookbook": "Create a Cookbook",
"cookbook": "Cookbook"
}
}

View File

@ -199,7 +199,8 @@
"upload-file": "上传文件",
"created-on-date": "创建于: {0}",
"unsaved-changes": "你有未保存的更改。你希望现在离开前保存吗?保存选择“是”,不保存选择“取消”。",
"clipboard-copy-failure": "未能复制到剪切板。"
"clipboard-copy-failure": "未能复制到剪切板。",
"confirm-delete-generic-items": "Are you sure you want to delete the following items?"
},
"group": {
"are-you-sure-you-want-to-delete-the-group": "您确定要删除<b>{groupName}<b/>吗?",
@ -1185,6 +1186,8 @@
"require-all-tags": "包含全部标签",
"require-all-tools": "包含全部工具",
"cookbook-name": "食谱名称",
"cookbook-with-name": "{0}合集"
"cookbook-with-name": "{0}合集",
"create-a-cookbook": "Create a Cookbook",
"cookbook": "Cookbook"
}
}

View File

@ -199,7 +199,8 @@
"upload-file": "上傳文件",
"created-on-date": "Created on: {0}",
"unsaved-changes": "You have unsaved changes. Do you want to save before leaving? Okay to save, Cancel to discard changes.",
"clipboard-copy-failure": "Failed to copy to the clipboard."
"clipboard-copy-failure": "Failed to copy to the clipboard.",
"confirm-delete-generic-items": "Are you sure you want to delete the following items?"
},
"group": {
"are-you-sure-you-want-to-delete-the-group": "確定要刪除<b>{groupName}<b/>",
@ -1185,6 +1186,8 @@
"require-all-tags": "Require All Tags",
"require-all-tools": "Require All Tools",
"cookbook-name": "食譜名",
"cookbook-with-name": "食譜 {0}"
"cookbook-with-name": "食譜 {0}",
"create-a-cookbook": "Create a Cookbook",
"cookbook": "Cookbook"
}
}

View File

@ -12,7 +12,7 @@
"user-updated": "Gebruiker bijgewerkt",
"password-updated": "Wachtwoord bijgewerkt",
"invalid-current-password": "Ongeldig huidig wachtwoord",
"ldap-update-password-unavailable": "Kan het wachtwoord niet bijwerken. De gebruiker wordt beheerd door LDAP."
"ldap-update-password-unavailable": "Kan het wachtwoord niet bijwerken, de gebruiker wordt beheerd door LDAP"
},
"group": {
"report-deleted": "Rapport verwijderd."
@ -20,7 +20,7 @@
"exceptions": {
"permission_denied": "Je hebt geen toestemming om deze actie uit te voeren",
"no-entry-found": "Het opgevraagde is niet gevonden",
"integrity-error": "Integriteitsprobleem voor database",
"integrity-error": "Database integriteitsfout",
"username-conflict-error": "Deze gebruikersnaam is al in gebruik",
"email-conflict-error": "Dit e-mailadres is al in gebruik"
},

View File

@ -132,7 +132,7 @@ def parse_ingredient(tokens) -> tuple[str, str]:
return ingredient, note
def parse(ing_str) -> BruteParsedIngredient:
def parse(ing_str, parser) -> BruteParsedIngredient:
amount = 0.0
unit = ""
ingredient = ""
@ -192,12 +192,20 @@ def parse(ing_str) -> BruteParsedIngredient:
# which means this is the ingredient
ingredient = tokens[1]
except ValueError:
try:
# can't parse first argument as amount
# -> no unit -> parse everything as ingredient
ingredient, note = parse_ingredient(tokens)
except ValueError:
ingredient = " ".join(tokens[1:])
# can't parse first argument as amount
# try to parse as unit and ingredient (e.g. "a tblsp salt"), with unit in first three tokens
# won't work for units that have spaces
for index, token in enumerate(tokens[:3]):
if parser.find_unit_match(token):
unit = token
ingredient, note = parse_ingredient(tokens[index + 1 :])
break
if not unit:
try:
# no unit -> parse everything as ingredient
ingredient, note = parse_ingredient(tokens)
except ValueError:
ingredient = " ".join(tokens[1:])
if unit_note not in note:
note += " " + unit_note

View File

@ -126,22 +126,24 @@ class ABCIngredientParser(ABC):
return store_map[fuzz_result[0]]
def find_food_match(self, food: IngredientFood | CreateIngredientFood) -> IngredientFood | None:
def find_food_match(self, food: IngredientFood | CreateIngredientFood | str) -> IngredientFood | None:
if isinstance(food, IngredientFood):
return food
match_value = IngredientFoodModel.normalize(food.name)
food_name = food if isinstance(food, str) else food.name
match_value = IngredientFoodModel.normalize(food_name)
return self.find_match(
match_value,
store_map=self.foods_by_alias,
fuzzy_match_threshold=self.food_fuzzy_match_threshold,
)
def find_unit_match(self, unit: IngredientUnit | CreateIngredientUnit) -> IngredientUnit | None:
def find_unit_match(self, unit: IngredientUnit | CreateIngredientUnit | str) -> IngredientUnit | None:
if isinstance(unit, IngredientUnit):
return unit
match_value = IngredientUnitModel.normalize(unit.name)
unit_name = unit if isinstance(unit, str) else unit.name
match_value = IngredientUnitModel.normalize(unit_name)
return self.find_match(
match_value,
store_map=self.units_by_alias,
@ -155,6 +157,16 @@ class ABCIngredientParser(ABC):
if ingredient.ingredient.unit and (unit_match := self.find_unit_match(ingredient.ingredient.unit)):
ingredient.ingredient.unit = unit_match
# Parser might have wrongly split a food into a unit and food.
if isinstance(ingredient.ingredient.food, CreateIngredientFood) and isinstance(
ingredient.ingredient.unit, CreateIngredientUnit
):
if food_match := self.find_food_match(
f"{ingredient.ingredient.unit.name} {ingredient.ingredient.food.name}"
):
ingredient.ingredient.food = food_match
ingredient.ingredient.unit = None
return ingredient
@ -164,7 +176,7 @@ class BruteForceParser(ABCIngredientParser):
"""
def parse_one(self, ingredient: str) -> ParsedIngredient:
bfi = brute.parse(ingredient)
bfi = brute.parse(ingredient, self)
parsed_ingredient = ParsedIngredient(
input=ingredient,

162
poetry.lock generated
View File

@ -536,18 +536,18 @@ cli = ["requests"]
[[package]]
name = "fastapi"
version = "0.109.1"
version = "0.109.2"
description = "FastAPI framework, high performance, easy to learn, fast to code, ready for production"
optional = false
python-versions = ">=3.8"
files = [
{file = "fastapi-0.109.1-py3-none-any.whl", hash = "sha256:510042044906b17b6d9149135d90886ade170bf615efcfb5533f568ae6d88534"},
{file = "fastapi-0.109.1.tar.gz", hash = "sha256:5402389843a3561918634eb327e86b9ae98645a9e7696bede9074449c48d610a"},
{file = "fastapi-0.109.2-py3-none-any.whl", hash = "sha256:2c9bab24667293b501cad8dd388c05240c850b58ec5876ee3283c47d6e1e3a4d"},
{file = "fastapi-0.109.2.tar.gz", hash = "sha256:f3817eac96fe4f65a2ebb4baa000f394e55f5fccdaf7f75250804bc58f354f73"},
]
[package.dependencies]
pydantic = ">=1.7.4,<1.8 || >1.8,<1.8.1 || >1.8.1,<2.0.0 || >2.0.0,<2.0.1 || >2.0.1,<2.1.0 || >2.1.0,<3.0.0"
starlette = ">=0.35.0,<0.36.0"
starlette = ">=0.36.3,<0.37.0"
typing-extensions = ">=4.8.0"
[package.extras]
@ -1220,13 +1220,13 @@ min-versions = ["babel (==2.9.0)", "click (==7.0)", "colorama (==0.4)", "ghp-imp
[[package]]
name = "mkdocs-material"
version = "9.5.7"
version = "9.5.8"
description = "Documentation that simply works"
optional = false
python-versions = ">=3.8"
files = [
{file = "mkdocs_material-9.5.7-py3-none-any.whl", hash = "sha256:0be8ce8bcfebb52bae9b00cf9b851df45b8a92d629afcfd7f2c09b2dfa155ea3"},
{file = "mkdocs_material-9.5.7.tar.gz", hash = "sha256:16110292575d88a338d2961f3cb665cf12943ff8829e551a9b364f24019e46af"},
{file = "mkdocs_material-9.5.8-py3-none-any.whl", hash = "sha256:14563314bbf97da4bfafc69053772341babfaeb3329cde01d3e63cec03997af8"},
{file = "mkdocs_material-9.5.8.tar.gz", hash = "sha256:2a429213e83f84eda7a588e2b186316d806aac602b7f93990042f7a1f3d3cf65"},
]
[package.dependencies]
@ -1243,7 +1243,7 @@ regex = ">=2022.4"
requests = ">=2.26,<3.0"
[package.extras]
git = ["mkdocs-git-committers-plugin-2 (>=1.1,<2.0)", "mkdocs-git-revision-date-localized-plugin (>=1.2,<2.0)"]
git = ["mkdocs-git-committers-plugin-2 (>=1.1,<2.0)", "mkdocs-git-revision-date-localized-plugin (>=1.2.4,<2.0)"]
imaging = ["cairosvg (>=2.6,<3.0)", "pillow (>=10.2,<11.0)"]
recommended = ["mkdocs-minify-plugin (>=0.7,<1.0)", "mkdocs-redirects (>=1.2,<2.0)", "mkdocs-rss-plugin (>=1.6,<2.0)"]
@ -1348,61 +1348,61 @@ signedtoken = ["cryptography (>=3.0.0)", "pyjwt (>=2.0.0,<3)"]
[[package]]
name = "orjson"
version = "3.9.12"
version = "3.9.13"
description = "Fast, correct Python JSON library supporting dataclasses, datetimes, and numpy"
optional = false
python-versions = ">=3.8"
files = [
{file = "orjson-3.9.12-cp310-cp310-macosx_10_15_x86_64.macosx_11_0_arm64.macosx_10_15_universal2.whl", hash = "sha256:6b4e2bed7d00753c438e83b613923afdd067564ff7ed696bfe3a7b073a236e07"},
{file = "orjson-3.9.12-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:bd1b8ec63f0bf54a50b498eedeccdca23bd7b658f81c524d18e410c203189365"},
{file = "orjson-3.9.12-cp310-cp310-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:ab8add018a53665042a5ae68200f1ad14c7953fa12110d12d41166f111724656"},
{file = "orjson-3.9.12-cp310-cp310-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:12756a108875526b76e505afe6d6ba34960ac6b8c5ec2f35faf73ef161e97e07"},
{file = "orjson-3.9.12-cp310-cp310-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:890e7519c0c70296253660455f77e3a194554a3c45e42aa193cdebc76a02d82b"},
{file = "orjson-3.9.12-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:d664880d7f016efbae97c725b243b33c2cbb4851ddc77f683fd1eec4a7894146"},
{file = "orjson-3.9.12-cp310-cp310-musllinux_1_1_aarch64.whl", hash = "sha256:cfdaede0fa5b500314ec7b1249c7e30e871504a57004acd116be6acdda3b8ab3"},
{file = "orjson-3.9.12-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:6492ff5953011e1ba9ed1bf086835fd574bd0a3cbe252db8e15ed72a30479081"},
{file = "orjson-3.9.12-cp310-none-win32.whl", hash = "sha256:29bf08e2eadb2c480fdc2e2daae58f2f013dff5d3b506edd1e02963b9ce9f8a9"},
{file = "orjson-3.9.12-cp310-none-win_amd64.whl", hash = "sha256:0fc156fba60d6b50743337ba09f052d8afc8b64595112996d22f5fce01ab57da"},
{file = "orjson-3.9.12-cp311-cp311-macosx_10_15_x86_64.macosx_11_0_arm64.macosx_10_15_universal2.whl", hash = "sha256:2849f88a0a12b8d94579b67486cbd8f3a49e36a4cb3d3f0ab352c596078c730c"},
{file = "orjson-3.9.12-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:3186b18754befa660b31c649a108a915493ea69b4fc33f624ed854ad3563ac65"},
{file = "orjson-3.9.12-cp311-cp311-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:cbbf313c9fb9d4f6cf9c22ced4b6682230457741daeb3d7060c5d06c2e73884a"},
{file = "orjson-3.9.12-cp311-cp311-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:99e8cd005b3926c3db9b63d264bd05e1bf4451787cc79a048f27f5190a9a0311"},
{file = "orjson-3.9.12-cp311-cp311-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:59feb148392d9155f3bfed0a2a3209268e000c2c3c834fb8fe1a6af9392efcbf"},
{file = "orjson-3.9.12-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:a4ae815a172a1f073b05b9e04273e3b23e608a0858c4e76f606d2d75fcabde0c"},
{file = "orjson-3.9.12-cp311-cp311-musllinux_1_1_aarch64.whl", hash = "sha256:ed398f9a9d5a1bf55b6e362ffc80ac846af2122d14a8243a1e6510a4eabcb71e"},
{file = "orjson-3.9.12-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:d3cfb76600c5a1e6be91326b8f3b83035a370e727854a96d801c1ea08b708073"},
{file = "orjson-3.9.12-cp311-none-win32.whl", hash = "sha256:a2b6f5252c92bcab3b742ddb3ac195c0fa74bed4319acd74f5d54d79ef4715dc"},
{file = "orjson-3.9.12-cp311-none-win_amd64.whl", hash = "sha256:c95488e4aa1d078ff5776b58f66bd29d628fa59adcb2047f4efd3ecb2bd41a71"},
{file = "orjson-3.9.12-cp312-cp312-macosx_10_15_x86_64.macosx_11_0_arm64.macosx_10_15_universal2.whl", hash = "sha256:d6ce2062c4af43b92b0221ed4f445632c6bf4213f8a7da5396a122931377acd9"},
{file = "orjson-3.9.12-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:950951799967558c214cd6cceb7ceceed6f81d2c3c4135ee4a2c9c69f58aa225"},
{file = "orjson-3.9.12-cp312-cp312-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:2dfaf71499d6fd4153f5c86eebb68e3ec1bf95851b030a4b55c7637a37bbdee4"},
{file = "orjson-3.9.12-cp312-cp312-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:659a8d7279e46c97661839035a1a218b61957316bf0202674e944ac5cfe7ed83"},
{file = "orjson-3.9.12-cp312-cp312-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:af17fa87bccad0b7f6fd8ac8f9cbc9ee656b4552783b10b97a071337616db3e4"},
{file = "orjson-3.9.12-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:cd52dec9eddf4c8c74392f3fd52fa137b5f2e2bed1d9ae958d879de5f7d7cded"},
{file = "orjson-3.9.12-cp312-cp312-musllinux_1_1_aarch64.whl", hash = "sha256:640e2b5d8e36b970202cfd0799d11a9a4ab46cf9212332cd642101ec952df7c8"},
{file = "orjson-3.9.12-cp312-cp312-musllinux_1_1_x86_64.whl", hash = "sha256:daa438bd8024e03bcea2c5a92cd719a663a58e223fba967296b6ab9992259dbf"},
{file = "orjson-3.9.12-cp312-none-win_amd64.whl", hash = "sha256:1bb8f657c39ecdb924d02e809f992c9aafeb1ad70127d53fb573a6a6ab59d549"},
{file = "orjson-3.9.12-cp38-cp38-macosx_10_15_x86_64.macosx_11_0_arm64.macosx_10_15_universal2.whl", hash = "sha256:f4098c7674901402c86ba6045a551a2ee345f9f7ed54eeffc7d86d155c8427e5"},
{file = "orjson-3.9.12-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:5586a533998267458fad3a457d6f3cdbddbcce696c916599fa8e2a10a89b24d3"},
{file = "orjson-3.9.12-cp38-cp38-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:54071b7398cd3f90e4bb61df46705ee96cb5e33e53fc0b2f47dbd9b000e238e1"},
{file = "orjson-3.9.12-cp38-cp38-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:67426651faa671b40443ea6f03065f9c8e22272b62fa23238b3efdacd301df31"},
{file = "orjson-3.9.12-cp38-cp38-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:4a0cd56e8ee56b203abae7d482ac0d233dbfb436bb2e2d5cbcb539fe1200a312"},
{file = "orjson-3.9.12-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:a84a0c3d4841a42e2571b1c1ead20a83e2792644c5827a606c50fc8af7ca4bee"},
{file = "orjson-3.9.12-cp38-cp38-musllinux_1_1_aarch64.whl", hash = "sha256:09d60450cda3fa6c8ed17770c3a88473a16460cd0ff2ba74ef0df663b6fd3bb8"},
{file = "orjson-3.9.12-cp38-cp38-musllinux_1_1_x86_64.whl", hash = "sha256:bc82a4db9934a78ade211cf2e07161e4f068a461c1796465d10069cb50b32a80"},
{file = "orjson-3.9.12-cp38-none-win32.whl", hash = "sha256:61563d5d3b0019804d782137a4f32c72dc44c84e7d078b89d2d2a1adbaa47b52"},
{file = "orjson-3.9.12-cp38-none-win_amd64.whl", hash = "sha256:410f24309fbbaa2fab776e3212a81b96a1ec6037259359a32ea79fbccfcf76aa"},
{file = "orjson-3.9.12-cp39-cp39-macosx_10_15_x86_64.macosx_11_0_arm64.macosx_10_15_universal2.whl", hash = "sha256:e773f251258dd82795fd5daeac081d00b97bacf1548e44e71245543374874bcf"},
{file = "orjson-3.9.12-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:b159baecfda51c840a619948c25817d37733a4d9877fea96590ef8606468b362"},
{file = "orjson-3.9.12-cp39-cp39-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:975e72e81a249174840d5a8df977d067b0183ef1560a32998be340f7e195c730"},
{file = "orjson-3.9.12-cp39-cp39-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:06e42e899dde61eb1851a9fad7f1a21b8e4be063438399b63c07839b57668f6c"},
{file = "orjson-3.9.12-cp39-cp39-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:5c157e999e5694475a5515942aebeed6e43f7a1ed52267c1c93dcfde7d78d421"},
{file = "orjson-3.9.12-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:dde1bc7c035f2d03aa49dc8642d9c6c9b1a81f2470e02055e76ed8853cfae0c3"},
{file = "orjson-3.9.12-cp39-cp39-musllinux_1_1_aarch64.whl", hash = "sha256:b0e9d73cdbdad76a53a48f563447e0e1ce34bcecef4614eb4b146383e6e7d8c9"},
{file = "orjson-3.9.12-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:96e44b21fe407b8ed48afbb3721f3c8c8ce17e345fbe232bd4651ace7317782d"},
{file = "orjson-3.9.12-cp39-none-win32.whl", hash = "sha256:cbd0f3555205bf2a60f8812133f2452d498dbefa14423ba90fe89f32276f7abf"},
{file = "orjson-3.9.12-cp39-none-win_amd64.whl", hash = "sha256:03ea7ee7e992532c2f4a06edd7ee1553f0644790553a118e003e3c405add41fa"},
{file = "orjson-3.9.12.tar.gz", hash = "sha256:da908d23a3b3243632b523344403b128722a5f45e278a8343c2bb67538dff0e4"},
{file = "orjson-3.9.13-cp310-cp310-macosx_10_15_x86_64.macosx_11_0_arm64.macosx_10_15_universal2.whl", hash = "sha256:fa6b67f8bef277c2a4aadd548d58796854e7d760964126c3209b19bccc6a74f1"},
{file = "orjson-3.9.13-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:b812417199eeb169c25f67815cfb66fd8de7ff098bf57d065e8c1943a7ba5c8f"},
{file = "orjson-3.9.13-cp310-cp310-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:7ccd5bd222e5041069ad9d9868ab59e6dbc53ecde8d8c82b919954fbba43b46b"},
{file = "orjson-3.9.13-cp310-cp310-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:eaaf80957c38e9d3f796f355a80fad945e72cd745e6b64c210e635b7043b673e"},
{file = "orjson-3.9.13-cp310-cp310-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:60da7316131185d0110a1848e9ad15311e6c8938ee0b5be8cbd7261e1d80ee8f"},
{file = "orjson-3.9.13-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:5b98cd948372f0eb219bc309dee4633db1278687161e3280d9e693b6076951d2"},
{file = "orjson-3.9.13-cp310-cp310-musllinux_1_2_aarch64.whl", hash = "sha256:3869d65561f10071d3e7f35ae58fd377056f67d7aaed5222f318390c3ad30339"},
{file = "orjson-3.9.13-cp310-cp310-musllinux_1_2_x86_64.whl", hash = "sha256:43fd6036b16bb6742d03dae62f7bdf8214d06dea47e4353cde7e2bd1358d186f"},
{file = "orjson-3.9.13-cp310-none-win32.whl", hash = "sha256:0d3ba9d88e20765335260d7b25547d7c571eee2b698200f97afa7d8c7cd668fc"},
{file = "orjson-3.9.13-cp310-none-win_amd64.whl", hash = "sha256:6e47153db080f5e87e8ba638f1a8b18995eede6b0abb93964d58cf11bcea362f"},
{file = "orjson-3.9.13-cp311-cp311-macosx_10_15_x86_64.macosx_11_0_arm64.macosx_10_15_universal2.whl", hash = "sha256:4584e8eb727bc431baaf1bf97e35a1d8a0109c924ec847395673dfd5f4ef6d6f"},
{file = "orjson-3.9.13-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:2f37f0cdd026ef777a4336e599d8194c8357fc14760c2a5ddcfdf1965d45504b"},
{file = "orjson-3.9.13-cp311-cp311-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:d714595d81efab11b42bccd119977d94b25d12d3a806851ff6bfd286a4bce960"},
{file = "orjson-3.9.13-cp311-cp311-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:9171e8e1a1f221953e38e84ae0abffe8759002fd8968106ee379febbb5358b33"},
{file = "orjson-3.9.13-cp311-cp311-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:1ab9dbdec3f13f3ea6f937564ce21651844cfbf2725099f2f490426acf683c23"},
{file = "orjson-3.9.13-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:811ac076855e33e931549340288e0761873baf29276ad00f221709933c644330"},
{file = "orjson-3.9.13-cp311-cp311-musllinux_1_2_aarch64.whl", hash = "sha256:860d0f5b42d0c0afd73fa4177709f6e1b966ba691fcd72175affa902052a81d6"},
{file = "orjson-3.9.13-cp311-cp311-musllinux_1_2_x86_64.whl", hash = "sha256:838b898e8c1f26eb6b8d81b180981273f6f5110c76c22c384979aca854194f1b"},
{file = "orjson-3.9.13-cp311-none-win32.whl", hash = "sha256:d3222db9df629ef3c3673124f2e05fb72bc4a320c117e953fec0d69dde82e36d"},
{file = "orjson-3.9.13-cp311-none-win_amd64.whl", hash = "sha256:978117122ca4cc59b28af5322253017f6c5fc03dbdda78c7f4b94ae984c8dd43"},
{file = "orjson-3.9.13-cp312-cp312-macosx_10_15_x86_64.macosx_11_0_arm64.macosx_10_15_universal2.whl", hash = "sha256:031df1026c7ea8303332d78711f180231e3ae8b564271fb748a03926587c5546"},
{file = "orjson-3.9.13-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:0fd9a2101d04e85086ea6198786a3f016e45475f800712e6833e14bf9ce2832f"},
{file = "orjson-3.9.13-cp312-cp312-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:446d9ad04204e79229ae19502daeea56479e55cbc32634655d886f5a39e91b44"},
{file = "orjson-3.9.13-cp312-cp312-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:b57c0954a9fdd2b05b9cec0f5a12a0bdce5bf021a5b3b09323041613972481ab"},
{file = "orjson-3.9.13-cp312-cp312-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:266e55c83f81248f63cc93d11c5e3a53df49a5d2598fa9e9db5f99837a802d5d"},
{file = "orjson-3.9.13-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:31372ba3a9fe8ad118e7d22fba46bbc18e89039e3bfa89db7bc8c18ee722dca8"},
{file = "orjson-3.9.13-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:e3b0c4da61f39899561e08e571f54472a09fa71717d9797928af558175ae5243"},
{file = "orjson-3.9.13-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:2cc03a35bfc71c8ebf96ce49b82c2a7be6af4b3cd3ac34166fdb42ac510bbfff"},
{file = "orjson-3.9.13-cp312-none-win_amd64.whl", hash = "sha256:49b7e3fe861cb246361825d1a238f2584ed8ea21e714bf6bb17cebb86772e61c"},
{file = "orjson-3.9.13-cp38-cp38-macosx_10_15_x86_64.macosx_11_0_arm64.macosx_10_15_universal2.whl", hash = "sha256:62e9a99879c4d5a04926ac2518a992134bfa00d546ea5a4cae4b9be454d35a22"},
{file = "orjson-3.9.13-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:d92a3e835a5100f1d5b566fff79217eab92223ca31900dba733902a182a35ab0"},
{file = "orjson-3.9.13-cp38-cp38-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:23f21faf072ed3b60b5954686f98157e073f6a8068eaa58dbde83e87212eda84"},
{file = "orjson-3.9.13-cp38-cp38-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:828c502bb261588f7de897e06cb23c4b122997cb039d2014cb78e7dabe92ef0c"},
{file = "orjson-3.9.13-cp38-cp38-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:16946d095212a3dec552572c5d9bca7afa40f3116ad49695a397be07d529f1fa"},
{file = "orjson-3.9.13-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:3deadd8dc0e9ff844b5b656fa30a48dbee1c3b332d8278302dd9637f6b09f627"},
{file = "orjson-3.9.13-cp38-cp38-musllinux_1_2_aarch64.whl", hash = "sha256:9b1b5adc5adf596c59dca57156b71ad301d73956f5bab4039b0e34dbf50b9fa0"},
{file = "orjson-3.9.13-cp38-cp38-musllinux_1_2_x86_64.whl", hash = "sha256:ddc089315d030c54f0f03fb38286e2667c05009a78d659f108a8efcfbdf2e585"},
{file = "orjson-3.9.13-cp38-none-win32.whl", hash = "sha256:ae77275a28667d9c82d4522b681504642055efa0368d73108511647c6499b31c"},
{file = "orjson-3.9.13-cp38-none-win_amd64.whl", hash = "sha256:730385fdb99a21fce9bb84bb7fcbda72c88626facd74956bda712834b480729d"},
{file = "orjson-3.9.13-cp39-cp39-macosx_10_15_x86_64.macosx_11_0_arm64.macosx_10_15_universal2.whl", hash = "sha256:7e8e4a571d958910272af8d53a9cbe6599f9f5fd496a1bc51211183bb2072cbd"},
{file = "orjson-3.9.13-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:cfad553a36548262e7da0f3a7464270e13900b898800fb571a5d4b298c3f8356"},
{file = "orjson-3.9.13-cp39-cp39-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:0d691c44604941945b00e0a13b19a7d9c1a19511abadf0080f373e98fdeb6b31"},
{file = "orjson-3.9.13-cp39-cp39-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:a8c83718346de08d68b3cb1105c5d91e5fc39885d8610fdda16613d4e3941459"},
{file = "orjson-3.9.13-cp39-cp39-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:63ef57a53bfc2091a7cd50a640d9ae866bd7d92a5225a1bab6baa60ef62583f2"},
{file = "orjson-3.9.13-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:9156b96afa38db71344522f5517077eaedf62fcd2c9148392ff93d801128809c"},
{file = "orjson-3.9.13-cp39-cp39-musllinux_1_2_aarch64.whl", hash = "sha256:31fb66b41fb2c4c817d9610f0bc7d31345728d7b5295ac78b63603407432a2b2"},
{file = "orjson-3.9.13-cp39-cp39-musllinux_1_2_x86_64.whl", hash = "sha256:8a730bf07feacb0863974e67b206b7c503a62199de1cece2eb0d4c233ec29c11"},
{file = "orjson-3.9.13-cp39-none-win32.whl", hash = "sha256:5ef58869f3399acbbe013518d8b374ee9558659eef14bca0984f67cb1fbd3c37"},
{file = "orjson-3.9.13-cp39-none-win_amd64.whl", hash = "sha256:9bcf56efdb83244cde070e82a69c0f03c47c235f0a5cb6c81d9da23af7fbaae4"},
{file = "orjson-3.9.13.tar.gz", hash = "sha256:fc6bc65b0cf524ee042e0bc2912b9206ef242edfba7426cf95763e4af01f527a"},
]
[[package]]
@ -2381,28 +2381,28 @@ pyasn1 = ">=0.1.3"
[[package]]
name = "ruff"
version = "0.2.0"
version = "0.2.1"
description = "An extremely fast Python linter and code formatter, written in Rust."
optional = false
python-versions = ">=3.7"
files = [
{file = "ruff-0.2.0-py3-none-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl", hash = "sha256:638ea3294f800d18bae84a492cb5a245c8d29c90d19a91d8e338937a4c27fca0"},
{file = "ruff-0.2.0-py3-none-macosx_10_12_x86_64.whl", hash = "sha256:3ff35433fcf4dff6d610738712152df6b7d92351a1bde8e00bd405b08b3d5759"},
{file = "ruff-0.2.0-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:bf9faafbdcf4f53917019f2c230766da437d4fd5caecd12ddb68bb6a17d74399"},
{file = "ruff-0.2.0-py3-none-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:8153a3e4128ed770871c47545f1ae7b055023e0c222ff72a759f5a341ee06483"},
{file = "ruff-0.2.0-py3-none-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:e8a75a98ae989a27090e9c51f763990ad5bbc92d20626d54e9701c7fe597f399"},
{file = "ruff-0.2.0-py3-none-manylinux_2_17_ppc64.manylinux2014_ppc64.whl", hash = "sha256:87057dd2fdde297130ff99553be8549ca38a2965871462a97394c22ed2dfc19d"},
{file = "ruff-0.2.0-py3-none-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:6d232f99d3ab00094ebaf88e0fb7a8ccacaa54cc7fa3b8993d9627a11e6aed7a"},
{file = "ruff-0.2.0-py3-none-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:3d3c641f95f435fc6754b05591774a17df41648f0daf3de0d75ad3d9f099ab92"},
{file = "ruff-0.2.0-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:3826fb34c144ef1e171b323ed6ae9146ab76d109960addca730756dc19dc7b22"},
{file = "ruff-0.2.0-py3-none-musllinux_1_2_aarch64.whl", hash = "sha256:eceab7d85d09321b4de18b62d38710cf296cb49e98979960a59c6b9307c18cfe"},
{file = "ruff-0.2.0-py3-none-musllinux_1_2_armv7l.whl", hash = "sha256:30ad74687e1f4a9ff8e513b20b82ccadb6bd796fe5697f1e417189c5cde6be3e"},
{file = "ruff-0.2.0-py3-none-musllinux_1_2_i686.whl", hash = "sha256:a7e3818698f8460bd0f8d4322bbe99db8327e9bc2c93c789d3159f5b335f47da"},
{file = "ruff-0.2.0-py3-none-musllinux_1_2_x86_64.whl", hash = "sha256:edf23041242c48b0d8295214783ef543847ef29e8226d9f69bf96592dba82a83"},
{file = "ruff-0.2.0-py3-none-win32.whl", hash = "sha256:e155147199c2714ff52385b760fe242bb99ea64b240a9ffbd6a5918eb1268843"},
{file = "ruff-0.2.0-py3-none-win_amd64.whl", hash = "sha256:ba918e01cdd21e81b07555564f40d307b0caafa9a7a65742e98ff244f5035c59"},
{file = "ruff-0.2.0-py3-none-win_arm64.whl", hash = "sha256:3fbaff1ba9564a2c5943f8f38bc221f04bac687cc7485e45237579fee7ccda79"},
{file = "ruff-0.2.0.tar.gz", hash = "sha256:63856b91837606c673537d2889989733d7dffde553828d3b0f0bacfa6def54be"},
{file = "ruff-0.2.1-py3-none-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl", hash = "sha256:dd81b911d28925e7e8b323e8d06951554655021df8dd4ac3045d7212ac4ba080"},
{file = "ruff-0.2.1-py3-none-macosx_10_12_x86_64.whl", hash = "sha256:dc586724a95b7d980aa17f671e173df00f0a2eef23f8babbeee663229a938fec"},
{file = "ruff-0.2.1-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:c92db7101ef5bfc18e96777ed7bc7c822d545fa5977e90a585accac43d22f18a"},
{file = "ruff-0.2.1-py3-none-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:13471684694d41ae0f1e8e3a7497e14cd57ccb7dd72ae08d56a159d6c9c3e30e"},
{file = "ruff-0.2.1-py3-none-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:a11567e20ea39d1f51aebd778685582d4c56ccb082c1161ffc10f79bebe6df35"},
{file = "ruff-0.2.1-py3-none-manylinux_2_17_ppc64.manylinux2014_ppc64.whl", hash = "sha256:00a818e2db63659570403e44383ab03c529c2b9678ba4ba6c105af7854008105"},
{file = "ruff-0.2.1-py3-none-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:be60592f9d218b52f03384d1325efa9d3b41e4c4d55ea022cd548547cc42cd2b"},
{file = "ruff-0.2.1-py3-none-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:fbd2288890b88e8aab4499e55148805b58ec711053588cc2f0196a44f6e3d855"},
{file = "ruff-0.2.1-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:f3ef052283da7dec1987bba8d8733051c2325654641dfe5877a4022108098683"},
{file = "ruff-0.2.1-py3-none-musllinux_1_2_aarch64.whl", hash = "sha256:7022d66366d6fded4ba3889f73cd791c2d5621b2ccf34befc752cb0df70f5fad"},
{file = "ruff-0.2.1-py3-none-musllinux_1_2_armv7l.whl", hash = "sha256:0a725823cb2a3f08ee743a534cb6935727d9e47409e4ad72c10a3faf042ad5ba"},
{file = "ruff-0.2.1-py3-none-musllinux_1_2_i686.whl", hash = "sha256:0034d5b6323e6e8fe91b2a1e55b02d92d0b582d2953a2b37a67a2d7dedbb7acc"},
{file = "ruff-0.2.1-py3-none-musllinux_1_2_x86_64.whl", hash = "sha256:e5cb5526d69bb9143c2e4d2a115d08ffca3d8e0fddc84925a7b54931c96f5c02"},
{file = "ruff-0.2.1-py3-none-win32.whl", hash = "sha256:6b95ac9ce49b4fb390634d46d6ece32ace3acdd52814671ccaf20b7f60adb232"},
{file = "ruff-0.2.1-py3-none-win_amd64.whl", hash = "sha256:e3affdcbc2afb6f5bd0eb3130139ceedc5e3f28d206fe49f63073cb9e65988e0"},
{file = "ruff-0.2.1-py3-none-win_arm64.whl", hash = "sha256:efababa8e12330aa94a53e90a81eb6e2d55f348bc2e71adbf17d9cad23c03ee6"},
{file = "ruff-0.2.1.tar.gz", hash = "sha256:3b42b5d8677cd0c72b99fcaf068ffc62abb5a19e71b4a3b9cfa50658a0af02f1"},
]
[[package]]
@ -2534,20 +2534,20 @@ sqlcipher = ["sqlcipher3-binary"]
[[package]]
name = "starlette"
version = "0.35.1"
version = "0.36.3"
description = "The little ASGI library that shines."
optional = false
python-versions = ">=3.8"
files = [
{file = "starlette-0.35.1-py3-none-any.whl", hash = "sha256:50bbbda9baa098e361f398fda0928062abbaf1f54f4fadcbe17c092a01eb9a25"},
{file = "starlette-0.35.1.tar.gz", hash = "sha256:3e2639dac3520e4f58734ed22553f950d3f3cb1001cd2eaac4d57e8cdc5f66bc"},
{file = "starlette-0.36.3-py3-none-any.whl", hash = "sha256:13d429aa93a61dc40bf503e8c801db1f1bca3dc706b10ef2434a36123568f044"},
{file = "starlette-0.36.3.tar.gz", hash = "sha256:90a671733cfb35771d8cc605e0b679d23b992f8dcfad48cc60b38cb29aeb7080"},
]
[package.dependencies]
anyio = ">=3.4.0,<5"
[package.extras]
full = ["httpx (>=0.22.0)", "itsdangerous", "jinja2", "python-multipart", "pyyaml"]
full = ["httpx (>=0.22.0)", "itsdangerous", "jinja2", "python-multipart (>=0.0.7)", "pyyaml"]
[[package]]
name = "text-unidecode"

View File

@ -135,7 +135,7 @@ test_ingredients = [
@pytest.mark.skipif(not crf_exists(), reason="CRF++ not installed")
def test_nlp_parser():
def test_nlp_parser() -> None:
models: list[CRFIngredient] = convert_list_to_crf_model([x.input for x in test_ingredients])
# Iterate over models and test_ingredients to gather
@ -147,37 +147,102 @@ def test_nlp_parser():
assert model.unit == test_ingredient.unit
def test_brute_parser(unique_user: TestUser):
# input: (quantity, unit, food, comments)
expectations = {
# Dutch
"1 theelepel koffie": (1, "theelepel", "koffie", ""),
"3 theelepels koffie": (3, "theelepels", "koffie", ""),
"1 eetlepel tarwe": (1, "eetlepel", "tarwe", ""),
"20 eetlepels bloem": (20, "eetlepels", "bloem", ""),
"1 mespunt kaneel": (1, "mespunt", "kaneel", ""),
"1 snuf(je) zout": (1, "snuf(je)", "zout", ""),
"2 tbsp minced cilantro, leaves and stems": (2, "tbsp", "minced cilantro", "leaves and stems"),
"1 large yellow onion, coarsely chopped": (1, "large", "yellow onion", "coarsely chopped"),
"1 1/2 tsp garam masala": (1.5, "tsp", "garam masala", ""),
"2 cups mango chunks, (2 large mangoes) (fresh or frozen)": (
@pytest.mark.parametrize(
"input, quantity, unit, food, comment",
[
pytest.param("1 theelepel koffie", 1, "theelepel", "koffie", "", id="1 theelepel koffie"),
pytest.param("3 theelepels koffie", 3, "theelepels", "koffie", "", id="3 theelepels koffie"),
pytest.param("1 eetlepel tarwe", 1, "eetlepel", "tarwe", "", id="1 eetlepel tarwe"),
pytest.param("20 eetlepels bloem", 20, "eetlepels", "bloem", "", id="20 eetlepels bloem"),
pytest.param("1 mespunt kaneel", 1, "mespunt", "kaneel", "", id="1 mespunt kaneel"),
pytest.param("1 snuf(je) zout", 1, "snuf(je)", "zout", "", id="1 snuf(je) zout"),
pytest.param(
"2 tbsp minced cilantro, leaves and stems",
2,
"cups",
"tbsp",
"minced cilantro",
"leaves and stems",
id="2 tbsp minced cilantro, leaves and stems",
),
pytest.param(
"1 large yellow onion, coarsely chopped",
1,
"large",
"yellow onion",
"coarsely chopped",
id="1 large yellow onion, coarsely chopped",
),
pytest.param("1 1/2 tsp garam masala", 1.5, "tsp", "garam masala", "", id="1 1/2 tsp garam masala"),
pytest.param(
"2 cups mango chunks, (2 large mangoes) (fresh or frozen)",
2,
"Cups",
"mango chunks, (2 large mangoes)",
"fresh or frozen",
id="2 cups mango chunks, (2 large mangoes) (fresh or frozen)",
),
}
pytest.param("stalk onion", 0, "Stalk", "onion", "", id="stalk onion"),
pytest.param("a stalk bell peppers", 0, "Stalk", "bell peppers", "", id="a stalk bell peppers"),
pytest.param("a tablespoon unknownFood", 0, "Tablespoon", "unknownFood", "", id="a tablespoon unknownFood"),
pytest.param(
"stalk bell peppers, cut in pieces",
0,
"Stalk",
"bell peppers",
"cut in pieces",
id="stalk bell peppers, cut in pieces",
),
pytest.param(
"a stalk bell peppers, cut in pieces",
0,
"Stalk",
"bell peppers",
"cut in pieces",
id="stalk bell peppers, cut in pieces",
),
pytest.param("red pepper flakes", 0, "", "red pepper flakes", "", id="red pepper flakes"),
pytest.param("1 red pepper flakes", 1, "", "red pepper flakes", "", id="1 red pepper flakes"),
pytest.param("1 bell peppers", 1, "", "bell peppers", "", id="1 bell peppers"),
pytest.param("1 stalk bell peppers", 1, "Stalk", "bell peppers", "", id="1 big stalk bell peppers"),
pytest.param("a big stalk bell peppers", 0, "Stalk", "bell peppers", "", id="a big stalk bell peppers"),
pytest.param(
"1 bell peppers, cut in pieces", 1, "", "bell peppers", "cut in pieces", id="1 bell peppers, cut in pieces"
),
pytest.param(
"bell peppers, cut in pieces", 0, "", "bell peppers", "cut in pieces", id="bell peppers, cut in pieces"
),
],
)
def test_brute_parser(
unique_local_group_id: UUID4,
parsed_ingredient_data: tuple[list[IngredientFood], list[IngredientUnit]], # required so database is populated
input: str,
quantity: int | float,
unit: str,
food: str,
comment: str,
):
with session_context() as session:
parser = get_parser(RegisteredParser.brute, unique_user.group_id, session)
parser = get_parser(RegisteredParser.brute, unique_local_group_id, session)
parsed = parser.parse_one(input)
ing = parsed.ingredient
for key, val in expectations.items():
parsed = parser.parse_one(key)
assert parsed.ingredient.quantity == val[0]
assert parsed.ingredient.unit.name == val[1]
assert parsed.ingredient.food.name == val[2]
assert parsed.ingredient.note in {val[3], None}
if ing.quantity:
assert ing.quantity == quantity
else:
assert not quantity
if ing.unit:
assert ing.unit.name == unit
else:
assert not unit
if ing.food:
assert ing.food.name == food
else:
assert not food
if ing.note:
assert ing.note == comment
else:
assert not comment
@pytest.mark.parametrize(