Files
food-ai/client/lib/l10n/app_zh.arb
dbastrikin c7317c4335 feat: async product/receipt recognition via Kafka
Backend:
- Migration 002: product_recognition_jobs table with JSONB images column
  and job_type CHECK ('receipt' | 'products')
- New Kafka topics: ai.products.paid / ai.products.free
- ProductJob model, ProductJobRepository (mirrors dish job pattern)
- itemEnricher extracted from Handler — shared by HTTP handler and worker
- ProductSSEBroker: PG LISTEN on product_job_update channel
- ProductWorkerPool: 5 workers, branches on job_type to call
  RecognizeReceipt or RecognizeProducts per image in parallel
- Handler: RecognizeReceipt and RecognizeProducts now return 202 Accepted
  instead of blocking; 4 new endpoints: GET /ai/product-jobs,
  /product-jobs/history, /product-jobs/{id}, /product-jobs/{id}/stream
- cmd/worker: extended to run ProductWorkerPool alongside dish WorkerPool
- cmd/server: wires productJobRepository + productSSEBroker; both SSE
  brokers started in App.Start()

Flutter client:
- ProductJobCreated, ProductJobResult, ProductJobSummary, ProductJobEvent
  models + submitReceiptRecognition/submitProductsRecognition/stream methods
- Shared _openSseStream helper eliminates duplicate SSE parsing loop
- ScanScreen: replace blocking AI calls with async submit + navigate to
  ProductJobWatchScreen
- ProductJobWatchScreen: watches SSE stream, navigates to /scan/confirm
  when done, shows error on failure
- ProductsScreen: prepends _RecentScansSection (hidden when empty); compact
  horizontal list of recent scans with "See all" → history
- ProductJobHistoryScreen: full list of all product recognition jobs
- New routes: /scan/product-job-watch, /products/job-history
- L10n: 7 new keys in all 12 ARB files

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-23 23:01:30 +02:00

177 lines
5.6 KiB
Plaintext

{
"@@locale": "zh",
"appTitle": "FoodAI",
"greetingMorning": "早上好",
"greetingAfternoon": "下午好",
"greetingEvening": "晚上好",
"caloriesUnit": "千卡",
"gramsUnit": "克",
"goalLabel": "目标:",
"consumed": "已摄入",
"remaining": "剩余",
"exceeded": "超出",
"proteinLabel": "蛋白质",
"fatLabel": "脂肪",
"carbsLabel": "碳水化合物",
"today": "今天",
"yesterday": "昨天",
"mealsSection": "餐食",
"addDish": "添加菜品",
"scanDish": "扫描",
"menu": "菜单",
"dishHistory": "菜品历史",
"recommendCook": "推荐烹饪",
"camera": "相机",
"gallery": "相册",
"analyzingPhoto": "正在分析照片...",
"inQueue": "您在队列中",
"queuePosition": "位置 {position}",
"@queuePosition": {
"placeholders": {
"position": {
"type": "int"
}
}
},
"processing": "处理中...",
"upgradePrompt": "跳过队列?升级 →",
"recognitionFailed": "识别失败。请重试。",
"dishRecognition": "菜品识别",
"all": "全部",
"dishRecognized": "菜品已识别",
"recognizing": "识别中…",
"recognitionError": "识别错误",
"dishResultTitle": "菜品已识别",
"selectDish": "选择菜品",
"dishNotRecognized": "未识别到菜品",
"tryAgain": "重试",
"nutritionApproximate": "营养值为近似值 — 根据照片估算。",
"portion": "份量",
"mealType": "餐食类型",
"dateLabel": "日期",
"addToJournal": "添加到日记",
"addFailed": "添加失败。请重试。",
"historyTitle": "识别历史",
"historyLoadError": "加载历史失败",
"retry": "重试",
"noHistory": "暂无识别记录",
"profileTitle": "个人资料",
"edit": "编辑",
"bodyParams": "身体参数",
"goalActivity": "目标与活动",
"nutrition": "营养",
"settings": "设置",
"height": "身高",
"weight": "体重",
"age": "年龄",
"gender": "性别",
"genderMale": "男",
"genderFemale": "女",
"goalLoss": "减重",
"goalMaintain": "保持",
"goalGain": "增肌",
"activityLow": "低",
"activityMedium": "中",
"activityHigh": "高",
"calorieGoal": "卡路里目标",
"mealTypes": "餐食类型",
"formulaNote": "使用米夫林-圣热尔公式计算",
"language": "语言",
"notSet": "未设置",
"calorieHint": "输入身体参数以计算卡路里目标",
"logout": "退出登录",
"editProfile": "编辑资料",
"cancel": "取消",
"save": "保存",
"nameLabel": "姓名",
"heightCm": "身高(厘米)",
"weightKg": "体重(千克)",
"birthDate": "出生日期",
"nameRequired": "请输入姓名",
"profileUpdated": "资料已更新",
"profileSaveFailed": "保存失败",
"mealTypeBreakfast": "早餐",
"mealTypeSecondBreakfast": "第二早餐",
"mealTypeLunch": "午餐",
"mealTypeAfternoonSnack": "下午茶",
"mealTypeDinner": "晚餐",
"mealTypeSnack": "零食",
"navHome": "首页",
"navProducts": "食品",
"navRecipes": "食谱",
"addFromReceiptOrPhoto": "从收据或照片添加",
"chooseMethod": "选择方式",
"photoReceipt": "拍摄收据",
"photoReceiptSubtitle": "识别收据中的所有商品",
"photoProducts": "拍摄食品",
"photoProductsSubtitle": "冰箱、桌子、货架 — 最多3张照片",
"addPackagedFood": "添加包装食品",
"scanBarcode": "扫描条形码",
"portionWeightG": "份量(克)",
"productNotFound": "未找到产品",
"enterManually": "手动输入",
"perHundredG": "每100克",
"searchFoodHint": "搜索产品和菜肴...",
"recentlyUsedLabel": "最近使用",
"productsSection": "产品",
"dishesSection": "菜肴",
"noResultsForQuery": "未找到 \"{query}\" 的结果",
"@noResultsForQuery": {
"placeholders": {
"query": {
"type": "String"
}
}
},
"servingsLabel": "份数",
"addToDiary": "添加到日记",
"scanDishPhoto": "扫描照片",
"planningForDate": "",
"@planningForDate": {
"placeholders": {
"date": {
"type": "String"
}
}
},
"markAsEaten": "标记为已吃",
"plannedMealLabel": "已计划",
"generateWeekLabel": "规划本周",
"generateWeekSubtitle": "AI将为整周创建含早餐、午餐和晚餐的菜单",
"generatingMenu": "正在生成菜单...",
"dayPlannedLabel": "今日已规划",
"planMenuButton": "规划餐食",
"planMenuTitle": "规划什么?",
"planOptionSingleMeal": "单次餐食",
"planOptionSingleMealDesc": "选择日期和餐食类型",
"planOptionDay": "一天",
"planOptionDayDesc": "一天的所有餐食",
"planOptionDays": "几天",
"planOptionDaysDesc": "自定义日期范围",
"planOptionWeek": "一周",
"planOptionWeekDesc": "一次规划7天",
"planSelectDate": "选择日期",
"planSelectMealType": "餐食类型",
"planSelectRange": "选择时间段",
"planGenerateButton": "规划",
"planGenerating": "正在生成计划…",
"planSuccess": "菜单已规划!",
"planProductsTitle": "菜单食材",
"planProductsSubtitle": "AI在生成食谱时会考虑所选食材",
"planProductsEmpty": "尚未添加食材",
"planProductsEmptyMessage": "添加您家中的食材 — AI将根据您已有的食材推荐食谱",
"planProductsAddProducts": "添加食材",
"planProductsContinue": "继续",
"planProductsSkip": "跳过食材选择",
"planProductsSkipNoProducts": "不选食材直接规划",
"planProductsSelectAll": "全选",
"planProductsDeselectAll": "取消全选",
"recentScans": "最近扫描",
"seeAllScans": "全部",
"productJobHistoryTitle": "扫描历史",
"jobTypeReceipt": "收据",
"jobTypeProducts": "产品",
"scanSubmitting": "提交中...",
"processingProducts": "处理中..."
}