Redesign anti-waste section: report card with grade, comparison vs national avg, savings badges and trend chart
- Replace simple bar chart with full Anti-Waste Report Card - Grade system (A+ to D) based on user's waste rate - Dual comparison bars: user waste rate vs national average (IT/DE/US) - Estimated monthly savings in money, meals saved, CO2 avoided - 3-month trend mini chart with colour-coded bars - Backend: getStats() now returns 3×30d buckets (used_30d, used_prev_30d, used_prev_60d, etc.) - Real-world benchmarks: IT 22%/5.4kg/mo (REDUCE), DE 20%/6.5kg/mo (Eurostat), US 30%/9.2kg/mo (USDA) - All labels fully i18n: 18 new antiwaste.* keys in it/en/de translation files - Section is fully JS-rendered; HTML now just an empty container
This commit is contained in:
@@ -675,6 +675,26 @@
|
||||
"appliance_added": "Elettrodomestico aggiunto",
|
||||
"item_added": "{name} aggiunto"
|
||||
},
|
||||
"antiwaste": {
|
||||
"title": "🌱 Anti-Waste Report",
|
||||
"grade_label": "Voto",
|
||||
"you": "Tu",
|
||||
"avg_label": "Media",
|
||||
"better": "🎉 Sprechi il {diff}% in meno della {country}!",
|
||||
"worse": "⚠️ Sprechi più della media {country}. Puoi migliorare!",
|
||||
"on_par": "→ Sei nella media {country}. Prova a fare ancora meglio!",
|
||||
"saved_money": "~{amount}/mese risparmiati",
|
||||
"saved_meals": "~{n} pasti salvati",
|
||||
"saved_co2": "{n} kg CO₂ evitata",
|
||||
"trend_title": "Andamento (ultimi 3 mesi)",
|
||||
"months_ago_2": "-60 gg",
|
||||
"months_ago_1": "-30 gg",
|
||||
"this_month": "Ora",
|
||||
"country_it": "media italiana",
|
||||
"country_de": "media tedesca",
|
||||
"country_en": "media USA",
|
||||
"source": "Fonti: REDUCE, Eurostat, USDA 2021"
|
||||
},
|
||||
"error": {
|
||||
"generic": "Errore",
|
||||
"network": "Errore di rete",
|
||||
|
||||
Reference in New Issue
Block a user