diff --git a/backend/main.py b/backend/main.py index b07511b..e727656 100644 --- a/backend/main.py +++ b/backend/main.py @@ -858,6 +858,9 @@ def update_recipe(recipe_id: int, update: RecipeUpdate, user=Depends(get_current if update.name is not None: c.execute("UPDATE recipes SET name = ? WHERE id = ?", (update.name, recipe_id)) + # Re-translate en_name if name changed and no explicit en_name provided + if update.en_name is None: + c.execute("UPDATE recipes SET en_name = ? WHERE id = ?", (auto_translate(update.name), recipe_id)) if update.note is not None: c.execute("UPDATE recipes SET note = ? WHERE id = ?", (update.note, recipe_id)) if update.en_name is not None: