fix: ensure base recipe references display correctly in English and auto-translate
All checks were successful
CI / update (push) Successful in 1m11s
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:
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user