fix: ensure base recipe references display correctly in English and auto-translate
All checks were successful
CI / update (push) Successful in 1m11s

Fixed three issues with base recipe translation support:

1. Base recipe content not loading in English - English API endpoint now
   populates baseRecipeRef fields to resolve base recipe data
2. itemsBefore/itemsAfter and stepsBefore/stepsAfter not being detected as
   changed - enhanced change detection to properly track all base recipe
   reference fields for re-translation
3. Base recipe name labels showing German text in English view - display
   components now use translated base recipe names as label fallback
This commit is contained in:
2026-01-04 20:45:51 +01:00
parent 545bd97959
commit 7e66445312
4 changed files with 91 additions and 5 deletions

View File

@@ -49,9 +49,14 @@ const flattenedIngredients = $derived.by(() => {
// Push as one section with optional label
if (combinedList.length > 0) {
// Use labelOverride if present, otherwise use base recipe name (translated if viewing in English)
const baseRecipeName = (lang === 'en' && item.resolvedRecipe.translations?.en?.name)
? item.resolvedRecipe.translations.en.name
: item.resolvedRecipe.name;
sections.push({
type: 'section',
name: item.showLabel ? (item.labelOverride || item.resolvedRecipe.name) : '',
name: item.showLabel ? (item.labelOverride || baseRecipeName) : '',
list: combinedList,
isReference: item.showLabel,
short_name: item.resolvedRecipe.short_name

View File

@@ -43,9 +43,14 @@ const flattenedInstructions = $derived.by(() => {
// Push as one section with optional label
if (combinedSteps.length > 0) {
// Use labelOverride if present, otherwise use base recipe name (translated if viewing in English)
const baseRecipeName = (lang === 'en' && item.resolvedRecipe.translations?.en?.name)
? item.resolvedRecipe.translations.en.name
: item.resolvedRecipe.name;
return [{
type: 'section',
name: item.showLabel ? (item.labelOverride || item.resolvedRecipe.name) : '',
name: item.showLabel ? (item.labelOverride || baseRecipeName) : '',
steps: combinedSteps,
isReference: item.showLabel,
short_name: item.resolvedRecipe.short_name