mirror of
https://github.com/hay-kot/mealie.git
synced 2025-08-22 14:33:33 -07:00
Merge branch 'dev' of https://github.com/hay-kot/mealie into refactor/response-models
This commit is contained in:
commit
27887a4dbf
4 changed files with 360 additions and 22 deletions
158
frontend/src/locales/de.json
Normal file
158
frontend/src/locales/de.json
Normal file
|
@ -0,0 +1,158 @@
|
|||
{
|
||||
"404": {
|
||||
"page-not-found": "404 Seite nicht gefunden",
|
||||
"take-me-home": "Zurück"
|
||||
},
|
||||
"new-recipe": {
|
||||
"from-url": "Von URL",
|
||||
"recipe-url": "Rezept URL",
|
||||
"error-message": "Ein Fehler ist beim import der URL aufgetreten. Überprüfe das Log sowie debug/last_recipe.json um zu sehen was schief gelaufen ist.",
|
||||
"bulk-add": "Massenimport",
|
||||
"paste-in-your-recipe-data-each-line-will-be-treated-as-an-item-in-a-list": "Füge deine Rezeptdaten ein. Jede Zeile wird als Eintrag in einer Liste dargestellt"
|
||||
},
|
||||
"general": {
|
||||
"upload": "Hochladen",
|
||||
"submit": "Einfügen",
|
||||
"name": "Name",
|
||||
"settings": "Einstellungen",
|
||||
"close": "Schließen",
|
||||
"save": "Speichern",
|
||||
"image-file": "Bilddatei",
|
||||
"update": "Aktualisieren",
|
||||
"edit": "Bearbeiten",
|
||||
"delete": "Löschen",
|
||||
"select": "Auswählen",
|
||||
"random": "Zufall",
|
||||
"new": "Neu",
|
||||
"create": "Erstellen",
|
||||
"cancel": "Abbrechen",
|
||||
"ok": "OK",
|
||||
"enabled": "Aktiviert",
|
||||
"download": "Herunterladen",
|
||||
"import": "Importieren",
|
||||
"options": "Optionen",
|
||||
"templates": "Vorlagen",
|
||||
"recipes": "Rezepte",
|
||||
"themes": "Themen",
|
||||
"confirm": "Besstätigen"
|
||||
},
|
||||
"login": {
|
||||
"stay-logged-in": "Eingeloggt bleiben?",
|
||||
"email": "Email",
|
||||
"password": "Passwort",
|
||||
"sign-in": "Einloggen",
|
||||
"sign-up": "Registrieren"
|
||||
},
|
||||
"meal-plan": {
|
||||
"dinner-this-week": "Essen diese Woche",
|
||||
"dinner-today": "Heutiges Essen",
|
||||
"planner": "Planer",
|
||||
"edit-meal-plan": "Essensplan bearbeiten",
|
||||
"meal-plans": "Essenspläne",
|
||||
"create-a-new-meal-plan": "Neuen Essensplan erstellen",
|
||||
"start-date": "Start-Datum",
|
||||
"end-date": "End-Datum"
|
||||
},
|
||||
"recipe": {
|
||||
"description": "Beschreibung",
|
||||
"ingredients": "Zutaten",
|
||||
"categories": "Kategorien",
|
||||
"tags": "Markierungen",
|
||||
"instructions": "Anweisungen",
|
||||
"step-index": "Schritt: {step}",
|
||||
"recipe-name": "Rezeptname",
|
||||
"servings": "Portionen",
|
||||
"ingredient": "Zutat",
|
||||
"notes": "Notizen",
|
||||
"note": "Notiz",
|
||||
"original-url": "Original URL",
|
||||
"view-recipe": "Rezept anschauen",
|
||||
"title": "Titel",
|
||||
"total-time": "Gesamtzeit",
|
||||
"prep-time": "Vorbereitungszeit",
|
||||
"perform-time": "Kochzeit",
|
||||
"api-extras": "API Extras",
|
||||
"object-key": "Objektschlüssel",
|
||||
"object-value": "Objektwert",
|
||||
"new-key-name": "Neuer Schlüsselname",
|
||||
"add-key": "Schlüssel hinzufügen",
|
||||
"key-name-required": "Schlüsselname benötigt",
|
||||
"no-white-space-allowed": "Keine Leerschritte erlaubt",
|
||||
"delete-recipe": "Rezept löschen",
|
||||
"delete-confirmation": "Bist du sicher das du dieses Rezept löschen möchtest?"
|
||||
},
|
||||
"search": {
|
||||
"search-mealie": "Suche Mealie"
|
||||
},
|
||||
"settings": {
|
||||
"general-settings": "Einstellungen",
|
||||
"local-api": "Lokale API",
|
||||
"language": "Sprache",
|
||||
"add-a-new-theme": "Neues Thema hinzufügen",
|
||||
"set-new-time": "Neue Zeit einstellen",
|
||||
"current": "Version:",
|
||||
"latest": "Neuste",
|
||||
"explore-the-docs": "Stöbern",
|
||||
"contribute": "Beitragen",
|
||||
"backup-and-exports": "Sicherungen",
|
||||
"backup-info": "Sicherungen werden im standard JSON Format in das Dateisystem exportiert mitsamt sämtlicher Bilder. In deinem Sicherungsorder findest du eine ZIP Datei welche sämtliche JSON's deiner Rezepte und die Bilder aus der Datenbank enthält. Solltest du eine Markdown Datei auswählen werden diese ebenfalls im ZIP gespeichert. Um eine Sicherung zurückzuspielen muss die entsprechende ZIP Datei im Sicherungsorder liegen. Automatische Sicherungen finden jeden Tag um 3 Uhr früh statt.",
|
||||
"available-backups": "Verfügbare Sicherungen",
|
||||
"theme": {
|
||||
"theme-name": "Themenname",
|
||||
"theme-settings": "Themeneinstellungen",
|
||||
"select-a-theme-from-the-dropdown-or-create-a-new-theme-note-that-the-default-theme-will-be-served-to-all-users-who-have-not-set-a-theme-preference": "Wähle ein Thema aus der Dropdown-Liste oder erstelle ein neues. Beachte das das Standard Thema auf alle Benutzer angewandt wird die keine Einstellung für ein Thema getroffen haben.",
|
||||
"dark-mode": "Dunkler Modus",
|
||||
"theme-is-required": "Thema wird benötigt",
|
||||
"primary": "primär",
|
||||
"secondary": "sekundär",
|
||||
"accent": "betonen",
|
||||
"success": "Erfolg",
|
||||
"info": "Information",
|
||||
"warning": "Warnung",
|
||||
"error": "Fehler",
|
||||
"default-to-system": "Standardeinstellung",
|
||||
"light": "Hell",
|
||||
"dark": "Dunkel",
|
||||
"theme": "Thema",
|
||||
"saved-color-theme": "Buntes Thema gespeichert",
|
||||
"delete-theme": "Thema löschen",
|
||||
"are-you-sure-you-want-to-delete-this-theme": "Bist du sicher das du dieses Thema löschen möchtest?",
|
||||
"choose-how-mealie-looks-to-you-set-your-theme-preference-to-follow-your-system-settings-or-choose-to-use-the-light-or-dark-theme": "Entscheide wie Mealie für dich aussehen soll. Wähle Systemthema oder ob es Hell oder Dunkel dargestellt werden soll",
|
||||
"theme-name-is-required": "Theme Name is required."
|
||||
},
|
||||
"webhooks": {
|
||||
"meal-planner-webhooks": "Meal Planner Webhooks",
|
||||
"the-urls-listed-below-will-recieve-webhooks-containing-the-recipe-data-for-the-meal-plan-on-its-scheduled-day-currently-webhooks-will-execute-at": "Die unten stehenden URL's erhalten webhooks die die Rezeptdaten enthalten für den Menüplan am geplanten Tag. Derzeit werden die webhooks ausgeführt um",
|
||||
"test-webhooks": "Teste Webhooks",
|
||||
"webhook-url": "Webhook URL"
|
||||
},
|
||||
"new-version-available": "Eine neue Version von Mealie steht zur verfügung, <a {aContents}> Schau ins Repository </a>",
|
||||
"backup": {
|
||||
"import-recipes": "Rezepte importieren",
|
||||
"import-themes": "Themen importieren",
|
||||
"import-settings": "Einstellungen importieren",
|
||||
"create-heading": "Sicherung erstellen",
|
||||
"backup-tag": "Sicherungsmarkierung",
|
||||
"full-backup": "Komplettsicherungen",
|
||||
"partial-backup": "Teilsicherungen",
|
||||
"backup-restore-report": "Sicherungs/Widerherstellungsbericht",
|
||||
"successfully-imported": "Erfolgreich importiert",
|
||||
"failed-imports": "Import fehlgeschlagen"
|
||||
}
|
||||
},
|
||||
"migration": {
|
||||
"recipe-migration": "Rezepte übertragen",
|
||||
"failed-imports": "Fehlgeschlagene Importe",
|
||||
"migration-report": "Übertragungsbericht",
|
||||
"successful-imports": "Erfolgreiche Importe",
|
||||
"no-migration-data-available": "Keine Übertragungsdaten verfügbar",
|
||||
"nextcloud": {
|
||||
"title": "Nextcloud Cookbook",
|
||||
"description": "Übertrage Daten aus einer Nextcloud Cookbook Instanz"
|
||||
},
|
||||
"chowdown": {
|
||||
"title": "Chowdown",
|
||||
"description": "Übertrage Daten aus Chowdown"
|
||||
}
|
||||
}
|
||||
}
|
158
frontend/src/locales/pl.json
Normal file
158
frontend/src/locales/pl.json
Normal file
|
@ -0,0 +1,158 @@
|
|||
{
|
||||
"404": {
|
||||
"page-not-found": "404 Strony nie odnaleziono",
|
||||
"take-me-home": "Powrót na stronę główną"
|
||||
},
|
||||
"new-recipe": {
|
||||
"from-url": "Z odnośnika",
|
||||
"recipe-url": "Odnośnik przepisu",
|
||||
"error-message": "Wygląda na to, że wystąpił błąd. Sprawdź log i debug/last_recipe.json aby zasięgnąć po więcej informacji.",
|
||||
"bulk-add": "Dodanie zbiorcze",
|
||||
"paste-in-your-recipe-data-each-line-will-be-treated-as-an-item-in-a-list": "Przeklej zawartość przepisu. Każda indywidualna linia traktowana będzie jako pozycja na liście"
|
||||
},
|
||||
"general": {
|
||||
"upload": "Wrzuć",
|
||||
"submit": "Zatwierdź",
|
||||
"name": "Nazwa",
|
||||
"settings": "Ustawienia",
|
||||
"close": "Zamknij",
|
||||
"save": "Zapisz",
|
||||
"image-file": "Plik obrazu",
|
||||
"update": "Uaktualnij",
|
||||
"edit": "Edytuj",
|
||||
"delete": "Usuń",
|
||||
"select": "Zaznacz",
|
||||
"random": "Losowa",
|
||||
"new": "Nowa",
|
||||
"create": "Utwórz",
|
||||
"cancel": "Anuluj",
|
||||
"ok": "OK",
|
||||
"enabled": "Włączone",
|
||||
"download": "Pobierz",
|
||||
"import": "Importuj",
|
||||
"options": "Opcje",
|
||||
"templates": "Szablony",
|
||||
"recipes": "Przepisy",
|
||||
"themes": "Motywy",
|
||||
"confirm": "Potwierdź"
|
||||
},
|
||||
"login": {
|
||||
"stay-logged-in": "Pozostań zalogowany",
|
||||
"email": "Email",
|
||||
"password": "Hasło",
|
||||
"sign-in": "Zaloguj się",
|
||||
"sign-up": "Zarejestruj się"
|
||||
},
|
||||
"meal-plan": {
|
||||
"dinner-this-week": "Obiad w tym tygodniu",
|
||||
"dinner-today": "Obiad dziś",
|
||||
"planner": "Planer",
|
||||
"edit-meal-plan": "Edytuj plan posiłku",
|
||||
"meal-plans": "Plany posiłku",
|
||||
"create-a-new-meal-plan": "Utwórz nowy plan posiłku",
|
||||
"start-date": "Data rozpoczęcia",
|
||||
"end-date": "Data zakończenia"
|
||||
},
|
||||
"recipe": {
|
||||
"description": "Opis",
|
||||
"ingredients": "Składniki",
|
||||
"categories": "Kategorie",
|
||||
"tags": "Etykiety",
|
||||
"instructions": "Instrukcje",
|
||||
"step-index": "Krok: {step}",
|
||||
"recipe-name": "Nazwa przepisu",
|
||||
"servings": "Porcje",
|
||||
"ingredient": "Składnik",
|
||||
"notes": "Notatki",
|
||||
"note": "Notatka",
|
||||
"original-url": "Oryginalny odnośnik",
|
||||
"view-recipe": "Wyświetl przepis",
|
||||
"title": "Tytuł",
|
||||
"total-time": "Czas całkowity",
|
||||
"prep-time": "Czas przyrządzania",
|
||||
"perform-time": "Czas gotowania",
|
||||
"api-extras": "Dodatki API",
|
||||
"object-key": "Klucz obiektu",
|
||||
"object-value": "Wartość obiektu",
|
||||
"new-key-name": "Nazwa nowego klucza",
|
||||
"add-key": "Dodaj klucz",
|
||||
"key-name-required": "Nazwa klucza jest wymagana",
|
||||
"no-white-space-allowed": "Znaki niedrukowalne są niedozwolone",
|
||||
"delete-recipe": "Usuń przepis",
|
||||
"delete-confirmation": "Czy jesteś pewien, że chcesz usunąć ten przepis?"
|
||||
},
|
||||
"search": {
|
||||
"search-mealie": "Przeszukaj Mealie"
|
||||
},
|
||||
"settings": {
|
||||
"general-settings": "Ustawienia główne",
|
||||
"local-api": "Lokalne API",
|
||||
"language": "Język",
|
||||
"add-a-new-theme": "Dodaj nowy motyw",
|
||||
"set-new-time": "Ustaw nowy czas",
|
||||
"current": "Wersja:",
|
||||
"latest": "Najnowsza",
|
||||
"explore-the-docs": "Zobacz dokumentację",
|
||||
"contribute": "Wspomóż",
|
||||
"backup-and-exports": "Kopie zapasowe",
|
||||
"backup-info": "Kopie zapasowe zapisywane są w standardowym formacie JSON wraz ze zdjęciami w systemie plików. W katalogu kopii zapasowej znajdziesz plik z rozszerzeniem .zip zawierający wszystkie przepisy i zdjęcia z bazy danych. Jeśli oznaczone zostały pliki markdown, one także znajdą się w pliku .zip. Aby zaimportować kopię, musi ona znajdować się w folderze kopii zapasowych. Kopie automatyczne tworzone są codziennie o godzinie 03:00.",
|
||||
"available-backups": "Dostępne kopie zapsowe",
|
||||
"theme": {
|
||||
"theme-name": "Nazwa motywu",
|
||||
"theme-settings": "Ustawienia motywu",
|
||||
"select-a-theme-from-the-dropdown-or-create-a-new-theme-note-that-the-default-theme-will-be-served-to-all-users-who-have-not-set-a-theme-preference": "Wybierz motyw z rozwijanej listy bądź stwórz nowy. Domyślny motyw zostanie użyty dla wszystkich użytkowników którzy nie wybrali własnej preferencji.",
|
||||
"dark-mode": "Ciemny motyw",
|
||||
"theme-is-required": "Motyw jest wymagany",
|
||||
"primary": "Pierwszorzędny",
|
||||
"secondary": "Drugorzędny",
|
||||
"accent": "Akcent",
|
||||
"success": "Powodzenie",
|
||||
"info": "Informacja",
|
||||
"warning": "Ostrzeżenie",
|
||||
"error": "Błąd",
|
||||
"default-to-system": "Domyślny dla systemu",
|
||||
"light": "Jasny",
|
||||
"dark": "Ciemny",
|
||||
"theme": "Motyw",
|
||||
"saved-color-theme": "Zapisany kolor motywu",
|
||||
"delete-theme": "Usuń motyw",
|
||||
"are-you-sure-you-want-to-delete-this-theme": "Czy jesteś pewien, że chcesz usunąć ten motyw?",
|
||||
"choose-how-mealie-looks-to-you-set-your-theme-preference-to-follow-your-system-settings-or-choose-to-use-the-light-or-dark-theme": "Wybierz jak Mealie ma dla Ciebie wyglądać. Dostępne opcje to podążanie za odcieniem systemowym, bądź motyw jasny lub ciemny.",
|
||||
"theme-name-is-required": "Nazwa motywu jest wymagana."
|
||||
},
|
||||
"webhooks": {
|
||||
"meal-planner-webhooks": "Webhooki planera posiłków",
|
||||
"the-urls-listed-below-will-recieve-webhooks-containing-the-recipe-data-for-the-meal-plan-on-its-scheduled-day-currently-webhooks-will-execute-at": "Odnośniki poniżej otrzymają webhook zawierający dane o przepisie dla danego dnia. Aktualnie webhooki zostanę wykonane o",
|
||||
"test-webhooks": "Testuj webhooki",
|
||||
"webhook-url": "Odnośnik webhooka"
|
||||
},
|
||||
"new-version-available": "Dostępna jest nowa wersja Mealie, <a {aContents}> sprawdź repozytorium </a>",
|
||||
"backup": {
|
||||
"import-recipes": "Wgraj przepisy",
|
||||
"import-themes": "Wgraj motywy",
|
||||
"import-settings": "Wgraj ustawienia",
|
||||
"create-heading": "Utwórz kopię zapasową",
|
||||
"backup-tag": "Etykieta kopii zapasowej",
|
||||
"full-backup": "Pełna kopia zapasowa",
|
||||
"partial-backup": "Częściowa kopia zapasowa",
|
||||
"backup-restore-report": "Raport przywrócenia kopii zapasowej",
|
||||
"successfully-imported": "Import zakończony suckesem",
|
||||
"failed-imports": "Importy nieudane"
|
||||
}
|
||||
},
|
||||
"migration": {
|
||||
"recipe-migration": "Przenoszenie przepisów",
|
||||
"failed-imports": "Importy udane",
|
||||
"migration-report": "Raport przenosin",
|
||||
"successful-imports": "Importy nieudane",
|
||||
"no-migration-data-available": "Brak danych do przeniesienia",
|
||||
"nextcloud": {
|
||||
"title": "Nextcloud Cookbook",
|
||||
"description": "Przenieś dane z Nextcloud Cookbook"
|
||||
},
|
||||
"chowdown": {
|
||||
"title": "Chowdown",
|
||||
"description": "Przenieś dane z Chowdown"
|
||||
}
|
||||
}
|
||||
}
|
|
@ -15,6 +15,10 @@ const state = {
|
|||
name: "French",
|
||||
value: "fr",
|
||||
},
|
||||
{
|
||||
name: "Polish",
|
||||
value: "pl",
|
||||
},
|
||||
{
|
||||
name: "Swedish",
|
||||
value: "sv",
|
||||
|
|
|
@ -40,11 +40,7 @@ def normalize_instructions(instructions) -> List[dict]:
|
|||
|
||||
# One long string split by (possibly multiple) new lines
|
||||
if type(instructions) == str:
|
||||
return [
|
||||
{"text": normalize_instruction(line)}
|
||||
for line in instructions.splitlines()
|
||||
if line
|
||||
]
|
||||
return [{"text": normalize_instruction(line)} for line in instructions.splitlines() if line]
|
||||
|
||||
# Plain strings in a list
|
||||
elif type(instructions) == list and type(instructions[0]) == str:
|
||||
|
@ -52,11 +48,31 @@ def normalize_instructions(instructions) -> List[dict]:
|
|||
|
||||
# Dictionaries (let's assume it's a HowToStep) in a list
|
||||
elif type(instructions) == list and type(instructions[0]) == dict:
|
||||
return [
|
||||
{"text": normalize_instruction(step["text"])}
|
||||
for step in instructions
|
||||
if step["@type"] == "HowToStep"
|
||||
]
|
||||
try:
|
||||
# If HowToStep is under HowToSection
|
||||
sectionSteps = []
|
||||
for step in instructions:
|
||||
if step["@type"] == "HowToSection":
|
||||
for item in step["itemListElement"]:
|
||||
sectionSteps.append(item)
|
||||
|
||||
if len(sectionSteps) > 0:
|
||||
return [
|
||||
{"text": normalize_instruction(step["text"])}
|
||||
for step in sectionSteps
|
||||
if step["@type"] == "HowToStep"
|
||||
]
|
||||
|
||||
return [
|
||||
{"text": normalize_instruction(step["text"])} for step in instructions if step["@type"] == "HowToStep"
|
||||
]
|
||||
except Exception as e:
|
||||
# Not "@type", try "type"
|
||||
return [
|
||||
{"text": normalize_instruction(step["properties"]["text"])}
|
||||
for step in instructions
|
||||
if step["type"].find("HowToStep") > -1
|
||||
]
|
||||
|
||||
else:
|
||||
raise Exception(f"Unrecognised instruction format: {instructions}")
|
||||
|
@ -95,12 +111,8 @@ def normalize_data(recipe_data: dict) -> dict:
|
|||
recipe_data["prepTime"] = normalize_time(recipe_data.get("prepTime"))
|
||||
recipe_data["performTime"] = normalize_time(recipe_data.get("performTime"))
|
||||
recipe_data["recipeYield"] = normalize_yield(recipe_data.get("recipeYield"))
|
||||
recipe_data["recipeIngredient"] = normalize_ingredient(
|
||||
recipe_data.get("recipeIngredient")
|
||||
)
|
||||
recipe_data["recipeInstructions"] = normalize_instructions(
|
||||
recipe_data["recipeInstructions"]
|
||||
)
|
||||
recipe_data["recipeIngredient"] = normalize_ingredient(recipe_data.get("recipeIngredient"))
|
||||
recipe_data["recipeInstructions"] = normalize_instructions(recipe_data["recipeInstructions"])
|
||||
recipe_data["image"] = normalize_image_url(recipe_data["image"])
|
||||
return recipe_data
|
||||
|
||||
|
@ -123,13 +135,19 @@ def process_recipe_data(new_recipe: dict, url=None) -> dict:
|
|||
|
||||
|
||||
def extract_recipe_from_html(html: str, url: str) -> dict:
|
||||
scraped_recipes: List[dict] = scrape_schema_recipe.loads(html, python_objects=True)
|
||||
dump_last_json(scraped_recipes)
|
||||
try:
|
||||
scraped_recipes: List[dict] = scrape_schema_recipe.loads(html, python_objects=True)
|
||||
dump_last_json(scraped_recipes)
|
||||
|
||||
if not scraped_recipes:
|
||||
scraped_recipes: List[dict] = scrape_schema_recipe.scrape_url(
|
||||
url, python_objects=True
|
||||
)
|
||||
if not scraped_recipes:
|
||||
scraped_recipes: List[dict] = scrape_schema_recipe.scrape_url(url, python_objects=True)
|
||||
except Exception as e:
|
||||
# trying without python_objects
|
||||
scraped_recipes: List[dict] = scrape_schema_recipe.loads(html)
|
||||
dump_last_json(scraped_recipes)
|
||||
|
||||
if not scraped_recipes:
|
||||
scraped_recipes: List[dict] = scrape_schema_recipe.scrape_url(url)
|
||||
|
||||
if scraped_recipes:
|
||||
new_recipe: dict = scraped_recipes[0]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue