@@ -60,7 +60,7 @@ export default async function TopMenu({
className={styles.sessionLink}
prefetch={false}
>
- {formatMessage({ id: "Log out" })}
+ {intl.formatMessage({ id: "Log out" })}
>
) : (
@@ -69,7 +69,7 @@ export default async function TopMenu({
trackingId="loginStartTopMenu"
className={`${styles.sessionLink} ${styles.loginLink}`}
>
- {formatMessage({ id: "Log in" })}
+ {intl.formatMessage({ id: "Log in" })}
)}
diff --git a/components/Footer/Details/index.tsx b/components/Footer/Details/index.tsx
index 59b9c2488..cb3a4eb9b 100644
--- a/components/Footer/Details/index.tsx
+++ b/components/Footer/Details/index.tsx
@@ -20,7 +20,7 @@ function SocialIcon({ iconName }: SocialIconsProps) {
export default async function FooterDetails() {
const lang = getLang()
- const { formatMessage } = await getIntl()
+ const intl = await getIntl()
// preloaded
const footer = await getFooter()
const languages = await getLanguageSwitcher()
@@ -58,7 +58,7 @@ export default async function FooterDetails() {
© {currentYear}{" "}
- {formatMessage({ id: "Copyright all rights reserved" })}
+ {intl.formatMessage({ id: "Copyright all rights reserved" })}
diff --git a/components/Header/MainMenu/MyPagesMenuWrapper/index.tsx b/components/Header/MainMenu/MyPagesMenuWrapper/index.tsx
index 14044b248..bf9473f32 100644
--- a/components/Header/MainMenu/MyPagesMenuWrapper/index.tsx
+++ b/components/Header/MainMenu/MyPagesMenuWrapper/index.tsx
@@ -8,7 +8,6 @@ import { serverClient } from "@/lib/trpc/server"
import LoginButton from "@/components/LoginButton"
import { getIntl } from "@/i18n"
-import { getLang } from "@/i18n/serverContext"
import Avatar from "../Avatar"
import MyPagesMenu from "../MyPagesMenu"
@@ -17,7 +16,6 @@ import MyPagesMobileMenu from "../MyPagesMobileMenu"
import styles from "./myPagesMenuWrapper.module.css"
export default async function MyPagesMenuWrapper() {
- const lang = getLang()
const [intl, myPagesNavigation, user, membership] = await Promise.all([
getIntl(),
getMyPagesNavigation(),
diff --git a/components/MyPages/Sidebar/index.tsx b/components/MyPages/Sidebar/index.tsx
index 5c4de4d2d..8a871d253 100644
--- a/components/MyPages/Sidebar/index.tsx
+++ b/components/MyPages/Sidebar/index.tsx
@@ -13,7 +13,7 @@ import styles from "./sidebar.module.css"
export default async function SidebarMyPages() {
const navigation = await getMyPagesNavigation()
- const { formatMessage } = await getIntl()
+ const intl = await getIntl()
return (
@@ -46,7 +46,7 @@ export default async function SidebarMyPages() {
size="small"
variant="sidebar"
>
- {formatMessage({ id: "Log out" })}
+ {intl.formatMessage({ id: "Log out" })}
) : null}
diff --git a/components/Profile/DeleteCreditCardButton/index.tsx b/components/Profile/DeleteCreditCardButton/index.tsx
index 69ebbd21b..1526f10bf 100644
--- a/components/Profile/DeleteCreditCardButton/index.tsx
+++ b/components/Profile/DeleteCreditCardButton/index.tsx
@@ -12,17 +12,19 @@ export default function DeleteCreditCardButton({
}: {
creditCardId: string
}) {
- const { formatMessage } = useIntl()
+ const intl = useIntl()
const trpcUtils = trpc.useUtils()
const deleteCreditCardMutation = trpc.user.creditCard.delete.useMutation({
onSuccess() {
trpcUtils.user.creditCards.invalidate()
- toast.success(formatMessage({ id: "Credit card deleted successfully" }))
+ toast.success(
+ intl.formatMessage({ id: "Credit card deleted successfully" })
+ )
},
onError() {
toast.error(
- formatMessage({
+ intl.formatMessage({
id: "Failed to delete credit card, please try again later.",
})
)
diff --git a/components/SkipToMainContent.tsx b/components/SkipToMainContent.tsx
index c659d4dbf..533b5d58f 100644
--- a/components/SkipToMainContent.tsx
+++ b/components/SkipToMainContent.tsx
@@ -1,11 +1,11 @@
import { getIntl } from "@/i18n"
export default async function SkipToMainContent() {
- const { formatMessage } = await getIntl()
+ const intl = await getIntl()
return (
)
diff --git a/components/TempDesignSystem/Form/Country/index.tsx b/components/TempDesignSystem/Form/Country/index.tsx
index 0a5406640..ea6e1867a 100644
--- a/components/TempDesignSystem/Form/Country/index.tsx
+++ b/components/TempDesignSystem/Form/Country/index.tsx
@@ -34,7 +34,7 @@ export default function CountrySelect({
readOnly = false,
registerOptions = {},
}: CountryProps) {
- const { formatMessage } = useIntl()
+ const intl = useIntl()
const [rootDiv, setRootDiv] = useState(undefined)
function setRef(node: CountryPortalContainerArgs) {
@@ -53,13 +53,12 @@ export default function CountrySelect({
setValue(name, country)
}
- const selectCountryLabel = formatMessage({ id: "Select a country" })
+ const selectCountryLabel = intl.formatMessage({ id: "Select a country" })
return (
- {formatMessage({ id: "Country code" })}
+ {intl.formatMessage({ id: "Country code" })}
{props.children}
diff --git a/components/Webviews/LinkToOverview/index.tsx b/components/Webviews/LinkToOverview/index.tsx
index 8e0a57820..a990d9fce 100644
--- a/components/Webviews/LinkToOverview/index.tsx
+++ b/components/Webviews/LinkToOverview/index.tsx
@@ -10,14 +10,14 @@ import { webviewSearchParams } from "@/utils/webviews"
import styles from "./linkToOverview.module.css"
export default async function LinkToOverview() {
- const { formatMessage } = await getIntl()
+ const intl = await getIntl()
const searchParams = webviewSearchParams()
const overviewHref = `${overview[getLang()]}?${searchParams.toString()}`
return (
{" "}
- {formatMessage({ id: "Go back to overview" })}
+ {intl.formatMessage({ id: "Go back to overview" })}
)
}