diff --git a/src/routes/[recipeLang=recipeLang]/add/+page.svelte b/src/routes/[recipeLang=recipeLang]/add/+page.svelte index f6579dd..5cb17bf 100644 --- a/src/routes/[recipeLang=recipeLang]/add/+page.svelte +++ b/src/routes/[recipeLang=recipeLang]/add/+page.svelte @@ -108,7 +108,7 @@ return { ...card_data, ...add_info, - images: {mediapath: short_name.trim() + '.webp', alt: "", caption: ""}, + images: [{mediapath: short_name.trim() + '.webp', alt: "", caption: ""}], season: season_local, short_name : short_name.trim(), portions: portions_local, diff --git a/src/utils/translation.ts b/src/utils/translation.ts index 87877a6..1163bac 100644 --- a/src/utils/translation.ts +++ b/src/utils/translation.ts @@ -325,7 +325,7 @@ class DeepLTranslationService { }); // Add image alt and caption texts - const images = recipe.images || []; + const images = Array.isArray(recipe.images) ? recipe.images : []; images.forEach((img: any) => { textsToTranslate.push(img.alt || ''); textsToTranslate.push(img.caption || '');