From 4c82add3bc6d281a251637551af316c2c9bf8432 Mon Sep 17 00:00:00 2001 From: Hrishikesh Vaipurkar Date: Mon, 7 Oct 2024 15:32:23 +0200 Subject: [PATCH] feat: SW-276 Updated plurals for labels --- components/GuestsRoomsPicker/index.tsx | 38 ++++++++++++-------------- i18n/dictionaries/da.json | 3 +- i18n/dictionaries/de.json | 3 +- i18n/dictionaries/en.json | 3 +- i18n/dictionaries/fi.json | 3 +- i18n/dictionaries/no.json | 3 +- i18n/dictionaries/sv.json | 3 +- 7 files changed, 24 insertions(+), 32 deletions(-) diff --git a/components/GuestsRoomsPicker/index.tsx b/components/GuestsRoomsPicker/index.tsx index 8258939e1..000fe4c87 100644 --- a/components/GuestsRoomsPicker/index.tsx +++ b/components/GuestsRoomsPicker/index.tsx @@ -15,21 +15,20 @@ import styles from "./guests-rooms-picker.module.css" export default function GuestsRoomsPickerForm() { const intl = useIntl() const [isOpen, setIsOpen] = useState(false) - const guestsData = guestsRoomsStore().rooms - const { adultCount, childCount, setIsValidated } = guestsRoomsStore() + const { rooms, adultCount, childCount, setIsValidated } = guestsRoomsStore() const ref = useRef(null) function handleOnClick() { setIsOpen((prevIsOpen) => !prevIsOpen) } const closePicker = useCallback(() => { - const guestRoomsValidData = guestRoomsSchema.safeParse(guestsData) + const guestRoomsValidData = guestRoomsSchema.safeParse(rooms) if (guestRoomsValidData.success) { setIsOpen(false) setIsValidated(false) } else { setIsValidated(true) } - }, [guestsData, setIsValidated, setIsOpen]) + }, [rooms, setIsValidated, setIsOpen]) useEffect(() => { function handleClickOutside(evt: Event) { @@ -44,27 +43,26 @@ export default function GuestsRoomsPickerForm() { } }, [closePicker]) - const selectedRoomsCount = guestsData.length - - const childCountLabel = - childCount > 1 - ? intl.formatMessage({ id: "Children" }) - : intl.formatMessage({ id: "Child" }) - return (
diff --git a/i18n/dictionaries/da.json b/i18n/dictionaries/da.json index eefb8e0f9..2347bd764 100644 --- a/i18n/dictionaries/da.json +++ b/i18n/dictionaries/da.json @@ -9,7 +9,6 @@ "Add new card": "Tilføj nyt kort", "Address": "Adresse", "Airport": "Lufthavn", - "Adult": "Voksen", "Adults": "voksne", "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?", @@ -46,7 +45,6 @@ "Check in": "Check ind", "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.", - "Child": "Barn", "Children": "børn", "Choose room": "Vælg rum", "Cities": "Byer", @@ -328,6 +326,7 @@ "Zoom out": "Zoom ud", "as of today": "pr. dags dato", "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.nights": "{totalNights, plural, one {# nat} other {# nætter}}", "booking.rooms": "{totalRooms, plural, one {# værelse} other {# værelser}}", diff --git a/i18n/dictionaries/de.json b/i18n/dictionaries/de.json index 9ca065cb8..16e61ed3c 100644 --- a/i18n/dictionaries/de.json +++ b/i18n/dictionaries/de.json @@ -9,7 +9,6 @@ "Add new card": "Neue Karte hinzufügen", "Address": "Adresse", "Airport": "Flughafen", - "Adult": "Erwachsener", "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.", "Already a friend?": "Sind wir schon Freunde?", @@ -46,7 +45,6 @@ "Check in": "Einchecken", "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.", - "Child": "Kind", "Children": "Kinder", "Choose room": "Zimmer wählen", "Cities": "Städte", @@ -328,6 +326,7 @@ "Zoom out": "Verkleinern", "as of today": "Stand heute", "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.nights": "{totalNights, plural, one {# nacht} other {# Nächte}}", "booking.rooms": "{totalRooms, plural, one {# zimmer} other {# räume}}", diff --git a/i18n/dictionaries/en.json b/i18n/dictionaries/en.json index fd03010ca..9655dc962 100644 --- a/i18n/dictionaries/en.json +++ b/i18n/dictionaries/en.json @@ -9,7 +9,6 @@ "Add new card": "Add new card", "Address": "Address", "Airport": "Airport", - "Adult": "Adult", "Adults": "Adults", "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.", @@ -48,7 +47,6 @@ "Check in": "Check in", "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.", - "Child": "Child", "Children": "Children", "Child age is required": "Child age is required", "Choose room": "Choose room", @@ -331,6 +329,7 @@ "Zoom out": "Zoom out", "as of today": "as of today", "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.nights": "{totalNights, plural, one {# night} other {# nights}}", "booking.rooms": "{totalRooms, plural, one {# room} other {# rooms}}", diff --git a/i18n/dictionaries/fi.json b/i18n/dictionaries/fi.json index 73b1cbfe5..c4d20acf3 100644 --- a/i18n/dictionaries/fi.json +++ b/i18n/dictionaries/fi.json @@ -9,7 +9,6 @@ "Add new card": "Lisää uusi kortti", "Address": "Osoite", "Airport": "Lentokenttä", - "Adult": "Aikuinen", "Adults": "Aikuista", "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ä?", @@ -46,7 +45,6 @@ "Check in": "Sisäänkirjautuminen", "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.", - "Child": "Lapsi", "Children": "Lasta", "Choose room": "Valitse huone", "Cities": "Kaupungit", @@ -329,6 +327,7 @@ "Zoom out": "Loitonna", "as of today": "tänään", "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.nights": "{totalNights, plural, one {# yö} other {# yötä}}", "booking.rooms": "{totalRooms, plural, one {# huone} other {# sviitti}}", diff --git a/i18n/dictionaries/no.json b/i18n/dictionaries/no.json index 911dc126e..69ead0f59 100644 --- a/i18n/dictionaries/no.json +++ b/i18n/dictionaries/no.json @@ -9,7 +9,6 @@ "Add new card": "Legg til nytt kort", "Address": "Adresse", "Airport": "Flyplass", - "Adult": "Voksen", "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.", "Already a friend?": "Allerede Friend?", @@ -46,7 +45,6 @@ "Check in": "Sjekk inn", "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.", - "Child": "Barn", "Children": "Barn", "Choose room": "Velg rom", "Cities": "Byer", @@ -326,6 +324,7 @@ "Zoom out": "Zoom ut", "as of today": "per i dag", "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.nights": "{totalNights, plural, one {# natt} other {# netter}}", "booking.rooms": "{totalRooms, plural, one {# rom} other {# rom}}", diff --git a/i18n/dictionaries/sv.json b/i18n/dictionaries/sv.json index 942a574cb..3023a1dcc 100644 --- a/i18n/dictionaries/sv.json +++ b/i18n/dictionaries/sv.json @@ -9,7 +9,6 @@ "Add new card": "Lägg till nytt kort", "Address": "Adress", "Airport": "Flygplats", - "Adult": "Vuxen", "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.", "Already a friend?": "Är du redan en vän?", @@ -46,7 +45,6 @@ "Check in": "Checka in", "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.", - "Child": "Barn", "Children": "Barn", "Choose room": "Välj rum", "Cities": "Städer", @@ -325,6 +323,7 @@ "Zoom in": "Zooma in", "Zoom out": "Zooma ut", "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.nights": "{totalNights, plural, one {# natt} other {# nätter}}", "booking.rooms": "{totalRooms, plural, one {# rum} other {# rum}}",