i18n(hem+nav) + fix(samtycke-layout): hem-fliken, nav-titlar, samtyckesrad bryter inte

- profile.tsx: samtyckesraden fick flex:1 på texten så längre språk (t.ex. spanska)
  inte trycker på/av-knappen ur läge (låg till vänster förut)
- home.tsx: Dina sparade recept, Skicka in eget recept, matlager-underrubrik,
  Allt/Öppna, platsnamn (Kyl/Frys/Skafferi...) -> t() (via typ, ej svenskt DB-namn)
- _layout.tsx: nav-titlar (Bläddra recept, Sparade recept, Matlager, Streckkod, Byt ut) -> t()
- 15 nya nycklar (home.*/nav.*) i alla 12 språk

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
Claude
2026-08-21 00:58:18 +00:00
parent 28c4d0db71
commit cadaa1a41f
15 changed files with 192 additions and 12 deletions
+5 -5
View File
@@ -127,28 +127,28 @@ export default function HomeScreen() {
</Row> </Row>
<Card onPress={() => router.push("/saved-recipes")}> <Card onPress={() => router.push("/saved-recipes")}>
<Body> Dina sparade recept</Body> <Body> {t("home.savedRecipes")}</Body>
</Card> </Card>
<Card onPress={() => router.push("/submit-recipe")}> <Card onPress={() => router.push("/submit-recipe")}>
<Body> Skicka in eget recept</Body> <Body> {t("home.submitRecipe")}</Body>
</Card> </Card>
{/* Matlager städat, öppnas per plats eller som helhet (spec §8). */} {/* Matlager städat, öppnas per plats eller som helhet (spec §8). */}
<Card> <Card>
<Heading>🧺 {t("home.inventory")}</Heading> <Heading>🧺 {t("home.inventory")}</Heading>
<Small>Allt du har hemma öppna en plats eller sök i hela lagret.</Small> <Small>{t("home.inventorySubtitle")}</Small>
<Row style={{ marginTop: spacing.xs }}> <Row style={{ marginTop: spacing.xs }}>
{locations.map((loc) => ( {locations.map((loc) => (
<Button <Button
key={loc.type} key={loc.type}
label={loc.name} label={LOCATION_ORDER.includes(loc.type) ? t(`home.location.${loc.type}`) : loc.name}
variant="ghost" variant="ghost"
onPress={() => router.push(`/kitchen?loc=${loc.type}`)} onPress={() => router.push(`/kitchen?loc=${loc.type}`)}
/> />
))} ))}
<Button <Button
label={locations.length ? "Allt" : "Öppna"} label={locations.length ? t("home.openAll") : t("home.open")}
variant="primary" variant="primary"
onPress={() => router.push("/kitchen")} onPress={() => router.push("/kitchen")}
/> />
+5 -5
View File
@@ -79,7 +79,7 @@ export default function RootLayout() {
options={{ title: "", presentation: "fullScreenModal" }} options={{ title: "", presentation: "fullScreenModal" }}
/> />
<Stack.Screen name="scan-review/[jobId]" options={{ title: t("scan.review.title"), fullScreenGestureEnabled: false }} /> <Stack.Screen name="scan-review/[jobId]" options={{ title: t("scan.review.title"), fullScreenGestureEnabled: false }} />
<Stack.Screen name="swap-meal/[entryId]" options={{ presentation: "modal", title: "Byt ut" }} /> <Stack.Screen name="swap-meal/[entryId]" options={{ presentation: "modal", title: t("nav.swap") }} />
<Stack.Screen name="meal-review/[jobId]" options={{ title: t("scan.meal.title"), fullScreenGestureEnabled: false }} /> <Stack.Screen name="meal-review/[jobId]" options={{ title: t("scan.meal.title"), fullScreenGestureEnabled: false }} />
<Stack.Screen name="reconciliation" options={{ title: t("reconciliation.title") }} /> <Stack.Screen name="reconciliation" options={{ title: t("reconciliation.title") }} />
<Stack.Screen name="scan-diff-review/[jobId]" options={{ title: t("scan.review.title"), fullScreenGestureEnabled: false }} /> <Stack.Screen name="scan-diff-review/[jobId]" options={{ title: t("scan.review.title"), fullScreenGestureEnabled: false }} />
@@ -87,9 +87,9 @@ export default function RootLayout() {
<Stack.Screen name="meal-boxes" options={{ title: t("mealbox.title"), presentation: "modal" }} /> <Stack.Screen name="meal-boxes" options={{ title: t("mealbox.title"), presentation: "modal" }} />
<Stack.Screen name="household" options={{ title: t("home.household"), presentation: "modal" }} /> <Stack.Screen name="household" options={{ title: t("home.household"), presentation: "modal" }} />
<Stack.Screen name="memory" options={{ title: t("memory.title") }} /> <Stack.Screen name="memory" options={{ title: t("memory.title") }} />
<Stack.Screen name="saved-recipes" options={{ title: "Sparade recept" }} /> <Stack.Screen name="saved-recipes" options={{ title: t("nav.savedRecipes") }} />
<Stack.Screen name="recipes" options={{ title: "Bläddra recept" }} /> <Stack.Screen name="recipes" options={{ title: t("nav.browseRecipes") }} />
<Stack.Screen name="kitchen" options={{ title: "Matlager" }} /> <Stack.Screen name="kitchen" options={{ title: t("nav.kitchen") }} />
<Stack.Screen name="profile" options={{ title: t("profile.title"), presentation: "modal" }} /> <Stack.Screen name="profile" options={{ title: t("profile.title"), presentation: "modal" }} />
<Stack.Screen <Stack.Screen
name="paywall" name="paywall"
@@ -99,7 +99,7 @@ export default function RootLayout() {
name="log-meal" name="log-meal"
options={{ title: t("myday.logMeal"), presentation: "modal" }} options={{ title: t("myday.logMeal"), presentation: "modal" }}
/> />
<Stack.Screen name="barcode" options={{ title: "Streckkod" }} /> <Stack.Screen name="barcode" options={{ title: t("nav.barcode") }} />
</Stack> </Stack>
</AnalyticsProvider> </AnalyticsProvider>
</PersistQueryClientProvider> </PersistQueryClientProvider>
+2 -2
View File
@@ -271,8 +271,8 @@ export default function ProfileScreen() {
{CONSENT_KINDS.map((kind) => { {CONSENT_KINDS.map((kind) => {
const granted = consentMap.get(kind) === "granted"; const granted = consentMap.get(kind) === "granted";
return ( return (
<Row key={kind} style={{ justifyContent: "space-between" }}> <Row key={kind} style={{ justifyContent: "space-between", alignItems: "center" }}>
<Small>{t(`profile.consent.${kind}`)}</Small> <Small style={{ flex: 1, marginRight: 12 }}>{t(`profile.consent.${kind}`)}</Small>
<Button <Button
label={granted ? t("common.on") : t("common.off")} label={granted ? t("common.on") : t("common.off")}
variant={granted ? "secondary" : "ghost"} variant={granted ? "secondary" : "ghost"}
+15
View File
@@ -96,6 +96,21 @@
"home.moreItems_other": "+ {count} flere …", "home.moreItems_other": "+ {count} flere …",
"home.pastBestBefore": "Bedst før er overskredet lugt og smag først", "home.pastBestBefore": "Bedst før er overskredet lugt og smag først",
"home.shopping": "Indkøbsliste", "home.shopping": "Indkøbsliste",
"home.savedRecipes": "Dine gemte opskrifter",
"home.submitRecipe": "Indsend din egen opskrift",
"home.inventorySubtitle": "Alt hvad du har hjemme åbn et sted eller søg i hele lageret.",
"home.openAll": "Alt",
"home.open": "Åbn",
"home.location.fridge": "Køleskab",
"home.location.freezer": "Fryser",
"home.location.pantry": "Spisekammer",
"home.location.garage_freezer": "Garagefryser",
"home.location.wine_fridge": "Vinkøleskab",
"nav.browseRecipes": "Gennemse opskrifter",
"nav.savedRecipes": "Gemte opskrifter",
"nav.kitchen": "Madlager",
"nav.barcode": "Stregkode",
"nav.swap": "Skift",
"home.thisWeek": "Denne uge", "home.thisWeek": "Denne uge",
"home.title": "Derhjemme", "home.title": "Derhjemme",
"home.useSoon": "Brug snart", "home.useSoon": "Brug snart",
+15
View File
@@ -96,6 +96,21 @@
"home.moreItems_other": "+ {count} weitere …", "home.moreItems_other": "+ {count} weitere …",
"home.pastBestBefore": "MHD überschritten erst riechen und probieren", "home.pastBestBefore": "MHD überschritten erst riechen und probieren",
"home.shopping": "Einkaufsliste", "home.shopping": "Einkaufsliste",
"home.savedRecipes": "Deine gespeicherten Rezepte",
"home.submitRecipe": "Eigenes Rezept einreichen",
"home.inventorySubtitle": "Alles, was du zu Hause hast öffne einen Ort oder durchsuche den ganzen Bestand.",
"home.openAll": "Alles",
"home.open": "Öffnen",
"home.location.fridge": "Kühlschrank",
"home.location.freezer": "Gefrierschrank",
"home.location.pantry": "Vorratskammer",
"home.location.garage_freezer": "Garagen-Gefrierschrank",
"home.location.wine_fridge": "Weinkühlschrank",
"nav.browseRecipes": "Rezepte durchsuchen",
"nav.savedRecipes": "Gespeicherte Rezepte",
"nav.kitchen": "Vorräte",
"nav.barcode": "Barcode",
"nav.swap": "Tauschen",
"home.thisWeek": "Diese Woche", "home.thisWeek": "Diese Woche",
"home.title": "Zuhause", "home.title": "Zuhause",
"home.useSoon": "Bald verbrauchen", "home.useSoon": "Bald verbrauchen",
+15
View File
@@ -96,6 +96,21 @@
"home.moreItems_other": "+ {count} more …", "home.moreItems_other": "+ {count} more …",
"home.pastBestBefore": "Past best before smell and taste first", "home.pastBestBefore": "Past best before smell and taste first",
"home.shopping": "Shopping list", "home.shopping": "Shopping list",
"home.savedRecipes": "Your saved recipes",
"home.submitRecipe": "Submit your own recipe",
"home.inventorySubtitle": "Everything you have at home open a place or search the whole stock.",
"home.openAll": "All",
"home.open": "Open",
"home.location.fridge": "Fridge",
"home.location.freezer": "Freezer",
"home.location.pantry": "Pantry",
"home.location.garage_freezer": "Garage freezer",
"home.location.wine_fridge": "Wine fridge",
"nav.browseRecipes": "Browse recipes",
"nav.savedRecipes": "Saved recipes",
"nav.kitchen": "Food storage",
"nav.barcode": "Barcode",
"nav.swap": "Swap",
"home.thisWeek": "This week", "home.thisWeek": "This week",
"home.title": "At home", "home.title": "At home",
"home.useSoon": "Use soon", "home.useSoon": "Use soon",
+15
View File
@@ -96,6 +96,21 @@
"home.moreItems_other": "+ {count} más …", "home.moreItems_other": "+ {count} más …",
"home.pastBestBefore": "Pasada la fecha preferente: huele y prueba primero", "home.pastBestBefore": "Pasada la fecha preferente: huele y prueba primero",
"home.shopping": "Lista de la compra", "home.shopping": "Lista de la compra",
"home.savedRecipes": "Tus recetas guardadas",
"home.submitRecipe": "Envía tu propia receta",
"home.inventorySubtitle": "Todo lo que tienes en casa: abre un lugar o busca en todo el inventario.",
"home.openAll": "Todo",
"home.open": "Abrir",
"home.location.fridge": "Nevera",
"home.location.freezer": "Congelador",
"home.location.pantry": "Despensa",
"home.location.garage_freezer": "Congelador del garaje",
"home.location.wine_fridge": "Vinoteca",
"nav.browseRecipes": "Explorar recetas",
"nav.savedRecipes": "Recetas guardadas",
"nav.kitchen": "Inventario",
"nav.barcode": "Código de barras",
"nav.swap": "Cambiar",
"home.thisWeek": "Esta semana", "home.thisWeek": "Esta semana",
"home.title": "En casa", "home.title": "En casa",
"home.useSoon": "Usar pronto", "home.useSoon": "Usar pronto",
+15
View File
@@ -96,6 +96,21 @@
"home.moreItems_other": "+ {count} lisää …", "home.moreItems_other": "+ {count} lisää …",
"home.pastBestBefore": "Parasta ennen ylitetty haista ja maista ensin", "home.pastBestBefore": "Parasta ennen ylitetty haista ja maista ensin",
"home.shopping": "Ostoslista", "home.shopping": "Ostoslista",
"home.savedRecipes": "Tallennetut reseptisi",
"home.submitRecipe": "Lähetä oma resepti",
"home.inventorySubtitle": "Kaikki mitä sinulla on kotona avaa paikka tai hae koko varastosta.",
"home.openAll": "Kaikki",
"home.open": "Avaa",
"home.location.fridge": "Jääkaappi",
"home.location.freezer": "Pakastin",
"home.location.pantry": "Ruokakomero",
"home.location.garage_freezer": "Autotallin pakastin",
"home.location.wine_fridge": "Viinikaappi",
"nav.browseRecipes": "Selaa reseptejä",
"nav.savedRecipes": "Tallennetut reseptit",
"nav.kitchen": "Ruokavarasto",
"nav.barcode": "Viivakoodi",
"nav.swap": "Vaihda",
"home.thisWeek": "Tällä viikolla", "home.thisWeek": "Tällä viikolla",
"home.title": "Kotona", "home.title": "Kotona",
"home.useSoon": "Käytä pian", "home.useSoon": "Käytä pian",
+15
View File
@@ -96,6 +96,21 @@
"home.moreItems_other": "+ {count} autres …", "home.moreItems_other": "+ {count} autres …",
"home.pastBestBefore": "DLUO dépassée : sentez et goûtez d'abord", "home.pastBestBefore": "DLUO dépassée : sentez et goûtez d'abord",
"home.shopping": "Liste de courses", "home.shopping": "Liste de courses",
"home.savedRecipes": "Vos recettes enregistrées",
"home.submitRecipe": "Proposer votre recette",
"home.inventorySubtitle": "Tout ce que vous avez chez vous ouvrez un endroit ou cherchez dans tout le stock.",
"home.openAll": "Tout",
"home.open": "Ouvrir",
"home.location.fridge": "Réfrigérateur",
"home.location.freezer": "Congélateur",
"home.location.pantry": "Garde-manger",
"home.location.garage_freezer": "Congélateur du garage",
"home.location.wine_fridge": "Cave à vin",
"nav.browseRecipes": "Parcourir les recettes",
"nav.savedRecipes": "Recettes enregistrées",
"nav.kitchen": "Stock",
"nav.barcode": "Code-barres",
"nav.swap": "Remplacer",
"home.thisWeek": "Cette semaine", "home.thisWeek": "Cette semaine",
"home.title": "À la maison", "home.title": "À la maison",
"home.useSoon": "À consommer vite", "home.useSoon": "À consommer vite",
+15
View File
@@ -96,6 +96,21 @@
"home.moreItems_other": "+ {count} altri …", "home.moreItems_other": "+ {count} altri …",
"home.pastBestBefore": "Oltre il termine minimo: annusa e assaggia prima", "home.pastBestBefore": "Oltre il termine minimo: annusa e assaggia prima",
"home.shopping": "Lista della spesa", "home.shopping": "Lista della spesa",
"home.savedRecipes": "Le tue ricette salvate",
"home.submitRecipe": "Invia la tua ricetta",
"home.inventorySubtitle": "Tutto ciò che hai in casa: apri un posto o cerca in tutta la dispensa.",
"home.openAll": "Tutto",
"home.open": "Apri",
"home.location.fridge": "Frigorifero",
"home.location.freezer": "Congelatore",
"home.location.pantry": "Dispensa",
"home.location.garage_freezer": "Congelatore del garage",
"home.location.wine_fridge": "Cantinetta",
"nav.browseRecipes": "Sfoglia le ricette",
"nav.savedRecipes": "Ricette salvate",
"nav.kitchen": "Scorte",
"nav.barcode": "Codice a barre",
"nav.swap": "Cambia",
"home.thisWeek": "Questa settimana", "home.thisWeek": "Questa settimana",
"home.title": "A casa", "home.title": "A casa",
"home.useSoon": "Da consumare presto", "home.useSoon": "Da consumare presto",
+15
View File
@@ -96,6 +96,21 @@
"home.moreItems_other": "+ {count} til …", "home.moreItems_other": "+ {count} til …",
"home.pastBestBefore": "Best før er passert lukt og smak først", "home.pastBestBefore": "Best før er passert lukt og smak først",
"home.shopping": "Handleliste", "home.shopping": "Handleliste",
"home.savedRecipes": "Dine lagrede oppskrifter",
"home.submitRecipe": "Send inn egen oppskrift",
"home.inventorySubtitle": "Alt du har hjemme åpne et sted eller søk i hele lageret.",
"home.openAll": "Alt",
"home.open": "Åpne",
"home.location.fridge": "Kjøleskap",
"home.location.freezer": "Fryser",
"home.location.pantry": "Spiskammer",
"home.location.garage_freezer": "Garasjefryser",
"home.location.wine_fridge": "Vinkjøleskap",
"nav.browseRecipes": "Bla i oppskrifter",
"nav.savedRecipes": "Lagrede oppskrifter",
"nav.kitchen": "Matlager",
"nav.barcode": "Strekkode",
"nav.swap": "Bytt",
"home.thisWeek": "Denne uken", "home.thisWeek": "Denne uken",
"home.title": "Hjemme", "home.title": "Hjemme",
"home.useSoon": "Bruk snart", "home.useSoon": "Bruk snart",
+15
View File
@@ -96,6 +96,21 @@
"home.moreItems_other": "+ nog {count} …", "home.moreItems_other": "+ nog {count} …",
"home.pastBestBefore": "THT verstreken eerst ruiken en proeven", "home.pastBestBefore": "THT verstreken eerst ruiken en proeven",
"home.shopping": "Boodschappenlijst", "home.shopping": "Boodschappenlijst",
"home.savedRecipes": "Je opgeslagen recepten",
"home.submitRecipe": "Eigen recept insturen",
"home.inventorySubtitle": "Alles wat je in huis hebt open een plek of zoek in de hele voorraad.",
"home.openAll": "Alles",
"home.open": "Openen",
"home.location.fridge": "Koelkast",
"home.location.freezer": "Vriezer",
"home.location.pantry": "Voorraadkast",
"home.location.garage_freezer": "Garagevriezer",
"home.location.wine_fridge": "Wijnkoelkast",
"nav.browseRecipes": "Recepten bladeren",
"nav.savedRecipes": "Opgeslagen recepten",
"nav.kitchen": "Voorraad",
"nav.barcode": "Streepjescode",
"nav.swap": "Vervangen",
"home.thisWeek": "Deze week", "home.thisWeek": "Deze week",
"home.title": "Thuis", "home.title": "Thuis",
"home.useSoon": "Snel gebruiken", "home.useSoon": "Snel gebruiken",
+15
View File
@@ -100,6 +100,21 @@
"home.moreItems_other": "+ jeszcze {count} …", "home.moreItems_other": "+ jeszcze {count} …",
"home.pastBestBefore": "Po terminie przydatności najpierw powąchaj i spróbuj", "home.pastBestBefore": "Po terminie przydatności najpierw powąchaj i spróbuj",
"home.shopping": "Lista zakupów", "home.shopping": "Lista zakupów",
"home.savedRecipes": "Twoje zapisane przepisy",
"home.submitRecipe": "Prześlij własny przepis",
"home.inventorySubtitle": "Wszystko, co masz w domu otwórz miejsce lub przeszukaj cały zapas.",
"home.openAll": "Wszystko",
"home.open": "Otwórz",
"home.location.fridge": "Lodówka",
"home.location.freezer": "Zamrażarka",
"home.location.pantry": "Spiżarnia",
"home.location.garage_freezer": "Zamrażarka w garażu",
"home.location.wine_fridge": "Lodówka na wino",
"nav.browseRecipes": "Przeglądaj przepisy",
"nav.savedRecipes": "Zapisane przepisy",
"nav.kitchen": "Zapasy",
"nav.barcode": "Kod kreskowy",
"nav.swap": "Zmień",
"home.thisWeek": "W tym tygodniu", "home.thisWeek": "W tym tygodniu",
"home.title": "W domu", "home.title": "W domu",
"home.useSoon": "Zużyj wkrótce", "home.useSoon": "Zużyj wkrótce",
+15
View File
@@ -96,6 +96,21 @@
"home.moreItems_other": "+ mais {count} …", "home.moreItems_other": "+ mais {count} …",
"home.pastBestBefore": "Validade ultrapassada cheire e prove primeiro", "home.pastBestBefore": "Validade ultrapassada cheire e prove primeiro",
"home.shopping": "Lista de compras", "home.shopping": "Lista de compras",
"home.savedRecipes": "As tuas receitas guardadas",
"home.submitRecipe": "Envia a tua própria receita",
"home.inventorySubtitle": "Tudo o que tens em casa abre um local ou pesquisa em todo o stock.",
"home.openAll": "Tudo",
"home.open": "Abrir",
"home.location.fridge": "Frigorífico",
"home.location.freezer": "Congelador",
"home.location.pantry": "Despensa",
"home.location.garage_freezer": "Congelador da garagem",
"home.location.wine_fridge": "Garrafeira",
"nav.browseRecipes": "Explorar receitas",
"nav.savedRecipes": "Receitas guardadas",
"nav.kitchen": "Stock",
"nav.barcode": "Código de barras",
"nav.swap": "Trocar",
"home.thisWeek": "Esta semana", "home.thisWeek": "Esta semana",
"home.title": "Em casa", "home.title": "Em casa",
"home.useSoon": "Usar em breve", "home.useSoon": "Usar em breve",
+15
View File
@@ -96,6 +96,21 @@
"home.moreItems_other": "+ {count} till …", "home.moreItems_other": "+ {count} till …",
"home.pastBestBefore": "Passerat bäst före lukta och smaka", "home.pastBestBefore": "Passerat bäst före lukta och smaka",
"home.shopping": "Inköpslista", "home.shopping": "Inköpslista",
"home.savedRecipes": "Dina sparade recept",
"home.submitRecipe": "Skicka in eget recept",
"home.inventorySubtitle": "Allt du har hemma öppna en plats eller sök i hela lagret.",
"home.openAll": "Allt",
"home.open": "Öppna",
"home.location.fridge": "Kyl",
"home.location.freezer": "Frys",
"home.location.pantry": "Skafferi",
"home.location.garage_freezer": "Garagefrys",
"home.location.wine_fridge": "Vinkyl",
"nav.browseRecipes": "Bläddra recept",
"nav.savedRecipes": "Sparade recept",
"nav.kitchen": "Matlager",
"nav.barcode": "Streckkod",
"nav.swap": "Byt ut",
"home.thisWeek": "Denna vecka", "home.thisWeek": "Denna vecka",
"home.title": "Hemma", "home.title": "Hemma",
"home.completeProfile.title": "Gör appen smartare", "home.completeProfile.title": "Gör appen smartare",