feat(SW-706): make eslint rule 'formatjs/no-literal-string-in-jsx' pass

This commit is contained in:
Michael Zetterberg
2025-02-07 06:51:36 +01:00
parent e22fc1f3c8
commit 440e1f92df
393 changed files with 4839 additions and 1554 deletions

View File

@@ -87,7 +87,10 @@ export async function getTitle(data: RawMetadataSchema) {
)
if (restaurantSubPage) {
return intl.formatMessage(
{ id: "Explore {restaurantName} at {hotelName} in {destination}" },
{
defaultMessage:
"Explore {restaurantName} at {hotelName} in {destination}",
},
{
restaurantName: restaurantSubPage.name,
hotelName: data.hotelData.name,
@@ -99,7 +102,10 @@ export async function getTitle(data: RawMetadataSchema) {
switch (data.subpageUrl) {
case data.additionalHotelData?.hotelParking.nameInUrl:
return intl.formatMessage(
{ id: "Parking information for {hotelName} in {destination}" },
{
defaultMessage:
"Parking information for {hotelName} in {destination}",
},
{
hotelName: data.hotelData.name,
destination: data.hotelData.address.city,
@@ -107,7 +113,10 @@ export async function getTitle(data: RawMetadataSchema) {
)
case data.additionalHotelData?.healthAndFitness.nameInUrl:
return intl.formatMessage(
{ id: "Gym & Health Facilities at {hotelName} in {destination}" },
{
defaultMessage:
"Gym & Health Facilities at {hotelName} in {destination}",
},
{
hotelName: data.hotelData.name,
destination: data.hotelData.address.city,
@@ -116,7 +125,8 @@ export async function getTitle(data: RawMetadataSchema) {
case data.additionalHotelData?.hotelSpecialNeeds.nameInUrl:
return intl.formatMessage(
{
id: "Accessibility information for {hotelName} in {destination}",
defaultMessage:
"Accessibility information for {hotelName} in {destination}",
},
{
hotelName: data.hotelData.name,
@@ -126,7 +136,8 @@ export async function getTitle(data: RawMetadataSchema) {
case data.additionalHotelData?.meetingRooms.nameInUrl:
return intl.formatMessage(
{
id: "Meetings, Conferences & Events at {hotelName} in {destination}",
defaultMessage:
"Meetings, Conferences & Events at {hotelName} in {destination}",
},
{
hotelName: data.hotelData.name,
@@ -138,7 +149,9 @@ export async function getTitle(data: RawMetadataSchema) {
}
}
return intl.formatMessage(
{ id: "Stay at {hotelName} | Hotel in {destination}" },
{
defaultMessage: "Stay at {hotelName} | Hotel in {destination}",
},
{
hotelName: data.hotelData.name,
destination: data.hotelData.address.city,
@@ -154,17 +167,26 @@ export async function getTitle(data: RawMetadataSchema) {
if (filter) {
if (filterType === "facility") {
return intl.formatMessage(
{ id: "Hotels with {filter} in {location}" },
{
defaultMessage: "Hotels with {filter} in {location}",
},
{ location, filter }
)
} else if (filterType === "surroundings") {
return intl.formatMessage(
{ id: "Hotels near {filter} in {location}" },
{
defaultMessage: "Hotels near {filter} in {location}",
},
{ location, filter }
)
}
}
return intl.formatMessage({ id: "Hotels in {location}" }, { location })
return intl.formatMessage(
{
defaultMessage: "Hotels in {location}",
},
{ location }
)
}
}
if (data.web?.breadcrumbs?.title) {

View File

@@ -125,7 +125,7 @@ export const getHotelsByCSFilterInput = z.object({
hotelsToInclude: z.array(z.string()),
})
export interface GetHotelsByCSFilterInput
extends z.infer<typeof getHotelsByCSFilterInput> { }
extends z.infer<typeof getHotelsByCSFilterInput> {}
export const nearbyHotelIdsInput = z.object({
hotelId: z.string(),

View File

@@ -26,22 +26,30 @@ export const getPrimaryLinks = cache(
const menuItems: MyPagesLink[] = [
{
type: "link",
text: intl.formatMessage({ id: "Overview" }),
text: intl.formatMessage({
defaultMessage: "Overview",
}),
href: routes.overview[lang],
},
{
type: "link",
text: intl.formatMessage({ id: "My points" }),
text: intl.formatMessage({
defaultMessage: "My points",
}),
href: routes.points[lang],
},
{
type: "link",
text: intl.formatMessage({ id: "My stays" }),
text: intl.formatMessage({
defaultMessage: "My stays",
}),
href: routes.stays[lang],
},
{
type: "link",
text: intl.formatMessage({ id: "My benefits" }),
text: intl.formatMessage({
defaultMessage: "My benefits",
}),
href: routes.benefits[lang],
},
]
@@ -49,7 +57,9 @@ export const getPrimaryLinks = cache(
if (showSASLink) {
menuItems.push({
type: "link",
text: intl.formatMessage({ id: "Scandic ♥ SAS" }),
text: intl.formatMessage({
defaultMessage: "Scandic ♥ SAS",
}),
href: routes.partnerSas[lang],
})
}
@@ -57,7 +67,9 @@ export const getPrimaryLinks = cache(
if (showTeamMemberLink) {
menuItems.push({
type: "link",
text: intl.formatMessage({ id: "Team Member Card" }),
text: intl.formatMessage({
defaultMessage: "Team Member Card",
}),
href: "#",
})
}

View File

@@ -14,12 +14,16 @@ export async function getSecondaryLinks({
const menuItems: MyPagesLink[] = [
{
type: "link",
text: intl.formatMessage({ id: "About Scandic Friends" }),
text: intl.formatMessage({
defaultMessage: "About Scandic Friends",
}),
href: routes.scandicFriends[lang],
},
{
type: "link",
text: intl.formatMessage({ id: "My profile" }),
text: intl.formatMessage({
defaultMessage: "My profile",
}),
href: routes.profile[lang],
},
]