配方卡片英文翻译 #15
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
修改英文翻译的时候,点击保存一下,应该真的保存好,下次打开就是我修改过的内容才对
PR 提交好了 👉 #16
根本原因:
applyTranslation()调用后端时只提交了en_name(配方名),精油的自定义英文名customOilNameEn根本没有持久化,每次onMounted都从静态翻译表重置。修改了 4 个文件:
backend/database.pyrecipes表新增en_oils列(JSON 字符串,存精油译名 map)backend/main.pyRecipeUpdate加en_oils字段;update 端点写入 DB;SELECT /_recipe_to_dict补上该字段frontend/src/stores/recipes.jsen_oils字段frontend/src/components/RecipeDetailOverlay.vueen_oils;加载时优先用已保存的译名,再 fallback 静态表