Refactor frontend to Vue 3 + Vite + Pinia + Cypress E2E
- Replace single-file 8441-line HTML with Vue 3 SPA - Pinia stores: auth, oils, recipes, diary, ui - Composables: useApi, useDialog, useSmartPaste, useOilTranslation - 6 shared components: RecipeCard, RecipeDetailOverlay, TagPicker, etc. - 9 page views: RecipeSearch, RecipeManager, Inventory, OilReference, etc. - 14 Cypress E2E test specs (113 tests), all passing - Multi-stage Dockerfile (Node build + Python runtime) - Demo video generation scripts (TTS + subtitles + screen recording) Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
42
frontend/src/composables/useOilTranslation.js
Normal file
42
frontend/src/composables/useOilTranslation.js
Normal file
@@ -0,0 +1,42 @@
|
||||
// Oil English names map
|
||||
const OIL_EN = {
|
||||
'薰衣草': 'Lavender', '茶树': 'Tea Tree', '乳香': 'Frankincense',
|
||||
'柠檬': 'Lemon', '椒样薄荷': 'Peppermint', '丝柏': 'Cypress',
|
||||
'尤加利': 'Eucalyptus', '迷迭香': 'Rosemary', '天竺葵': 'Geranium',
|
||||
'依兰依兰': 'Ylang Ylang', '佛手柑': 'Bergamot', '生姜': 'Ginger',
|
||||
'没药': 'Myrrh', '檀香': 'Sandalwood', '雪松': 'Cedarwood',
|
||||
'罗马洋甘菊': 'Roman Chamomile', '永久花': 'Helichrysum',
|
||||
'快乐鼠尾草': 'Clary Sage', '广藿香': 'Patchouli',
|
||||
'百里香': 'Thyme', '牛至': 'Oregano', '冬青': 'Wintergreen',
|
||||
'肉桂': 'Cinnamon', '丁香': 'Clove', '黑胡椒': 'Black Pepper',
|
||||
'葡萄柚': 'Grapefruit', '橙花': 'Neroli', '玫瑰': 'Rose',
|
||||
'岩兰草': 'Vetiver', '马郁兰': 'Marjoram', '芫荽': 'Coriander',
|
||||
'柠檬草': 'Lemongrass', '杜松浆果': 'Juniper Berry', '甜橙': 'Wild Orange',
|
||||
'香茅': 'Citronella', '薄荷': 'Peppermint', '扁柏': 'Arborvitae',
|
||||
'古巴香脂': 'Copaiba', '椰子油': 'Coconut Oil',
|
||||
'芳香调理': 'AromaTouch', '保卫复方': 'On Guard',
|
||||
'乐活复方': 'Balance', '舒缓复方': 'Past Tense',
|
||||
'净化复方': 'Purify', '呼吸复方': 'Breathe',
|
||||
'舒压复方': 'Adaptiv', '多特瑞': 'doTERRA',
|
||||
}
|
||||
|
||||
export function oilEn(name) {
|
||||
return OIL_EN[name] || ''
|
||||
}
|
||||
|
||||
export function recipeNameEn(name) {
|
||||
// Try to translate known keywords
|
||||
// Simple approach: return original name for now, user can customize
|
||||
return name
|
||||
}
|
||||
|
||||
// Custom translations (can be set by admin)
|
||||
const customTranslations = {}
|
||||
|
||||
export function setCustomTranslation(zhName, enName) {
|
||||
customTranslations[zhName] = enName
|
||||
}
|
||||
|
||||
export function getCustomTranslation(zhName) {
|
||||
return customTranslations[zhName]
|
||||
}
|
||||
Reference in New Issue
Block a user