mirror of
https://github.com/Memo-2023/mana-monorepo.git
synced 2026-05-14 20:41:09 +02:00
i18n(food/home): translate /food +page.svelte via $_() — header, progress cards, today's meals, links
Adds food.home sub-namespace covering page title, "Heute" heading + locale-
aware date subtitle, Verlauf/Mahlzeit actions, today's meals section, "{n}
Einträge" counter, empty state (no-meals + hint + add action), inline macro
labels ({n}g Protein/Carbs/Fett), Ziele/Verlauf footer links. Reuses
food.nutrition.* for the 4 progress-card labels.
Baselines: hardcoded 994 → 985 (7 cleared from food + 2 added by parallel
CommunitySection commit = net 9); missing-keys baseline unchanged.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
1b30c36553
commit
f92d6475f7
7 changed files with 121 additions and 21 deletions
|
|
@ -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",
|
||||
|
|
|
|||
|
|
@ -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",
|
||||
|
|
|
|||
|
|
@ -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",
|
||||
|
|
|
|||
|
|
@ -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",
|
||||
|
|
|
|||
|
|
@ -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",
|
||||
|
|
|
|||
|
|
@ -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 @@
|
|||
</script>
|
||||
|
||||
<svelte:head>
|
||||
<title>Food - Mana</title>
|
||||
<title>{$_('food.home.page_title_html')}</title>
|
||||
</svelte:head>
|
||||
|
||||
<RoutePage appId="food">
|
||||
|
|
@ -48,9 +50,11 @@
|
|||
<!-- Header -->
|
||||
<div class="flex items-center justify-between">
|
||||
<div>
|
||||
<h1 class="text-2xl font-bold text-[hsl(var(--color-foreground))]">Heute</h1>
|
||||
<h1 class="text-2xl font-bold text-[hsl(var(--color-foreground))]">
|
||||
{$_('food.home.heading_today')}
|
||||
</h1>
|
||||
<p class="text-sm text-[hsl(var(--color-muted-foreground))]">
|
||||
{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')}
|
||||
</a>
|
||||
<a
|
||||
href="/food/add"
|
||||
class="flex items-center gap-2 rounded-lg bg-[hsl(var(--color-primary))] px-4 py-2 text-sm font-medium text-[hsl(var(--color-primary-foreground))] transition-colors hover:opacity-90"
|
||||
>
|
||||
<Plus size={16} />
|
||||
Mahlzeit
|
||||
{$_('food.home.action_meal')}
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -85,7 +89,8 @@
|
|||
class="h-2 w-2 rounded-full"
|
||||
style="background-color: {NUTRIENT_INFO.calories.color}"
|
||||
></div>
|
||||
<span class="text-xs font-medium text-[hsl(var(--color-muted-foreground))]">Kalorien</span
|
||||
<span class="text-xs font-medium text-[hsl(var(--color-muted-foreground))]"
|
||||
>{$_('food.nutrition.calories')}</span
|
||||
>
|
||||
</div>
|
||||
<p class="mt-2 text-2xl font-bold text-[hsl(var(--color-foreground))]">
|
||||
|
|
@ -113,7 +118,9 @@
|
|||
class="h-2 w-2 rounded-full"
|
||||
style="background-color: {NUTRIENT_INFO.protein.color}"
|
||||
></div>
|
||||
<span class="text-xs font-medium text-[hsl(var(--color-muted-foreground))]">Protein</span>
|
||||
<span class="text-xs font-medium text-[hsl(var(--color-muted-foreground))]"
|
||||
>{$_('food.nutrition.protein')}</span
|
||||
>
|
||||
</div>
|
||||
<p class="mt-2 text-2xl font-bold text-[hsl(var(--color-foreground))]">
|
||||
{progress.protein.current}g
|
||||
|
|
@ -141,7 +148,7 @@
|
|||
style="background-color: {NUTRIENT_INFO.carbohydrates.color}"
|
||||
></div>
|
||||
<span class="text-xs font-medium text-[hsl(var(--color-muted-foreground))]"
|
||||
>Kohlenhydrate</span
|
||||
>{$_('food.nutrition.carbs')}</span
|
||||
>
|
||||
</div>
|
||||
<p class="mt-2 text-2xl font-bold text-[hsl(var(--color-foreground))]">
|
||||
|
|
@ -169,7 +176,9 @@
|
|||
class="h-2 w-2 rounded-full"
|
||||
style="background-color: {NUTRIENT_INFO.fat.color}"
|
||||
></div>
|
||||
<span class="text-xs font-medium text-[hsl(var(--color-muted-foreground))]">Fett</span>
|
||||
<span class="text-xs font-medium text-[hsl(var(--color-muted-foreground))]"
|
||||
>{$_('food.nutrition.fat')}</span
|
||||
>
|
||||
</div>
|
||||
<p class="mt-2 text-2xl font-bold text-[hsl(var(--color-foreground))]">
|
||||
{progress.fat.current}g
|
||||
|
|
@ -192,10 +201,10 @@
|
|||
<div>
|
||||
<div class="mb-3 flex items-center justify-between">
|
||||
<h2 class="text-lg font-semibold text-[hsl(var(--color-foreground))]">
|
||||
Heutige Mahlzeiten
|
||||
{$_('food.home.section_today_meals')}
|
||||
</h2>
|
||||
<span class="text-sm text-[hsl(var(--color-muted-foreground))]">
|
||||
{todaysMeals.length} Eintraege
|
||||
{$_('food.home.entries_count', { values: { n: todaysMeals.length } })}
|
||||
</span>
|
||||
</div>
|
||||
|
||||
|
|
@ -205,16 +214,16 @@
|
|||
>
|
||||
<span class="mb-4 text-5xl">🍽️</span>
|
||||
<h3 class="mb-2 text-lg font-semibold text-[hsl(var(--color-foreground))]">
|
||||
Noch keine Mahlzeiten
|
||||
{$_('food.home.empty_no_meals')}
|
||||
</h3>
|
||||
<p class="mb-4 text-sm text-[hsl(var(--color-muted-foreground))]">
|
||||
Trage deine erste Mahlzeit ein.
|
||||
{$_('food.home.empty_hint')}
|
||||
</p>
|
||||
<a
|
||||
href="/food/add"
|
||||
class="rounded-lg bg-[hsl(var(--color-primary))] px-6 py-2.5 text-sm font-medium text-[hsl(var(--color-primary-foreground))]"
|
||||
>
|
||||
Mahlzeit hinzufuegen
|
||||
{$_('food.home.action_add_meal')}
|
||||
</a>
|
||||
</div>
|
||||
{:else}
|
||||
|
|
@ -256,9 +265,21 @@
|
|||
class="mt-2 flex flex-wrap gap-3 text-xs text-[hsl(var(--color-muted-foreground))]"
|
||||
>
|
||||
<span>{meal.nutrition.calories} kcal</span>
|
||||
<span>{meal.nutrition.protein}g Protein</span>
|
||||
<span>{meal.nutrition.carbohydrates}g Carbs</span>
|
||||
<span>{meal.nutrition.fat}g Fett</span>
|
||||
<span
|
||||
>{$_('food.home.macro_protein', {
|
||||
values: { n: meal.nutrition.protein },
|
||||
})}</span
|
||||
>
|
||||
<span
|
||||
>{$_('food.home.macro_carbs', {
|
||||
values: { n: meal.nutrition.carbohydrates },
|
||||
})}</span
|
||||
>
|
||||
<span
|
||||
>{$_('food.home.macro_fat', {
|
||||
values: { n: meal.nutrition.fat },
|
||||
})}</span
|
||||
>
|
||||
</div>
|
||||
{/if}
|
||||
</div>
|
||||
|
|
@ -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)]"
|
||||
>
|
||||
<span class="text-2xl">🎯</span>
|
||||
<p class="mt-1 text-sm font-medium text-[hsl(var(--color-foreground))]">Ziele</p>
|
||||
<p class="mt-1 text-sm font-medium text-[hsl(var(--color-foreground))]">
|
||||
{$_('food.home.link_goals')}
|
||||
</p>
|
||||
</a>
|
||||
<a
|
||||
href="/food/history"
|
||||
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)]"
|
||||
>
|
||||
<span class="text-2xl">📊</span>
|
||||
<p class="mt-1 text-sm font-medium text-[hsl(var(--color-foreground))]">Verlauf</p>
|
||||
<p class="mt-1 text-sm font-medium text-[hsl(var(--color-foreground))]">
|
||||
{$_('food.home.action_history')}
|
||||
</p>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -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,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue