feat: SW-276 Updated plurals for labels
This commit is contained in:
@@ -15,21 +15,20 @@ import styles from "./guests-rooms-picker.module.css"
|
|||||||
export default function GuestsRoomsPickerForm() {
|
export default function GuestsRoomsPickerForm() {
|
||||||
const intl = useIntl()
|
const intl = useIntl()
|
||||||
const [isOpen, setIsOpen] = useState(false)
|
const [isOpen, setIsOpen] = useState(false)
|
||||||
const guestsData = guestsRoomsStore().rooms
|
const { rooms, adultCount, childCount, setIsValidated } = guestsRoomsStore()
|
||||||
const { adultCount, childCount, setIsValidated } = guestsRoomsStore()
|
|
||||||
const ref = useRef<HTMLDivElement | null>(null)
|
const ref = useRef<HTMLDivElement | null>(null)
|
||||||
function handleOnClick() {
|
function handleOnClick() {
|
||||||
setIsOpen((prevIsOpen) => !prevIsOpen)
|
setIsOpen((prevIsOpen) => !prevIsOpen)
|
||||||
}
|
}
|
||||||
const closePicker = useCallback(() => {
|
const closePicker = useCallback(() => {
|
||||||
const guestRoomsValidData = guestRoomsSchema.safeParse(guestsData)
|
const guestRoomsValidData = guestRoomsSchema.safeParse(rooms)
|
||||||
if (guestRoomsValidData.success) {
|
if (guestRoomsValidData.success) {
|
||||||
setIsOpen(false)
|
setIsOpen(false)
|
||||||
setIsValidated(false)
|
setIsValidated(false)
|
||||||
} else {
|
} else {
|
||||||
setIsValidated(true)
|
setIsValidated(true)
|
||||||
}
|
}
|
||||||
}, [guestsData, setIsValidated, setIsOpen])
|
}, [rooms, setIsValidated, setIsOpen])
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
function handleClickOutside(evt: Event) {
|
function handleClickOutside(evt: Event) {
|
||||||
@@ -44,27 +43,26 @@ export default function GuestsRoomsPickerForm() {
|
|||||||
}
|
}
|
||||||
}, [closePicker])
|
}, [closePicker])
|
||||||
|
|
||||||
const selectedRoomsCount = guestsData.length
|
|
||||||
|
|
||||||
const childCountLabel =
|
|
||||||
childCount > 1
|
|
||||||
? intl.formatMessage({ id: "Children" })
|
|
||||||
: intl.formatMessage({ id: "Child" })
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className={styles.container} data-isopen={isOpen} ref={ref}>
|
<div className={styles.container} data-isopen={isOpen} ref={ref}>
|
||||||
<button className={styles.btn} onClick={handleOnClick} type="button">
|
<button className={styles.btn} onClick={handleOnClick} type="button">
|
||||||
<Body className={styles.body}>
|
<Body className={styles.body}>
|
||||||
{selectedRoomsCount}{" "}
|
{intl.formatMessage(
|
||||||
{selectedRoomsCount > 1
|
{ id: "booking.rooms" },
|
||||||
? intl.formatMessage({ id: "Rooms" })
|
{ totalRooms: rooms.length }
|
||||||
: intl.formatMessage({ id: "Room" })}
|
)}
|
||||||
{", "}
|
{", "}
|
||||||
{adultCount}{" "}
|
{intl.formatMessage(
|
||||||
{adultCount > 1
|
{ id: "booking.adults" },
|
||||||
? intl.formatMessage({ id: "Adults" })
|
{ totalAdults: adultCount }
|
||||||
: intl.formatMessage({ id: "Adult" })}
|
)}
|
||||||
{childCount > 0 ? ", " + childCount + " " + childCountLabel : null}
|
{childCount > 0
|
||||||
|
? ", " +
|
||||||
|
intl.formatMessage(
|
||||||
|
{ id: "booking.children" },
|
||||||
|
{ totalChildren: childCount }
|
||||||
|
)
|
||||||
|
: null}
|
||||||
</Body>
|
</Body>
|
||||||
</button>
|
</button>
|
||||||
<div aria-modal className={styles.hideWrapper} role="dialog">
|
<div aria-modal className={styles.hideWrapper} role="dialog">
|
||||||
|
|||||||
@@ -9,7 +9,6 @@
|
|||||||
"Add new card": "Tilføj nyt kort",
|
"Add new card": "Tilføj nyt kort",
|
||||||
"Address": "Adresse",
|
"Address": "Adresse",
|
||||||
"Airport": "Lufthavn",
|
"Airport": "Lufthavn",
|
||||||
"Adult": "Voksen",
|
|
||||||
"Adults": "voksne",
|
"Adults": "voksne",
|
||||||
"All our breakfast buffets offer gluten free, vegan, and allergy-friendly options.": "Alle vores morgenmadsbuffeter tilbyder glutenfrie, veganske og allergivenlige muligheder.",
|
"All our breakfast buffets offer gluten free, vegan, and allergy-friendly options.": "Alle vores morgenmadsbuffeter tilbyder glutenfrie, veganske og allergivenlige muligheder.",
|
||||||
"Already a friend?": "Allerede en ven?",
|
"Already a friend?": "Allerede en ven?",
|
||||||
@@ -46,7 +45,6 @@
|
|||||||
"Check in": "Check ind",
|
"Check in": "Check ind",
|
||||||
"Check out": "Check ud",
|
"Check out": "Check ud",
|
||||||
"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.",
|
||||||
"Child": "Barn",
|
|
||||||
"Children": "børn",
|
"Children": "børn",
|
||||||
"Choose room": "Vælg rum",
|
"Choose room": "Vælg rum",
|
||||||
"Cities": "Byer",
|
"Cities": "Byer",
|
||||||
@@ -328,6 +326,7 @@
|
|||||||
"Zoom out": "Zoom ud",
|
"Zoom out": "Zoom ud",
|
||||||
"as of today": "pr. dags dato",
|
"as of today": "pr. dags dato",
|
||||||
"booking.adults": "{totalAdults, plural, one {# voksen} other {# voksne}}",
|
"booking.adults": "{totalAdults, plural, one {# voksen} other {# voksne}}",
|
||||||
|
"booking.children": "{totalChildren, plural, one {# barn} other {# børn}}",
|
||||||
"booking.guests": "Maks {nrOfGuests, plural, one {# gæst} other {# gæster}}",
|
"booking.guests": "Maks {nrOfGuests, plural, one {# gæst} other {# gæster}}",
|
||||||
"booking.nights": "{totalNights, plural, one {# nat} other {# nætter}}",
|
"booking.nights": "{totalNights, plural, one {# nat} other {# nætter}}",
|
||||||
"booking.rooms": "{totalRooms, plural, one {# værelse} other {# værelser}}",
|
"booking.rooms": "{totalRooms, plural, one {# værelse} other {# værelser}}",
|
||||||
|
|||||||
@@ -9,7 +9,6 @@
|
|||||||
"Add new card": "Neue Karte hinzufügen",
|
"Add new card": "Neue Karte hinzufügen",
|
||||||
"Address": "Adresse",
|
"Address": "Adresse",
|
||||||
"Airport": "Flughafen",
|
"Airport": "Flughafen",
|
||||||
"Adult": "Erwachsener",
|
|
||||||
"Adults": "Erwachsene",
|
"Adults": "Erwachsene",
|
||||||
"All our breakfast buffets offer gluten free, vegan, and allergy-friendly options.": "Alle unsere Frühstücksbuffets bieten glutenfreie, vegane und allergikerfreundliche Speisen.",
|
"All our breakfast buffets offer gluten free, vegan, and allergy-friendly options.": "Alle unsere Frühstücksbuffets bieten glutenfreie, vegane und allergikerfreundliche Speisen.",
|
||||||
"Already a friend?": "Sind wir schon Freunde?",
|
"Already a friend?": "Sind wir schon Freunde?",
|
||||||
@@ -46,7 +45,6 @@
|
|||||||
"Check in": "Einchecken",
|
"Check in": "Einchecken",
|
||||||
"Check out": "Auschecken",
|
"Check out": "Auschecken",
|
||||||
"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.",
|
||||||
"Child": "Kind",
|
|
||||||
"Children": "Kinder",
|
"Children": "Kinder",
|
||||||
"Choose room": "Zimmer wählen",
|
"Choose room": "Zimmer wählen",
|
||||||
"Cities": "Städte",
|
"Cities": "Städte",
|
||||||
@@ -328,6 +326,7 @@
|
|||||||
"Zoom out": "Verkleinern",
|
"Zoom out": "Verkleinern",
|
||||||
"as of today": "Stand heute",
|
"as of today": "Stand heute",
|
||||||
"booking.adults": "{totalAdults, plural, one {# erwachsene} other {# erwachsene}}",
|
"booking.adults": "{totalAdults, plural, one {# erwachsene} other {# erwachsene}}",
|
||||||
|
"booking.children": "{totalChildren, plural, one {# kind} other {# kinder}}",
|
||||||
"booking.guests": "Max {nrOfGuests, plural, one {# gast} other {# gäste}}",
|
"booking.guests": "Max {nrOfGuests, plural, one {# gast} other {# gäste}}",
|
||||||
"booking.nights": "{totalNights, plural, one {# nacht} other {# Nächte}}",
|
"booking.nights": "{totalNights, plural, one {# nacht} other {# Nächte}}",
|
||||||
"booking.rooms": "{totalRooms, plural, one {# zimmer} other {# räume}}",
|
"booking.rooms": "{totalRooms, plural, one {# zimmer} other {# räume}}",
|
||||||
|
|||||||
@@ -9,7 +9,6 @@
|
|||||||
"Add new card": "Add new card",
|
"Add new card": "Add new card",
|
||||||
"Address": "Address",
|
"Address": "Address",
|
||||||
"Airport": "Airport",
|
"Airport": "Airport",
|
||||||
"Adult": "Adult",
|
|
||||||
"Adults": "Adults",
|
"Adults": "Adults",
|
||||||
"Age": "Age",
|
"Age": "Age",
|
||||||
"All our breakfast buffets offer gluten free, vegan, and allergy-friendly options.": "All our breakfast buffets offer gluten free, vegan, and allergy-friendly options.",
|
"All our breakfast buffets offer gluten free, vegan, and allergy-friendly options.": "All our breakfast buffets offer gluten free, vegan, and allergy-friendly options.",
|
||||||
@@ -48,7 +47,6 @@
|
|||||||
"Check in": "Check in",
|
"Check in": "Check in",
|
||||||
"Check out": "Check out",
|
"Check out": "Check out",
|
||||||
"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.",
|
||||||
"Child": "Child",
|
|
||||||
"Children": "Children",
|
"Children": "Children",
|
||||||
"Child age is required": "Child age is required",
|
"Child age is required": "Child age is required",
|
||||||
"Choose room": "Choose room",
|
"Choose room": "Choose room",
|
||||||
@@ -331,6 +329,7 @@
|
|||||||
"Zoom out": "Zoom out",
|
"Zoom out": "Zoom out",
|
||||||
"as of today": "as of today",
|
"as of today": "as of today",
|
||||||
"booking.adults": "{totalAdults, plural, one {# adult} other {# adults}}",
|
"booking.adults": "{totalAdults, plural, one {# adult} other {# adults}}",
|
||||||
|
"booking.children": "{totalChildren, plural, one {# child} other {# children}}",
|
||||||
"booking.guests": "Max {nrOfGuests, plural, one {# guest} other {# guests}}",
|
"booking.guests": "Max {nrOfGuests, plural, one {# guest} other {# guests}}",
|
||||||
"booking.nights": "{totalNights, plural, one {# night} other {# nights}}",
|
"booking.nights": "{totalNights, plural, one {# night} other {# nights}}",
|
||||||
"booking.rooms": "{totalRooms, plural, one {# room} other {# rooms}}",
|
"booking.rooms": "{totalRooms, plural, one {# room} other {# rooms}}",
|
||||||
|
|||||||
@@ -9,7 +9,6 @@
|
|||||||
"Add new card": "Lisää uusi kortti",
|
"Add new card": "Lisää uusi kortti",
|
||||||
"Address": "Osoite",
|
"Address": "Osoite",
|
||||||
"Airport": "Lentokenttä",
|
"Airport": "Lentokenttä",
|
||||||
"Adult": "Aikuinen",
|
|
||||||
"Adults": "Aikuista",
|
"Adults": "Aikuista",
|
||||||
"All our breakfast buffets offer gluten free, vegan, and allergy-friendly options.": "Kaikki aamiaisbuffettimme tarjoavat gluteenittomia, vegaanisia ja allergiaystävällisiä vaihtoehtoja.",
|
"All our breakfast buffets offer gluten free, vegan, and allergy-friendly options.": "Kaikki aamiaisbuffettimme tarjoavat gluteenittomia, vegaanisia ja allergiaystävällisiä vaihtoehtoja.",
|
||||||
"Already a friend?": "Oletko jo ystävä?",
|
"Already a friend?": "Oletko jo ystävä?",
|
||||||
@@ -46,7 +45,6 @@
|
|||||||
"Check in": "Sisäänkirjautuminen",
|
"Check in": "Sisäänkirjautuminen",
|
||||||
"Check out": "Uloskirjautuminen",
|
"Check out": "Uloskirjautuminen",
|
||||||
"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.",
|
||||||
"Child": "Lapsi",
|
|
||||||
"Children": "Lasta",
|
"Children": "Lasta",
|
||||||
"Choose room": "Valitse huone",
|
"Choose room": "Valitse huone",
|
||||||
"Cities": "Kaupungit",
|
"Cities": "Kaupungit",
|
||||||
@@ -329,6 +327,7 @@
|
|||||||
"Zoom out": "Loitonna",
|
"Zoom out": "Loitonna",
|
||||||
"as of today": "tänään",
|
"as of today": "tänään",
|
||||||
"booking.adults": "{totalAdults, plural, one {# aikuinen} other {# aikuiset}}",
|
"booking.adults": "{totalAdults, plural, one {# aikuinen} other {# aikuiset}}",
|
||||||
|
"booking.children": "{totalChildren, plural, one {# lapsi} other {# lasta}}",
|
||||||
"booking.guests": "Max {nrOfGuests, plural, one {# vieras} other {# vieraita}}",
|
"booking.guests": "Max {nrOfGuests, plural, one {# vieras} other {# vieraita}}",
|
||||||
"booking.nights": "{totalNights, plural, one {# yö} other {# yötä}}",
|
"booking.nights": "{totalNights, plural, one {# yö} other {# yötä}}",
|
||||||
"booking.rooms": "{totalRooms, plural, one {# huone} other {# sviitti}}",
|
"booking.rooms": "{totalRooms, plural, one {# huone} other {# sviitti}}",
|
||||||
|
|||||||
@@ -9,7 +9,6 @@
|
|||||||
"Add new card": "Legg til nytt kort",
|
"Add new card": "Legg til nytt kort",
|
||||||
"Address": "Adresse",
|
"Address": "Adresse",
|
||||||
"Airport": "Flyplass",
|
"Airport": "Flyplass",
|
||||||
"Adult": "Voksen",
|
|
||||||
"Adults": "Voksne",
|
"Adults": "Voksne",
|
||||||
"All our breakfast buffets offer gluten free, vegan, and allergy-friendly options.": "Alle våre frokostbufféer tilbyr glutenfrie, veganske og allergivennlige alternativer.",
|
"All our breakfast buffets offer gluten free, vegan, and allergy-friendly options.": "Alle våre frokostbufféer tilbyr glutenfrie, veganske og allergivennlige alternativer.",
|
||||||
"Already a friend?": "Allerede Friend?",
|
"Already a friend?": "Allerede Friend?",
|
||||||
@@ -46,7 +45,6 @@
|
|||||||
"Check in": "Sjekk inn",
|
"Check in": "Sjekk inn",
|
||||||
"Check out": "Sjekk ut",
|
"Check out": "Sjekk ut",
|
||||||
"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.",
|
||||||
"Child": "Barn",
|
|
||||||
"Children": "Barn",
|
"Children": "Barn",
|
||||||
"Choose room": "Velg rom",
|
"Choose room": "Velg rom",
|
||||||
"Cities": "Byer",
|
"Cities": "Byer",
|
||||||
@@ -326,6 +324,7 @@
|
|||||||
"Zoom out": "Zoom ut",
|
"Zoom out": "Zoom ut",
|
||||||
"as of today": "per i dag",
|
"as of today": "per i dag",
|
||||||
"booking.adults": "{totalAdults, plural, one {# voksen} other {# voksne}}",
|
"booking.adults": "{totalAdults, plural, one {# voksen} other {# voksne}}",
|
||||||
|
"booking.children": "{totalChildren, plural, one {# barn} other {# barn}}",
|
||||||
"booking.guests": "Maks {nrOfGuests, plural, one {# gjest} other {# gjester}}",
|
"booking.guests": "Maks {nrOfGuests, plural, one {# gjest} other {# gjester}}",
|
||||||
"booking.nights": "{totalNights, plural, one {# natt} other {# netter}}",
|
"booking.nights": "{totalNights, plural, one {# natt} other {# netter}}",
|
||||||
"booking.rooms": "{totalRooms, plural, one {# rom} other {# rom}}",
|
"booking.rooms": "{totalRooms, plural, one {# rom} other {# rom}}",
|
||||||
|
|||||||
@@ -9,7 +9,6 @@
|
|||||||
"Add new card": "Lägg till nytt kort",
|
"Add new card": "Lägg till nytt kort",
|
||||||
"Address": "Adress",
|
"Address": "Adress",
|
||||||
"Airport": "Flygplats",
|
"Airport": "Flygplats",
|
||||||
"Adult": "Vuxen",
|
|
||||||
"Adults": "Vuxna",
|
"Adults": "Vuxna",
|
||||||
"All our breakfast buffets offer gluten free, vegan, and allergy-friendly options.": "Alla våra frukostbufféer erbjuder glutenfria, veganska och allergivänliga alternativ.",
|
"All our breakfast buffets offer gluten free, vegan, and allergy-friendly options.": "Alla våra frukostbufféer erbjuder glutenfria, veganska och allergivänliga alternativ.",
|
||||||
"Already a friend?": "Är du redan en vän?",
|
"Already a friend?": "Är du redan en vän?",
|
||||||
@@ -46,7 +45,6 @@
|
|||||||
"Check in": "Checka in",
|
"Check in": "Checka in",
|
||||||
"Check out": "Checka ut",
|
"Check out": "Checka ut",
|
||||||
"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.",
|
||||||
"Child": "Barn",
|
|
||||||
"Children": "Barn",
|
"Children": "Barn",
|
||||||
"Choose room": "Välj rum",
|
"Choose room": "Välj rum",
|
||||||
"Cities": "Städer",
|
"Cities": "Städer",
|
||||||
@@ -325,6 +323,7 @@
|
|||||||
"Zoom in": "Zooma in",
|
"Zoom in": "Zooma in",
|
||||||
"Zoom out": "Zooma ut",
|
"Zoom out": "Zooma ut",
|
||||||
"booking.adults": "{totalAdults, plural, one {# vuxen} other {# vuxna}}",
|
"booking.adults": "{totalAdults, plural, one {# vuxen} other {# vuxna}}",
|
||||||
|
"booking.children": "{totalChildren, plural, one {# barn} other {# barn}}",
|
||||||
"booking.guests": "Max {nrOfGuests, plural, one {# gäst} other {# gäster}}",
|
"booking.guests": "Max {nrOfGuests, plural, one {# gäst} other {# gäster}}",
|
||||||
"booking.nights": "{totalNights, plural, one {# natt} other {# nätter}}",
|
"booking.nights": "{totalNights, plural, one {# natt} other {# nätter}}",
|
||||||
"booking.rooms": "{totalRooms, plural, one {# rum} other {# rum}}",
|
"booking.rooms": "{totalRooms, plural, one {# rum} other {# rum}}",
|
||||||
|
|||||||
Reference in New Issue
Block a user