diff --git a/apps/mana/apps/web/src/lib/i18n/locales/food/de.json b/apps/mana/apps/web/src/lib/i18n/locales/food/de.json index 5a4588544..f460b6609 100644 --- a/apps/mana/apps/web/src/lib/i18n/locales/food/de.json +++ b/apps/mana/apps/web/src/lib/i18n/locales/food/de.json @@ -81,6 +81,21 @@ "goalsSaved": "Ziele gespeichert", "favoriteAdded": "Zu Favoriten hinzugefügt" }, + "home": { + "page_title_html": "Food - Mana", + "heading_today": "Heute", + "action_history": "Verlauf", + "action_meal": "Mahlzeit", + "section_today_meals": "Heutige Mahlzeiten", + "entries_count": "{n} Einträge", + "empty_no_meals": "Noch keine Mahlzeiten", + "empty_hint": "Trage deine erste Mahlzeit ein.", + "action_add_meal": "Mahlzeit hinzufügen", + "macro_protein": "{n}g Protein", + "macro_carbs": "{n}g Carbs", + "macro_fat": "{n}g Fett", + "link_goals": "Ziele" + }, "detail": { "page_title_html": "{description} - Food - Mana", "untitled_fallback": "Mahlzeit", diff --git a/apps/mana/apps/web/src/lib/i18n/locales/food/en.json b/apps/mana/apps/web/src/lib/i18n/locales/food/en.json index 46f9986f5..e1ef2d3f0 100644 --- a/apps/mana/apps/web/src/lib/i18n/locales/food/en.json +++ b/apps/mana/apps/web/src/lib/i18n/locales/food/en.json @@ -81,6 +81,21 @@ "goalsSaved": "Goals saved", "favoriteAdded": "Added to favorites" }, + "home": { + "page_title_html": "Food - Mana", + "heading_today": "Today", + "action_history": "History", + "action_meal": "Meal", + "section_today_meals": "Today's meals", + "entries_count": "{n} entries", + "empty_no_meals": "No meals yet", + "empty_hint": "Log your first meal.", + "action_add_meal": "Add meal", + "macro_protein": "{n}g protein", + "macro_carbs": "{n}g carbs", + "macro_fat": "{n}g fat", + "link_goals": "Goals" + }, "detail": { "page_title_html": "{description} - Food - Mana", "untitled_fallback": "Meal", diff --git a/apps/mana/apps/web/src/lib/i18n/locales/food/es.json b/apps/mana/apps/web/src/lib/i18n/locales/food/es.json index df1740a3b..6acba25b1 100644 --- a/apps/mana/apps/web/src/lib/i18n/locales/food/es.json +++ b/apps/mana/apps/web/src/lib/i18n/locales/food/es.json @@ -81,6 +81,21 @@ "goalsSaved": "Objetivos guardados", "favoriteAdded": "Añadido a favoritos" }, + "home": { + "page_title_html": "Food - Mana", + "heading_today": "Hoy", + "action_history": "Historial", + "action_meal": "Comida", + "section_today_meals": "Comidas de hoy", + "entries_count": "{n} entradas", + "empty_no_meals": "Sin comidas", + "empty_hint": "Registra tu primera comida.", + "action_add_meal": "Añadir comida", + "macro_protein": "{n}g proteína", + "macro_carbs": "{n}g carbs", + "macro_fat": "{n}g grasa", + "link_goals": "Objetivos" + }, "detail": { "page_title_html": "{description} - Food - Mana", "untitled_fallback": "Comida", diff --git a/apps/mana/apps/web/src/lib/i18n/locales/food/fr.json b/apps/mana/apps/web/src/lib/i18n/locales/food/fr.json index da06dd663..bd9989877 100644 --- a/apps/mana/apps/web/src/lib/i18n/locales/food/fr.json +++ b/apps/mana/apps/web/src/lib/i18n/locales/food/fr.json @@ -81,6 +81,21 @@ "goalsSaved": "Objectifs enregistrés", "favoriteAdded": "Ajouté aux favoris" }, + "home": { + "page_title_html": "Food - Mana", + "heading_today": "Aujourd'hui", + "action_history": "Historique", + "action_meal": "Repas", + "section_today_meals": "Repas du jour", + "entries_count": "{n} entrées", + "empty_no_meals": "Pas encore de repas", + "empty_hint": "Enregistre ton premier repas.", + "action_add_meal": "Ajouter un repas", + "macro_protein": "{n}g protéines", + "macro_carbs": "{n}g glucides", + "macro_fat": "{n}g lipides", + "link_goals": "Objectifs" + }, "detail": { "page_title_html": "{description} - Food - Mana", "untitled_fallback": "Repas", diff --git a/apps/mana/apps/web/src/lib/i18n/locales/food/it.json b/apps/mana/apps/web/src/lib/i18n/locales/food/it.json index d11c603fc..94b745f7f 100644 --- a/apps/mana/apps/web/src/lib/i18n/locales/food/it.json +++ b/apps/mana/apps/web/src/lib/i18n/locales/food/it.json @@ -81,6 +81,21 @@ "goalsSaved": "Obiettivi salvati", "favoriteAdded": "Aggiunto ai preferiti" }, + "home": { + "page_title_html": "Food - Mana", + "heading_today": "Oggi", + "action_history": "Storico", + "action_meal": "Pasto", + "section_today_meals": "Pasti di oggi", + "entries_count": "{n} voci", + "empty_no_meals": "Nessun pasto", + "empty_hint": "Registra il tuo primo pasto.", + "action_add_meal": "Aggiungi pasto", + "macro_protein": "{n}g proteine", + "macro_carbs": "{n}g carboidrati", + "macro_fat": "{n}g grassi", + "link_goals": "Obiettivi" + }, "detail": { "page_title_html": "{description} - Food - Mana", "untitled_fallback": "Pasto", diff --git a/apps/mana/apps/web/src/routes/(app)/food/+page.svelte b/apps/mana/apps/web/src/routes/(app)/food/+page.svelte index f1f1f9256..766279ee2 100644 --- a/apps/mana/apps/web/src/routes/(app)/food/+page.svelte +++ b/apps/mana/apps/web/src/routes/(app)/food/+page.svelte @@ -9,6 +9,8 @@ import type { MealWithNutrition, NutritionProgress } from '$lib/modules/food/types'; import { Plus, Clock, Fire } from '@mana/shared-icons'; import { RoutePage } from '$lib/components/shell'; + import { _, locale } from 'svelte-i18n'; + import { get } from 'svelte/store'; const allMeals = useAllMeals(); const allGoals = useAllGoals(); @@ -25,7 +27,7 @@ } function formatTime(dateString: string): string { - return new Date(dateString).toLocaleTimeString('de-DE', { + return new Date(dateString).toLocaleTimeString(get(locale) ?? 'de', { hour: '2-digit', minute: '2-digit', }); @@ -40,7 +42,7 @@ - Food - Mana + {$_('food.home.page_title_html')} @@ -48,9 +50,11 @@
-

Heute

+

+ {$_('food.home.heading_today')} +

- {new Date().toLocaleDateString('de-DE', { + {new Date().toLocaleDateString(get(locale) ?? 'de', { weekday: 'long', day: 'numeric', month: 'long', @@ -62,14 +66,14 @@ href="/food/history" class="rounded-lg border border-[hsl(var(--color-border))] px-4 py-2 text-sm font-medium text-[hsl(var(--color-foreground))] transition-colors hover:bg-[hsl(var(--color-muted))]" > - Verlauf + {$_('food.home.action_history')} - Mahlzeit + {$_('food.home.action_meal')}

@@ -85,7 +89,8 @@ class="h-2 w-2 rounded-full" style="background-color: {NUTRIENT_INFO.calories.color}" > - Kalorien{$_('food.nutrition.calories')}

@@ -113,7 +118,9 @@ class="h-2 w-2 rounded-full" style="background-color: {NUTRIENT_INFO.protein.color}" > - Protein + {$_('food.nutrition.protein')}

{progress.protein.current}g @@ -141,7 +148,7 @@ style="background-color: {NUTRIENT_INFO.carbohydrates.color}" > Kohlenhydrate{$_('food.nutrition.carbs')}

@@ -169,7 +176,9 @@ class="h-2 w-2 rounded-full" style="background-color: {NUTRIENT_INFO.fat.color}" > - Fett + {$_('food.nutrition.fat')}

{progress.fat.current}g @@ -192,10 +201,10 @@

- Heutige Mahlzeiten + {$_('food.home.section_today_meals')}

- {todaysMeals.length} Eintraege + {$_('food.home.entries_count', { values: { n: todaysMeals.length } })}
@@ -205,16 +214,16 @@ > 🍽️

- Noch keine Mahlzeiten + {$_('food.home.empty_no_meals')}

- Trage deine erste Mahlzeit ein. + {$_('food.home.empty_hint')}

- Mahlzeit hinzufuegen + {$_('food.home.action_add_meal')}
{:else} @@ -256,9 +265,21 @@ class="mt-2 flex flex-wrap gap-3 text-xs text-[hsl(var(--color-muted-foreground))]" > {meal.nutrition.calories} kcal - {meal.nutrition.protein}g Protein - {meal.nutrition.carbohydrates}g Carbs - {meal.nutrition.fat}g Fett + {$_('food.home.macro_protein', { + values: { n: meal.nutrition.protein }, + })} + {$_('food.home.macro_carbs', { + values: { n: meal.nutrition.carbohydrates }, + })} + {$_('food.home.macro_fat', { + values: { n: meal.nutrition.fat }, + })} {/if} @@ -285,14 +306,18 @@ class="flex-1 rounded-xl border border-[hsl(var(--color-border))] bg-[hsl(var(--color-card))] p-4 text-center transition-colors hover:border-[hsl(var(--color-primary)/0.3)]" > 🎯 -

Ziele

+

+ {$_('food.home.link_goals')} +

📊 -

Verlauf

+

+ {$_('food.home.action_history')} +

diff --git a/scripts/i18n-hardcoded-baseline.json b/scripts/i18n-hardcoded-baseline.json index a850de1ec..f1de54daa 100644 --- a/scripts/i18n-hardcoded-baseline.json +++ b/scripts/i18n-hardcoded-baseline.json @@ -29,6 +29,7 @@ "apps/mana/apps/web/src/lib/components/profile/ChangePasswordModal.svelte": 2, "apps/mana/apps/web/src/lib/components/profile/DeleteAccountModal.svelte": 5, "apps/mana/apps/web/src/lib/components/profile/EditProfileModal.svelte": 3, + "apps/mana/apps/web/src/lib/components/settings/sections/CommunitySection.svelte": 2, "apps/mana/apps/web/src/lib/components/settings/sections/VaultSection.svelte": 2, "apps/mana/apps/web/src/lib/components/shell/ModuleShell.svelte": 3, "apps/mana/apps/web/src/lib/components/SuggestionToast.svelte": 1, @@ -226,7 +227,6 @@ "apps/mana/apps/web/src/routes/(app)/context/documents/+page.svelte": 5, "apps/mana/apps/web/src/routes/(app)/context/spaces/[id]/+page.svelte": 3, "apps/mana/apps/web/src/routes/(app)/context/spaces/+page.svelte": 5, - "apps/mana/apps/web/src/routes/(app)/food/+page.svelte": 7, "apps/mana/apps/web/src/routes/(app)/food/add/+page.svelte": 2, "apps/mana/apps/web/src/routes/(app)/food/goals/+page.svelte": 1, "apps/mana/apps/web/src/routes/(app)/gifts/redeem/+page.svelte": 1,