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>
479 lines
9.8 KiB
Dart
479 lines
9.8 KiB
Dart
// ignore: unused_import
|
|
import 'package:intl/intl.dart' as intl;
|
|
import 'app_localizations.dart';
|
|
|
|
// ignore_for_file: type=lint
|
|
|
|
/// The translations for Portuguese (`pt`).
|
|
class AppLocalizationsPt extends AppLocalizations {
|
|
AppLocalizationsPt([String locale = 'pt']) : super(locale);
|
|
|
|
@override
|
|
String get appTitle => 'FoodAI';
|
|
|
|
@override
|
|
String get greetingMorning => 'Bom dia';
|
|
|
|
@override
|
|
String get greetingAfternoon => 'Boa tarde';
|
|
|
|
@override
|
|
String get greetingEvening => 'Boa noite';
|
|
|
|
@override
|
|
String get caloriesUnit => 'kcal';
|
|
|
|
@override
|
|
String get gramsUnit => 'g';
|
|
|
|
@override
|
|
String get goalLabel => 'meta:';
|
|
|
|
@override
|
|
String get consumed => 'Consumido';
|
|
|
|
@override
|
|
String get remaining => 'Restante';
|
|
|
|
@override
|
|
String get exceeded => 'Excedido';
|
|
|
|
@override
|
|
String get proteinLabel => 'Proteínas';
|
|
|
|
@override
|
|
String get fatLabel => 'Gorduras';
|
|
|
|
@override
|
|
String get carbsLabel => 'Carboidratos';
|
|
|
|
@override
|
|
String get today => 'Hoje';
|
|
|
|
@override
|
|
String get yesterday => 'Ontem';
|
|
|
|
@override
|
|
String get mealsSection => 'Refeições';
|
|
|
|
@override
|
|
String get addDish => 'Adicionar prato';
|
|
|
|
@override
|
|
String get scanDish => 'Escanear';
|
|
|
|
@override
|
|
String get menu => 'Menu';
|
|
|
|
@override
|
|
String get dishHistory => 'Histórico de pratos';
|
|
|
|
@override
|
|
String get recommendCook => 'Recomendamos cozinhar';
|
|
|
|
@override
|
|
String get camera => 'Câmera';
|
|
|
|
@override
|
|
String get gallery => 'Galeria';
|
|
|
|
@override
|
|
String get analyzingPhoto => 'Analisando foto...';
|
|
|
|
@override
|
|
String get inQueue => 'Você está na fila';
|
|
|
|
@override
|
|
String queuePosition(int position) {
|
|
return 'Posição $position';
|
|
}
|
|
|
|
@override
|
|
String get processing => 'Processando...';
|
|
|
|
@override
|
|
String get upgradePrompt => 'Pular a fila? Faça upgrade →';
|
|
|
|
@override
|
|
String get recognitionFailed => 'Reconhecimento falhou. Tente novamente.';
|
|
|
|
@override
|
|
String get dishRecognition => 'Reconhecimento de pratos';
|
|
|
|
@override
|
|
String get all => 'Todos';
|
|
|
|
@override
|
|
String get dishRecognized => 'Prato reconhecido';
|
|
|
|
@override
|
|
String get recognizing => 'Reconhecendo…';
|
|
|
|
@override
|
|
String get recognitionError => 'Erro de reconhecimento';
|
|
|
|
@override
|
|
String get dishResultTitle => 'Prato reconhecido';
|
|
|
|
@override
|
|
String get selectDish => 'Selecionar prato';
|
|
|
|
@override
|
|
String get dishNotRecognized => 'Prato não reconhecido';
|
|
|
|
@override
|
|
String get tryAgain => 'Tentar novamente';
|
|
|
|
@override
|
|
String get nutritionApproximate =>
|
|
'Os valores nutricionais são aproximados — estimados pela foto.';
|
|
|
|
@override
|
|
String get portion => 'Porção';
|
|
|
|
@override
|
|
String get mealType => 'Tipo de refeição';
|
|
|
|
@override
|
|
String get dateLabel => 'Data';
|
|
|
|
@override
|
|
String get addToJournal => 'Adicionar ao diário';
|
|
|
|
@override
|
|
String get addFailed => 'Falha ao adicionar. Tente novamente.';
|
|
|
|
@override
|
|
String get historyTitle => 'Histórico de reconhecimentos';
|
|
|
|
@override
|
|
String get historyLoadError => 'Falha ao carregar o histórico';
|
|
|
|
@override
|
|
String get retry => 'Tentar novamente';
|
|
|
|
@override
|
|
String get noHistory => 'Nenhum reconhecimento ainda';
|
|
|
|
@override
|
|
String get profileTitle => 'Perfil';
|
|
|
|
@override
|
|
String get edit => 'Editar';
|
|
|
|
@override
|
|
String get bodyParams => 'PARÂMETROS CORPORAIS';
|
|
|
|
@override
|
|
String get goalActivity => 'OBJETIVO & ATIVIDADE';
|
|
|
|
@override
|
|
String get nutrition => 'NUTRIÇÃO';
|
|
|
|
@override
|
|
String get settings => 'CONFIGURAÇÕES';
|
|
|
|
@override
|
|
String get height => 'Altura';
|
|
|
|
@override
|
|
String get weight => 'Peso';
|
|
|
|
@override
|
|
String get age => 'Idade';
|
|
|
|
@override
|
|
String get gender => 'Gênero';
|
|
|
|
@override
|
|
String get genderMale => 'Masculino';
|
|
|
|
@override
|
|
String get genderFemale => 'Feminino';
|
|
|
|
@override
|
|
String get goalLoss => 'Perda de peso';
|
|
|
|
@override
|
|
String get goalMaintain => 'Manutenção';
|
|
|
|
@override
|
|
String get goalGain => 'Ganho muscular';
|
|
|
|
@override
|
|
String get activityLow => 'Baixa';
|
|
|
|
@override
|
|
String get activityMedium => 'Média';
|
|
|
|
@override
|
|
String get activityHigh => 'Alta';
|
|
|
|
@override
|
|
String get calorieGoal => 'Meta calórica';
|
|
|
|
@override
|
|
String get mealTypes => 'Tipos de refeição';
|
|
|
|
@override
|
|
String get formulaNote => 'Calculado com a fórmula de Mifflin-St Jeor';
|
|
|
|
@override
|
|
String get language => 'Idioma';
|
|
|
|
@override
|
|
String get notSet => 'Não definido';
|
|
|
|
@override
|
|
String get calorieHint =>
|
|
'Insira os parâmetros corporais para calcular a meta calórica';
|
|
|
|
@override
|
|
String get logout => 'Sair';
|
|
|
|
@override
|
|
String get editProfile => 'Editar perfil';
|
|
|
|
@override
|
|
String get cancel => 'Cancelar';
|
|
|
|
@override
|
|
String get save => 'Salvar';
|
|
|
|
@override
|
|
String get nameLabel => 'Nome';
|
|
|
|
@override
|
|
String get heightCm => 'Altura (cm)';
|
|
|
|
@override
|
|
String get weightKg => 'Peso (kg)';
|
|
|
|
@override
|
|
String get birthDate => 'Data de nascimento';
|
|
|
|
@override
|
|
String get nameRequired => 'Insira o nome';
|
|
|
|
@override
|
|
String get profileUpdated => 'Perfil atualizado';
|
|
|
|
@override
|
|
String get profileSaveFailed => 'Falha ao salvar';
|
|
|
|
@override
|
|
String get mealTypeBreakfast => 'Café da manhã';
|
|
|
|
@override
|
|
String get mealTypeSecondBreakfast => 'Segundo café da manhã';
|
|
|
|
@override
|
|
String get mealTypeLunch => 'Almoço';
|
|
|
|
@override
|
|
String get mealTypeAfternoonSnack => 'Lanche da tarde';
|
|
|
|
@override
|
|
String get mealTypeDinner => 'Jantar';
|
|
|
|
@override
|
|
String get mealTypeSnack => 'Petisco';
|
|
|
|
@override
|
|
String get navHome => 'Início';
|
|
|
|
@override
|
|
String get navProducts => 'Produtos';
|
|
|
|
@override
|
|
String get navRecipes => 'Receitas';
|
|
|
|
@override
|
|
String get addFromReceiptOrPhoto => 'Adicionar de recibo ou foto';
|
|
|
|
@override
|
|
String get chooseMethod => 'Escolher método';
|
|
|
|
@override
|
|
String get photoReceipt => 'Fotografar recibo';
|
|
|
|
@override
|
|
String get photoReceiptSubtitle => 'Reconhecemos todos os produtos do recibo';
|
|
|
|
@override
|
|
String get photoProducts => 'Fotografar produtos';
|
|
|
|
@override
|
|
String get photoProductsSubtitle =>
|
|
'Geladeira, mesa, prateleira — até 3 fotos';
|
|
|
|
@override
|
|
String get addPackagedFood => 'Adicionar alimento embalado';
|
|
|
|
@override
|
|
String get scanBarcode => 'Escanear código de barras';
|
|
|
|
@override
|
|
String get portionWeightG => 'Peso da porção (g)';
|
|
|
|
@override
|
|
String get productNotFound => 'Produto não encontrado';
|
|
|
|
@override
|
|
String get enterManually => 'Inserir manualmente';
|
|
|
|
@override
|
|
String get perHundredG => 'por 100 g';
|
|
|
|
@override
|
|
String get searchFoodHint => 'Pesquisar produtos e pratos...';
|
|
|
|
@override
|
|
String get recentlyUsedLabel => 'Usados recentemente';
|
|
|
|
@override
|
|
String get productsSection => 'Produtos';
|
|
|
|
@override
|
|
String get dishesSection => 'Pratos';
|
|
|
|
@override
|
|
String noResultsForQuery(String query) {
|
|
return 'Nada encontrado para \"$query\"';
|
|
}
|
|
|
|
@override
|
|
String get servingsLabel => 'Porções';
|
|
|
|
@override
|
|
String get addToDiary => 'Adicionar ao diário';
|
|
|
|
@override
|
|
String get scanDishPhoto => 'Escanear foto';
|
|
|
|
@override
|
|
String planningForDate(String date) {
|
|
return '';
|
|
}
|
|
|
|
@override
|
|
String get markAsEaten => 'Marcar como comido';
|
|
|
|
@override
|
|
String get plannedMealLabel => 'Planejado';
|
|
|
|
@override
|
|
String get generateWeekLabel => 'Planejar a semana';
|
|
|
|
@override
|
|
String get generateWeekSubtitle =>
|
|
'A IA criará um menu com café da manhã, almoço e jantar para a semana inteira';
|
|
|
|
@override
|
|
String get generatingMenu => 'Gerando menu...';
|
|
|
|
@override
|
|
String get dayPlannedLabel => 'Dia planejado';
|
|
|
|
@override
|
|
String get planMenuButton => 'Planejar refeições';
|
|
|
|
@override
|
|
String get planMenuTitle => 'O que planejar?';
|
|
|
|
@override
|
|
String get planOptionSingleMeal => 'Uma refeição';
|
|
|
|
@override
|
|
String get planOptionSingleMealDesc => 'Escolher dia e tipo de refeição';
|
|
|
|
@override
|
|
String get planOptionDay => 'Um dia';
|
|
|
|
@override
|
|
String get planOptionDayDesc => 'Todas as refeições de um dia';
|
|
|
|
@override
|
|
String get planOptionDays => 'Vários dias';
|
|
|
|
@override
|
|
String get planOptionDaysDesc => 'Personalizar período';
|
|
|
|
@override
|
|
String get planOptionWeek => 'Uma semana';
|
|
|
|
@override
|
|
String get planOptionWeekDesc => '7 dias de uma vez';
|
|
|
|
@override
|
|
String get planSelectDate => 'Selecionar data';
|
|
|
|
@override
|
|
String get planSelectMealType => 'Tipo de refeição';
|
|
|
|
@override
|
|
String get planSelectRange => 'Selecionar período';
|
|
|
|
@override
|
|
String get planGenerateButton => 'Planejar';
|
|
|
|
@override
|
|
String get planGenerating => 'Gerando plano…';
|
|
|
|
@override
|
|
String get planSuccess => 'Menu planejado!';
|
|
|
|
@override
|
|
String get planProductsTitle => 'Produtos para o menu';
|
|
|
|
@override
|
|
String get planProductsSubtitle =>
|
|
'A IA levará em conta os produtos selecionados ao gerar receitas';
|
|
|
|
@override
|
|
String get planProductsEmpty => 'Nenhum produto adicionado';
|
|
|
|
@override
|
|
String get planProductsEmptyMessage =>
|
|
'Adicione produtos que você tem em casa — a IA sugerirá receitas com o que você já tem';
|
|
|
|
@override
|
|
String get planProductsAddProducts => 'Adicionar produtos';
|
|
|
|
@override
|
|
String get planProductsContinue => 'Continuar';
|
|
|
|
@override
|
|
String get planProductsSkip => 'Pular seleção de produtos';
|
|
|
|
@override
|
|
String get planProductsSkipNoProducts => 'Planejar sem produtos';
|
|
|
|
@override
|
|
String get planProductsSelectAll => 'Selecionar tudo';
|
|
|
|
@override
|
|
String get planProductsDeselectAll => 'Desmarcar tudo';
|
|
|
|
@override
|
|
String get recentScans => 'Scans recentes';
|
|
|
|
@override
|
|
String get seeAllScans => 'Ver tudo';
|
|
|
|
@override
|
|
String get productJobHistoryTitle => 'Histórico de scans';
|
|
|
|
@override
|
|
String get jobTypeReceipt => 'Recibo';
|
|
|
|
@override
|
|
String get jobTypeProducts => 'Produtos';
|
|
|
|
@override
|
|
String get scanSubmitting => 'Enviando...';
|
|
|
|
@override
|
|
String get processingProducts => 'Processando...';
|
|
}
|