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

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

View File

@@ -3,6 +3,7 @@ import Link from "next/link"
import { serverClient } from "@/lib/trpc/server"
import Image from "@/components/Image"
import { getIntl } from "@/i18n"
import Menu from "./Menu"
import MyPages from "./MyPages"
@@ -31,6 +32,7 @@ export interface MenuItem {
}
export default async function MainMenu() {
const intl = await getIntl()
const myPagesNavigation =
await serverClient().contentstack.myPages.navigation.get()
@@ -114,7 +116,7 @@ export default async function MainMenu() {
<nav className={styles.content}>
<Link className={styles.logoLink} href="/">
<Image
alt="Back to scandichotels.com"
alt={intl.formatMessage({ id: "Back to scandichotels.com" })}
className={styles.logo}
data-js="scandiclogoimg"
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 Button from "../Button"
export default function Search() {
const intl = useIntl()
return (
<Button>
<SearchIcon width={20} height={20} color="burgundy" />
<span>Find Booking</span>
{intl.formatMessage({ id: "Find booking" })}
</Button>
)
}

View File

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