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

@@ -41,7 +41,8 @@ export function useGuaranteeBooking({
})
toast.error(
intl.formatMessage({
id: "We had an issue guaranteeing your booking. Please try again.",
defaultMessage:
"We had an issue guaranteeing your booking. Please try again.",
})
)
},

View File

@@ -19,15 +19,18 @@ export function useGuaranteePaymentFailedToast() {
switch (errorCode) {
case BookingErrorCodeEnum.TransactionCancelled:
return intl.formatMessage({
id: "You have cancelled to process to guarantee your booking.",
defaultMessage:
"You have cancelled to process to guarantee your booking.",
})
case "AncillaryFailed":
return intl.formatMessage({
id: "The product could not be added. Your booking is guaranteed. Please try again.",
defaultMessage:
"The product could not be added. Your booking is guaranteed. Please try again.",
})
default:
return intl.formatMessage({
id: "We had an issue guaranteeing your booking. Please try again.",
defaultMessage:
"We had an issue guaranteeing your booking. Please try again.",
})
}
},

View File

@@ -23,11 +23,12 @@ export function usePaymentFailedToast() {
switch (errorCode) {
case BookingErrorCodeEnum.TransactionCancelled:
return intl.formatMessage({
id: "You have now cancelled your payment.",
defaultMessage: "You have now cancelled your payment.",
})
default:
return intl.formatMessage({
id: "We had an issue processing your booking. Please try again. No charges have been made.",
defaultMessage:
"We had an issue processing your booking. Please try again. No charges have been made.",
})
}
},

View File

@@ -4,21 +4,33 @@ import { useIntl } from "react-intl"
export default function useRateTitles() {
const intl = useIntl()
const payNow = intl.formatMessage({ id: "Pay now" })
const payNow = intl.formatMessage({
defaultMessage: "Pay now",
})
return {
change: {
paymentTerm: payNow,
title: intl.formatMessage({ id: "Free rebooking" }),
title: intl.formatMessage({
defaultMessage: "Free rebooking",
}),
},
flex: {
paymentTerm: intl.formatMessage({ id: "Pay later" }),
title: intl.formatMessage({ id: "Free cancellation" }),
paymentTerm: intl.formatMessage({
defaultMessage: "Pay later",
}),
title: intl.formatMessage({
defaultMessage: "Free cancellation",
}),
},
save: {
paymentTerm: payNow,
title: intl.formatMessage({ id: "Non-refundable" }),
title: intl.formatMessage({
defaultMessage: "Non-refundable",
}),
},
noPriceAvailable: intl.formatMessage({ id: "No prices available" }),
noPriceAvailable: intl.formatMessage({
defaultMessage: "No prices available",
}),
}
}