feat(SW-184): added some translations

This commit is contained in:
Erik Tiekstra
2024-08-20 15:45:04 +02:00
parent b37cc7a34c
commit c6ad5eecc5
11 changed files with 31 additions and 15 deletions

View File

@@ -1,8 +1 @@
import { setLang } from "@/i18n/serverContext" export { default } from "../page"
import type { LangParams, PageArgs } from "@/types/params"
export default function EmptyHeaderPage({ params }: PageArgs<LangParams>) {
setLang(params.lang)
return null
}

View File

@@ -4,8 +4,6 @@ import { MenuProps } from "./menu"
import styles from "./menu.module.css" import styles from "./menu.module.css"
export default function Menu({ items }: MenuProps) { export default function Menu({ items }: MenuProps) {
function handleButtonClick() {}
return ( return (
<ul className={styles.menu}> <ul className={styles.menu}>
{items.map((item) => ( {items.map((item) => (

View File

@@ -3,6 +3,7 @@ import Link from "next/link"
import { serverClient } from "@/lib/trpc/server" import { serverClient } from "@/lib/trpc/server"
import Image from "@/components/Image" import Image from "@/components/Image"
import { getIntl } from "@/i18n"
import Menu from "./Menu" import Menu from "./Menu"
import MyPages from "./MyPages" import MyPages from "./MyPages"
@@ -31,6 +32,7 @@ export interface MenuItem {
} }
export default async function MainMenu() { export default async function MainMenu() {
const intl = await getIntl()
const myPagesNavigation = const myPagesNavigation =
await serverClient().contentstack.myPages.navigation.get() await serverClient().contentstack.myPages.navigation.get()
@@ -114,7 +116,7 @@ export default async function MainMenu() {
<nav className={styles.content}> <nav className={styles.content}>
<Link className={styles.logoLink} href="/"> <Link className={styles.logoLink} href="/">
<Image <Image
alt="Back to scandichotels.com" alt={intl.formatMessage({ id: "Back to scandichotels.com" })}
className={styles.logo} className={styles.logo}
data-js="scandiclogoimg" data-js="scandiclogoimg"
data-nosvgsrc="/_static/img/scandic-logotype.png" data-nosvgsrc="/_static/img/scandic-logotype.png"

View File

@@ -1,12 +1,18 @@
"use client"
import { useIntl } from "react-intl"
import { SearchIcon } from "@/components/Icons" import { SearchIcon } from "@/components/Icons"
import Button from "../Button" import Button from "../Button"
export default function Search() { export default function Search() {
const intl = useIntl()
return ( return (
<Button> <Button>
<SearchIcon width={20} height={20} color="burgundy" /> <SearchIcon width={20} height={20} color="burgundy" />
<span>Find Booking</span> {intl.formatMessage({ id: "Find booking" })}
</Button> </Button>
) )
} }

View File

@@ -2,6 +2,7 @@ import { serverClient } from "@/lib/trpc/server"
import { GiftIcon } from "@/components/Icons" import { GiftIcon } from "@/components/Icons"
import Link from "@/components/TempDesignSystem/Link" import Link from "@/components/TempDesignSystem/Link"
import { getIntl } from "@/i18n"
import LanguageSwitcher from "./LanguageSwitcher" import LanguageSwitcher from "./LanguageSwitcher"
import Search from "./Search" import Search from "./Search"
@@ -9,6 +10,7 @@ import Search from "./Search"
import styles from "./topMenu.module.css" import styles from "./topMenu.module.css"
export default async function TopMenu() { export default async function TopMenu() {
const intl = await getIntl()
const languages = await serverClient().contentstack.languageSwitcher.get() const languages = await serverClient().contentstack.languageSwitcher.get()
if (!languages) { if (!languages) {
@@ -20,7 +22,7 @@ export default async function TopMenu() {
<div className={styles.content}> <div className={styles.content}>
<Link variant="icon" color="burgundy" href="#" size="small"> <Link variant="icon" color="burgundy" href="#" size="small">
<GiftIcon width={20} height={20} color="burgundy" /> <GiftIcon width={20} height={20} color="burgundy" />
Join Scandic Friends {intl.formatMessage({ id: "Join Scandic Friends" })}
</Link> </Link>
<div className={styles.right}> <div className={styles.right}>
<LanguageSwitcher urls={languages.urls} /> <LanguageSwitcher urls={languages.urls} />

View File

@@ -15,6 +15,7 @@
"As our Close Friend": "Som vores nære ven", "As our Close Friend": "Som vores nære ven",
"At latest": "Senest", "At latest": "Senest",
"At the hotel": "På hotellet", "At the hotel": "På hotellet",
"Back to scandichotels.com": "Tilbage til scandichotels.com",
"Bed type": "Seng type", "Bed type": "Seng type",
"Book": "Book", "Book": "Book",
"Book reward night": "Book bonusnat", "Book reward night": "Book bonusnat",
@@ -64,6 +65,7 @@
"from your member profile?": "fra din medlemsprofil?", "from your member profile?": "fra din medlemsprofil?",
"Get inspired": "Bliv inspireret", "Get inspired": "Bliv inspireret",
"Go back to overview": "Gå tilbage til oversigten", "Go back to overview": "Gå tilbage til oversigten",
"Hi": "Hei",
"Highest level": "Højeste niveau", "Highest level": "Højeste niveau",
"Hotel facilities": "Hotel faciliteter", "Hotel facilities": "Hotel faciliteter",
"Hotel surroundings": "Hotel omgivelser", "Hotel surroundings": "Hotel omgivelser",
@@ -81,6 +83,7 @@
"Level 7": "Niveau 7", "Level 7": "Niveau 7",
"Level up to unlock": "Stig i niveau for at låse op", "Level up to unlock": "Stig i niveau for at låse op",
"Log in": "Log på", "Log in": "Log på",
"Log in/Join": "Log på/Tilmeld dig",
"Log in here": "Log ind her", "Log in here": "Log ind her",
"Log out": "Log ud", "Log out": "Log ud",
"Manage preferences": "Administrer præferencer", "Manage preferences": "Administrer præferencer",

View File

@@ -14,6 +14,7 @@
"As our Close Friend": "Als unser enger Freund", "As our Close Friend": "Als unser enger Freund",
"At latest": "Spätestens", "At latest": "Spätestens",
"At the hotel": "Im Hotel", "At the hotel": "Im Hotel",
"Back to scandichotels.com": "Zurück zu scandichotels.com",
"Bed type": "Bettentyp", "Bed type": "Bettentyp",
"Book": "Buchen", "Book": "Buchen",
"Book reward night": "Bonusnacht buchen", "Book reward night": "Bonusnacht buchen",
@@ -63,6 +64,7 @@
"from your member profile?": "wirklich aus Ihrem Mitgliedsprofil entfernen?", "from your member profile?": "wirklich aus Ihrem Mitgliedsprofil entfernen?",
"Get inspired": "Lassen Sie sich inspieren", "Get inspired": "Lassen Sie sich inspieren",
"Go back to overview": "Zurück zur Übersicht", "Go back to overview": "Zurück zur Übersicht",
"Hi": "Hallo",
"Highest level": "Höchstes Level", "Highest level": "Höchstes Level",
"Hotel facilities": "Hotel-Infos", "Hotel facilities": "Hotel-Infos",
"Hotel surroundings": "Umgebung des Hotels", "Hotel surroundings": "Umgebung des Hotels",
@@ -80,6 +82,7 @@
"Level 7": "Level 7", "Level 7": "Level 7",
"Level up to unlock": "Zum Freischalten aufsteigen", "Level up to unlock": "Zum Freischalten aufsteigen",
"Log in": "Anmeldung", "Log in": "Anmeldung",
"Log in/Join": "Log in/Anmelden",
"Log in here": "Hier einloggen", "Log in here": "Hier einloggen",
"Log out": "Ausloggen", "Log out": "Ausloggen",
"Manage preferences": "Verwalten von Voreinstellungen", "Manage preferences": "Verwalten von Voreinstellungen",

View File

@@ -15,6 +15,7 @@
"As our Close Friend": "As our Close Friend", "As our Close Friend": "As our Close Friend",
"At latest": "At latest", "At latest": "At latest",
"At the hotel": "At the hotel", "At the hotel": "At the hotel",
"Back to scandichotels.com": "Back to scandichotels.com",
"Bed type": "Bed type", "Bed type": "Bed type",
"Book": "Book", "Book": "Book",
"Book reward night": "Book reward night", "Book reward night": "Book reward night",
@@ -66,6 +67,7 @@
"from your member profile?": "from your member profile?", "from your member profile?": "from your member profile?",
"Get inspired": "Get inspired", "Get inspired": "Get inspired",
"Go back to overview": "Go back to overview", "Go back to overview": "Go back to overview",
"Hi": "Hi",
"Highest level": "Highest level", "Highest level": "Highest level",
"Hotel facilities": "Hotel facilities", "Hotel facilities": "Hotel facilities",
"Hotel surroundings": "Hotel surroundings", "Hotel surroundings": "Hotel surroundings",
@@ -84,7 +86,6 @@
"Level 5": "Level 5", "Level 5": "Level 5",
"Level 6": "Level 6", "Level 6": "Level 6",
"Level 7": "Level 7", "Level 7": "Level 7",
"Hi": "Hi",
"Level up to unlock": "Level up to unlock", "Level up to unlock": "Level up to unlock",
"Log in": "Log in", "Log in": "Log in",
"Log in/Join": "Log in/Join", "Log in/Join": "Log in/Join",

View File

@@ -15,6 +15,7 @@
"As our Close Friend": "Läheisenä ystävänämme", "As our Close Friend": "Läheisenä ystävänämme",
"At latest": "Viimeistään", "At latest": "Viimeistään",
"At the hotel": "Hotellissa", "At the hotel": "Hotellissa",
"Back to scandichotels.com": "Takaisin scandichotels.com",
"Bed type": "Vuodetyyppi", "Bed type": "Vuodetyyppi",
"Book": "Varaa", "Book": "Varaa",
"Book reward night": "Kirjapalkinto-ilta", "Book reward night": "Kirjapalkinto-ilta",
@@ -64,6 +65,7 @@
"from your member profile?": "jäsenprofiilistasi?", "from your member profile?": "jäsenprofiilistasi?",
"Get inspired": "Inspiroidu", "Get inspired": "Inspiroidu",
"Go back to overview": "Palaa yleiskatsaukseen", "Go back to overview": "Palaa yleiskatsaukseen",
"Hi": "Hi",
"Highest level": "Korkein taso", "Highest level": "Korkein taso",
"Hotel facilities": "Hotellin palvelut", "Hotel facilities": "Hotellin palvelut",
"Hotel surroundings": "Hotellin ympäristö", "Hotel surroundings": "Hotellin ympäristö",
@@ -79,8 +81,8 @@
"Level 5": "Taso 5", "Level 5": "Taso 5",
"Level 6": "Taso 6", "Level 6": "Taso 6",
"Level 7": "Taso 7", "Level 7": "Taso 7",
"Level up to unlock": "Nouse seuraavalle tasolle ja avaat seuraavan edun",
"Log in": "Kirjaudu sisään", "Log in": "Kirjaudu sisään",
"Log in/Join": "Kirjaudu sisään/Liittyä",
"Log in here": "Kirjaudu sisään", "Log in here": "Kirjaudu sisään",
"Log out": "Kirjaudu ulos", "Log out": "Kirjaudu ulos",
"Manage preferences": "Asetusten hallinta", "Manage preferences": "Asetusten hallinta",

View File

@@ -15,6 +15,7 @@
"As our Close Friend": "Som vår nære venn", "As our Close Friend": "Som vår nære venn",
"At latest": "Senest", "At latest": "Senest",
"At the hotel": "På hotellet", "At the hotel": "På hotellet",
"Back to scandichotels.com": "Tilbake til scandichotels.com",
"Bed type": "Seng type", "Bed type": "Seng type",
"Book": "Bestill", "Book": "Bestill",
"Book reward night": "Bestill belønningskveld", "Book reward night": "Bestill belønningskveld",
@@ -64,6 +65,7 @@
"from your member profile?": "fra medlemsprofilen din?", "from your member profile?": "fra medlemsprofilen din?",
"Get inspired": "Bli inspirert", "Get inspired": "Bli inspirert",
"Go back to overview": "Gå tilbake til oversikten", "Go back to overview": "Gå tilbake til oversikten",
"Hi": "Hei",
"Highest level": "Høyeste nivå", "Highest level": "Høyeste nivå",
"Hotel facilities": "Hotelfaciliteter", "Hotel facilities": "Hotelfaciliteter",
"Hotel surroundings": "Hotellomgivelser", "Hotel surroundings": "Hotellomgivelser",
@@ -81,6 +83,7 @@
"Level 7": "Nivå 7", "Level 7": "Nivå 7",
"Level up to unlock": "Nivå opp for å låse opp", "Level up to unlock": "Nivå opp for å låse opp",
"Log in": "Logg Inn", "Log in": "Logg Inn",
"Log in/Join": "Logg på/Bli med",
"Log in here": "Logg inn her", "Log in here": "Logg inn her",
"Log out": "Logg ut", "Log out": "Logg ut",
"Manage preferences": "Administrer preferanser", "Manage preferences": "Administrer preferanser",

View File

@@ -15,6 +15,7 @@
"As our Close Friend": "Som vår nära vän", "As our Close Friend": "Som vår nära vän",
"At latest": "Senast", "At latest": "Senast",
"At the hotel": "På hotellet", "At the hotel": "På hotellet",
"Back to scandichotels.com": "Tillbaka till scandichotels.com",
"Bed type": "Sängtyp", "Bed type": "Sängtyp",
"Book": "Boka", "Book": "Boka",
"Book reward night": "Boka frinatt", "Book reward night": "Boka frinatt",
@@ -64,6 +65,7 @@
"from your member profile?": "från din medlemsprofil?", "from your member profile?": "från din medlemsprofil?",
"Get inspired": "Bli inspirerad", "Get inspired": "Bli inspirerad",
"Go back to overview": "Gå tillbaka till översikten", "Go back to overview": "Gå tillbaka till översikten",
"Hi": "Hej",
"Highest level": "Högsta nivå", "Highest level": "Högsta nivå",
"Hotel facilities": "Hotellfaciliteter", "Hotel facilities": "Hotellfaciliteter",
"Hotel surroundings": "Hotellomgivning", "Hotel surroundings": "Hotellomgivning",
@@ -83,6 +85,7 @@
"Level 7": "Nivå 7", "Level 7": "Nivå 7",
"Level up to unlock": "Levla upp för att låsa upp", "Level up to unlock": "Levla upp för att låsa upp",
"Log in": "Logga in", "Log in": "Logga in",
"Log in/Join": "Logga in/Gå med",
"Log in here": "Logga in här", "Log in here": "Logga in här",
"Log out": "Logga ut", "Log out": "Logga ut",
"Manage preferences": "Hantera inställningar", "Manage preferences": "Hantera inställningar",