Add texts to i18n

This commit is contained in:
Niclas Edenvin
2024-07-09 12:52:29 +02:00
parent 337dfe24ff
commit 78c1452ed3
9 changed files with 55 additions and 12 deletions

View File

@@ -1,5 +1,3 @@
import Title from "@/components/TempDesignSystem/Text/Title"
import styles from "./layout.module.css" import styles from "./layout.module.css"
import { LangParams, LayoutArgs } from "@/types/params" import { LangParams, LayoutArgs } from "@/types/params"

View File

@@ -1,6 +1,7 @@
import RoomCard from "@/components/HotelReservation/SelectRate/RoomCard" import RoomCard from "@/components/HotelReservation/SelectRate/RoomCard"
import { Room } from "@/components/HotelReservation/SelectRate/RoomCard/roomCard" import { Room } from "@/components/HotelReservation/SelectRate/RoomCard/roomCard"
import Header from "@/components/Section/Header" import Header from "@/components/Section/Header"
import { getIntl } from "@/i18n"
import styles from "./page.module.css" import styles from "./page.module.css"
@@ -78,6 +79,7 @@ const getRooms: () => Promise<Room[]> = () => {
} }
export default async function SelectRate() { export default async function SelectRate() {
const { formatMessage } = await getIntl()
const rooms = await getRooms() const rooms = await getRooms()
return ( return (
@@ -86,11 +88,15 @@ export default async function SelectRate() {
<div className={styles.hotelInfo}>Hotel info TBI</div> <div className={styles.hotelInfo}>Hotel info TBI</div>
<div className={styles.header}> <div className={styles.header}>
<Header <Header
title="Choose room" title={formatMessage({ id: "Choose room" })}
subtitle={"Which room class suits you the best?"} subtitle={formatMessage({
id: "Which room class suits you the best?",
})}
link={{ link={{
href: "#", href: "#",
text: "All rooms comes with standard amenities", text: formatMessage({
id: "All rooms comes with standard amenities",
}),
}} }}
/> />
</div> </div>

View File

@@ -1,27 +1,31 @@
import Button from "@/components/TempDesignSystem/Button" import Button from "@/components/TempDesignSystem/Button"
import Caption from "@/components/TempDesignSystem/Text/Caption" import Caption from "@/components/TempDesignSystem/Text/Caption"
import Title from "@/components/TempDesignSystem/Text/Title" import Title from "@/components/TempDesignSystem/Text/Title"
import { getIntl } from "@/i18n"
import { RoomProps } from "./roomCard" import { RoomProps } from "./roomCard"
import styles from "./roomCard.module.css" import styles from "./roomCard.module.css"
export default function RoomCard({ room }: RoomProps) { export default async function RoomCard({ room }: RoomProps) {
const { formatMessage } = await getIntl()
return ( return (
<div className={styles.card}> <div className={styles.card}>
<div className={styles.cardBody}> <div className={styles.cardBody}>
<div className={styles.nameContainer}> <div>
<Title className={styles.name} as="h5" level="h3"> <Title className={styles.name} as="h5" level="h3">
{room.name} {room.name}
</Title> </Title>
<div className={styles.nameInfo}>i</div> <div className={styles.nameInfo}>i</div>
</div> </div>
<Caption color="burgundy">17 - 24 m² (1 - 2 persons)</Caption> <Caption color="burgundy">{room.size}</Caption>
<Caption color="burgundy">{room.description}</Caption> <Caption color="burgundy">{room.description}</Caption>
<Caption color="burgundy"> <Caption color="burgundy">
From <span className={styles.price}>{room.pricePerNight}</span>{" "} {/* TODO: Handle currency and this whole line of text in a better way through intl */}
{room.currency}/night {formatMessage({ id: "From" })}{" "}
<span className={styles.price}>{room.pricePerNight}</span>{" "}
{room.currency}/{formatMessage({ id: "night" })}
</Caption> </Caption>
<Button <Button
@@ -31,12 +35,17 @@ export default function RoomCard({ room }: RoomProps) {
theme="primaryDark" theme="primaryDark"
className={styles.button} className={styles.button}
> >
<label htmlFor={`room-${room.id}`}>Choose room</label> <label htmlFor={`room-${room.id}`}>
{formatMessage({ id: "Choose room" })}
</label>
</Button> </Button>
</div> </div>
{/* TODO: maybe use the `Image` component instead of the `img` tag. Waiting until we know how to get the image */} {/* TODO: maybe use the `Image` component instead of the `img` tag. Waiting until we know how to get the image */}
{/* eslint-disable-next-line @next/next/no-img-element */} {/* eslint-disable-next-line @next/next/no-img-element */}
<img alt="A photo of the room" src={room.imageSrc} /> <img
alt={formatMessage({ id: "A photo of the room" })}
src={room.imageSrc}
/>
</div> </div>
) )
} }

View File

@@ -1,6 +1,8 @@
{ {
"A photo of the room": "Et foto af værelset",
"Add new card": "Tilføj nyt kort", "Add new card": "Tilføj nyt kort",
"Address": "Adresse", "Address": "Adresse",
"All rooms comes with standard amenities": "Alle værelser er udstyret med standardfaciliteter",
"Already a friend?": "Allerede en ven?", "Already a friend?": "Allerede en ven?",
"Arrival date": "Ankomstdato", "Arrival date": "Ankomstdato",
"As our": "Som vores", "As our": "Som vores",
@@ -10,6 +12,7 @@
"Booking number": "Bestillingsnummer", "Booking number": "Bestillingsnummer",
"Cancel": "Afbestille", "Cancel": "Afbestille",
"Check out the credit cards saved to your profile. Pay with a saved card when signed in for a smoother web experience.": "Tjek de kreditkort, der er gemt på din profil. Betal med et gemt kort, når du er logget ind for en mere jævn weboplevelse.", "Check out the credit cards saved to your profile. Pay with a saved card when signed in for a smoother web experience.": "Tjek de kreditkort, der er gemt på din profil. Betal med et gemt kort, når du er logget ind for en mere jævn weboplevelse.",
"Choose room": "Vælg rum",
"City": "By", "City": "By",
"City/State": "By/Stat", "City/State": "By/Stat",
"Click here to log in": "Klik her for at logge ind", "Click here to log in": "Klik her for at logge ind",
@@ -34,6 +37,7 @@
"Empty": "Empty", "Empty": "Empty",
"Explore all levels and benefits": "Udforsk alle niveauer og fordele", "Explore all levels and benefits": "Udforsk alle niveauer og fordele",
"Find booking": "Find booking", "Find booking": "Find booking",
"From": "Fra",
"Get inspired": "Blive inspireret", "Get inspired": "Blive inspireret",
"Go back to overview": "Gå tilbage til oversigten", "Go back to overview": "Gå tilbage til oversigten",
"How it works": "Hvordan det virker", "How it works": "Hvordan det virker",
@@ -98,6 +102,7 @@
"Visiting address": "Besøgsadresse", "Visiting address": "Besøgsadresse",
"Welcome to": "Velkommen til", "Welcome to": "Velkommen til",
"Where should you go next?": "Hvor skal du tage hen næste gang?", "Where should you go next?": "Hvor skal du tage hen næste gang?",
"Which room class suits you the best?": "Hvilken rumklasse passer bedst til dig",
"Year": "År", "Year": "År",
"You have no previous stays.": "Du har ingen tidligere ophold.", "You have no previous stays.": "Du har ingen tidligere ophold.",
"You have no upcoming stays.": "Du har ingen kommende ophold.", "You have no upcoming stays.": "Du har ingen kommende ophold.",

View File

@@ -1,6 +1,8 @@
{ {
"A photo of the room": "Ein Foto des Zimmers",
"Add new card": "Neue Karte hinzufügen", "Add new card": "Neue Karte hinzufügen",
"Address": "Adresse", "Address": "Adresse",
"All rooms comes with standard amenities": "Alle Zimmer sind mit den üblichen Annehmlichkeiten ausgestattet",
"Already a friend?": "Schon ein Freund?", "Already a friend?": "Schon ein Freund?",
"Arrival date": "Ankunftsdatum", "Arrival date": "Ankunftsdatum",
"As our": "Als unsere", "As our": "Als unsere",
@@ -10,6 +12,7 @@
"Booking number": "Buchungsnummer", "Booking number": "Buchungsnummer",
"Cancel": "Stornieren", "Cancel": "Stornieren",
"Check out the credit cards saved to your profile. Pay with a saved card when signed in for a smoother web experience.": "Sehen Sie sich die in Ihrem Profil gespeicherten Kreditkarten an. Bezahlen Sie mit einer gespeicherten Karte, wenn Sie angemeldet sind, für ein reibungsloseres Web-Erlebnis.", "Check out the credit cards saved to your profile. Pay with a saved card when signed in for a smoother web experience.": "Sehen Sie sich die in Ihrem Profil gespeicherten Kreditkarten an. Bezahlen Sie mit einer gespeicherten Karte, wenn Sie angemeldet sind, für ein reibungsloseres Web-Erlebnis.",
"Choose room": "Zimmer wählen",
"City": "Stadt", "City": "Stadt",
"City/State": "Stadt/Zustand", "City/State": "Stadt/Zustand",
"Click here to log in": "Klicken Sie hier, um sich einzuloggen", "Click here to log in": "Klicken Sie hier, um sich einzuloggen",
@@ -34,6 +37,7 @@
"Empty": "Empty", "Empty": "Empty",
"Explore all levels and benefits": "Entdecken Sie alle Levels und Vorteile", "Explore all levels and benefits": "Entdecken Sie alle Levels und Vorteile",
"Find booking": "Buchung finden", "Find booking": "Buchung finden",
"From": "Fromm",
"Get inspired": "Lass dich inspirieren", "Get inspired": "Lass dich inspirieren",
"Go back to overview": "Zurück zur Übersicht", "Go back to overview": "Zurück zur Übersicht",
"How it works": "Wie es funktioniert", "How it works": "Wie es funktioniert",
@@ -98,6 +102,7 @@
"Visiting address": "Besuchsadresse", "Visiting address": "Besuchsadresse",
"Welcome to": "Willkommen zu", "Welcome to": "Willkommen zu",
"Where should you go next?": "Wohin soll es als nächstes gehen?", "Where should you go next?": "Wohin soll es als nächstes gehen?",
"Which room class suits you the best?": "Welche Zimmerklasse passt am besten zu Ihnen?",
"Year": "Jahr", "Year": "Jahr",
"You have no previous stays.": "Sie haben keine vorherigen Aufenthalte.", "You have no previous stays.": "Sie haben keine vorherigen Aufenthalte.",
"You have no upcoming stays.": "Sie haben keine bevorstehenden Aufenthalte.", "You have no upcoming stays.": "Sie haben keine bevorstehenden Aufenthalte.",

View File

@@ -1,6 +1,8 @@
{ {
"A photo of the room": "A photo of the room",
"Add new card": "Add new card", "Add new card": "Add new card",
"Address": "Address", "Address": "Address",
"All rooms comes with standard amenities": "All rooms comes with standard amenities",
"Already a friend?": "Already a friend?", "Already a friend?": "Already a friend?",
"Arrival date": "Arrival date", "Arrival date": "Arrival date",
"As our": "As our", "As our": "As our",
@@ -10,6 +12,7 @@
"Booking number": "Booking number", "Booking number": "Booking number",
"Cancel": "Cancel", "Cancel": "Cancel",
"Check out the credit cards saved to your profile. Pay with a saved card when signed in for a smoother web experience.": "Check out the credit cards saved to your profile. Pay with a saved card when signed in for a smoother web experience.", "Check out the credit cards saved to your profile. Pay with a saved card when signed in for a smoother web experience.": "Check out the credit cards saved to your profile. Pay with a saved card when signed in for a smoother web experience.",
"Choose room": "Choose room",
"City": "City", "City": "City",
"City/State": "City/State", "City/State": "City/State",
"Click here to log in": "Click here to log in", "Click here to log in": "Click here to log in",
@@ -35,6 +38,7 @@
"Empty": "Empty", "Empty": "Empty",
"Explore all levels and benefits": "Explore all levels and benefits", "Explore all levels and benefits": "Explore all levels and benefits",
"Find booking": "Find booking", "Find booking": "Find booking",
"From": "From",
"Get inspired": "Get inspired", "Get inspired": "Get inspired",
"Go back to overview": "Go back to overview", "Go back to overview": "Go back to overview",
"How it works": "How it works", "How it works": "How it works",
@@ -99,6 +103,7 @@
"Visiting address": "Visiting address", "Visiting address": "Visiting address",
"Welcome to": "Welcome to", "Welcome to": "Welcome to",
"Where should you go next?": "Where should you go next?", "Where should you go next?": "Where should you go next?",
"Which room class suits you the best?": "Which room class suits you the best?",
"Year": "Year", "Year": "Year",
"You have no previous stays.": "You have no previous stays.", "You have no previous stays.": "You have no previous stays.",
"You have no upcoming stays.": "You have no upcoming stays.", "You have no upcoming stays.": "You have no upcoming stays.",

View File

@@ -1,6 +1,8 @@
{ {
"A photo of the room": "Kuva huoneesta",
"Add new card": "Lisää uusi kortti", "Add new card": "Lisää uusi kortti",
"Address": "Osoite", "Address": "Osoite",
"All rooms comes with standard amenities": "Kaikissa huoneissa on perusmukavuudet",
"Already a friend?": "Oletko jo ystävä?", "Already a friend?": "Oletko jo ystävä?",
"Arrival date": "Saapumispäivä", "Arrival date": "Saapumispäivä",
"As our": "Kuin meidän", "As our": "Kuin meidän",
@@ -10,6 +12,7 @@
"Booking number": "Varausnumero", "Booking number": "Varausnumero",
"Cancel": "Peruuttaa", "Cancel": "Peruuttaa",
"Check out the credit cards saved to your profile. Pay with a saved card when signed in for a smoother web experience.": "Tarkista profiiliisi tallennetut luottokortit. Maksa tallennetulla kortilla kirjautuneena, jotta verkkokokemus on sujuvampi.", "Check out the credit cards saved to your profile. Pay with a saved card when signed in for a smoother web experience.": "Tarkista profiiliisi tallennetut luottokortit. Maksa tallennetulla kortilla kirjautuneena, jotta verkkokokemus on sujuvampi.",
"Choose room": "Valitse huone",
"City": "Kaupunki", "City": "Kaupunki",
"City/State": "Kaupunki/Osavaltio", "City/State": "Kaupunki/Osavaltio",
"Click here to log in": "Napsauta tästä kirjautuaksesi sisään", "Click here to log in": "Napsauta tästä kirjautuaksesi sisään",
@@ -34,6 +37,7 @@
"Empty": "Empty", "Empty": "Empty",
"Explore all levels and benefits": "Tutustu kaikkiin tasoihin ja etuihin", "Explore all levels and benefits": "Tutustu kaikkiin tasoihin ja etuihin",
"Find booking": "Etsi varaus", "Find booking": "Etsi varaus",
"From": "From",
"Get inspired": "Inspiroidu", "Get inspired": "Inspiroidu",
"Go back to overview": "Palaa yleiskatsaukseen", "Go back to overview": "Palaa yleiskatsaukseen",
"How it works": "Kuinka se toimii", "How it works": "Kuinka se toimii",
@@ -98,6 +102,7 @@
"Visiting address": "Käyntiosoite", "Visiting address": "Käyntiosoite",
"Welcome to": "Tervetuloa", "Welcome to": "Tervetuloa",
"Where should you go next?": "Minne sinun pitäisi mennä seuraavaksi?", "Where should you go next?": "Minne sinun pitäisi mennä seuraavaksi?",
"Which room class suits you the best?": "Mikä huoneluokka sopii sinulle parhaiten?",
"Year": "Vuosi", "Year": "Vuosi",
"You have no previous stays.": "Sinulla ei ole aiempaa oleskelua.", "You have no previous stays.": "Sinulla ei ole aiempaa oleskelua.",
"You have no upcoming stays.": "Sinulla ei ole tulevia oleskeluja.", "You have no upcoming stays.": "Sinulla ei ole tulevia oleskeluja.",

View File

@@ -1,6 +1,8 @@
{ {
"A photo of the room": "Et bilde av rommet",
"Add new card": "Legg til nytt kort", "Add new card": "Legg til nytt kort",
"Address": "Adresse", "Address": "Adresse",
"All rooms comes with standard amenities": "Alle rommene har standard fasiliteter",
"Already a friend?": "Allerede en venn?", "Already a friend?": "Allerede en venn?",
"Arrival date": "Ankomstdato", "Arrival date": "Ankomstdato",
"As our": "Som vår", "As our": "Som vår",
@@ -10,6 +12,7 @@
"Booking number": "Bestillingsnummer", "Booking number": "Bestillingsnummer",
"Cancel": "Avbryt", "Cancel": "Avbryt",
"Check out the credit cards saved to your profile. Pay with a saved card when signed in for a smoother web experience.": "Sjekk ut kredittkortene som er lagret på profilen din. Betal med et lagret kort når du er pålogget for en jevnere nettopplevelse.", "Check out the credit cards saved to your profile. Pay with a saved card when signed in for a smoother web experience.": "Sjekk ut kredittkortene som er lagret på profilen din. Betal med et lagret kort når du er pålogget for en jevnere nettopplevelse.",
"Choose room": "Velg rom",
"City": "By", "City": "By",
"City/State": "By/Stat", "City/State": "By/Stat",
"Click here to log in": "Klikk her for å logge inn", "Click here to log in": "Klikk her for å logge inn",
@@ -34,6 +37,7 @@
"Empty": "Empty", "Empty": "Empty",
"Explore all levels and benefits": "Utforsk alle nivåer og fordeler", "Explore all levels and benefits": "Utforsk alle nivåer og fordeler",
"Find booking": "Finn booking", "Find booking": "Finn booking",
"From": "Fra",
"Get inspired": "Bli inspirert", "Get inspired": "Bli inspirert",
"Go back to overview": "Gå tilbake til oversikten", "Go back to overview": "Gå tilbake til oversikten",
"How it works": "Hvordan det fungerer", "How it works": "Hvordan det fungerer",
@@ -98,6 +102,7 @@
"Visiting address": "Besøksadresse", "Visiting address": "Besøksadresse",
"Welcome to": "Velkommen til", "Welcome to": "Velkommen til",
"Where should you go next?": "Hvor bør du gå videre?", "Where should you go next?": "Hvor bør du gå videre?",
"Which room class suits you the best?": "Hvilken romklasse passer deg best?",
"Year": "År", "Year": "År",
"You have no previous stays.": "Du har ingen tidligere opphold.", "You have no previous stays.": "Du har ingen tidligere opphold.",
"You have no upcoming stays.": "Du har ingen kommende opphold.", "You have no upcoming stays.": "Du har ingen kommende opphold.",

View File

@@ -1,6 +1,8 @@
{ {
"A photo of the room": "Ett foto av rummet",
"Add new card": "Lägg till nytt kort", "Add new card": "Lägg till nytt kort",
"Address": "Adress", "Address": "Adress",
"All rooms comes with standard amenities": "Alla rum har standardbekvämligheter",
"Already a friend?": "Redan en vän?", "Already a friend?": "Redan en vän?",
"Arrival date": "Ankomstdatum", "Arrival date": "Ankomstdatum",
"As our": "Som vår", "As our": "Som vår",
@@ -10,6 +12,7 @@
"Booking number": "Bokningsnummer", "Booking number": "Bokningsnummer",
"Cancel": "Avbryt", "Cancel": "Avbryt",
"Check out the credit cards saved to your profile. Pay with a saved card when signed in for a smoother web experience.": "Kolla in kreditkorten som sparats i din profil. Betala med ett sparat kort när du är inloggad för en smidigare webbupplevelse.", "Check out the credit cards saved to your profile. Pay with a saved card when signed in for a smoother web experience.": "Kolla in kreditkorten som sparats i din profil. Betala med ett sparat kort när du är inloggad för en smidigare webbupplevelse.",
"Choose room": "Välj rum",
"City": "Ort", "City": "Ort",
"City/State": "Ort", "City/State": "Ort",
"Click here to log in": "Klicka här för att logga in", "Click here to log in": "Klicka här för att logga in",
@@ -34,6 +37,7 @@
"Empty": "Tom", "Empty": "Tom",
"Explore all levels and benefits": "Utforska alla nivåer och fördelar", "Explore all levels and benefits": "Utforska alla nivåer och fördelar",
"Find booking": "Hitta bokning", "Find booking": "Hitta bokning",
"From": "Från",
"Get inspired": "Bli inspirerad", "Get inspired": "Bli inspirerad",
"Go back to overview": "Gå tillbaka till översikten", "Go back to overview": "Gå tillbaka till översikten",
"How it works": "Hur det fungerar", "How it works": "Hur det fungerar",
@@ -97,6 +101,7 @@
"uppercase letter": "stor bokstav", "uppercase letter": "stor bokstav",
"Visiting address": "Besöksadress", "Visiting address": "Besöksadress",
"Where should you go next?": "Vart ska du gå härnäst?", "Where should you go next?": "Vart ska du gå härnäst?",
"Which room class suits you the best?": "Vilken rumsklass passar dig bäst?",
"Year": "År", "Year": "År",
"You have no previous stays.": "Du har inga tidigare vistelser.", "You have no previous stays.": "Du har inga tidigare vistelser.",
"You have no upcoming stays.": "Du har inga kommande vistelser.", "You have no upcoming stays.": "Du har inga kommande vistelser.",