From 8378267d8fc528dd14790e0100e45d8b1233ceda Mon Sep 17 00:00:00 2001 From: yinglj Date: Mon, 1 Apr 2024 10:28:12 +0800 Subject: [PATCH] Fix the locale of stripe payment page --- client/src/components/Profile/index.tsx | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/client/src/components/Profile/index.tsx b/client/src/components/Profile/index.tsx index 46b76fe605c..668533cf704 100644 --- a/client/src/components/Profile/index.tsx +++ b/client/src/components/Profile/index.tsx @@ -39,6 +39,8 @@ function ProfileContent() { const { userId = '' } = useParams(); const { user, token } = useAuthContext(); const localize = useLocalize(); + let lang = localStorage.getItem('lang'); + lang = lang ? lang.substring(0, 2) : 'en'; const navigate = useNavigate(); useDocumentTitle('Profile'); @@ -471,7 +473,7 @@ function ProfileContent() { className="rounded bg-green-500 px-4 py-1 text-white hover:bg-green-600" onClick={() => window.open( - `${startupConfig?.proMemberPaymentURL}?locale=${navigator.language}&prefilled_email=${profileUser?.email}`, + `${startupConfig?.proMemberPaymentURL}?locale=${lang}&prefilled_email=${profileUser?.email}`, ) } > @@ -488,7 +490,7 @@ function ProfileContent() { className="rounded bg-green-500 px-4 py-1 text-white hover:bg-green-600" onClick={() => window.open( - `${startupConfig?.proMemberPaymentURL}?locale=${navigator.language}&prefilled_email=${profileUser?.email}`, + `${startupConfig?.proMemberPaymentURL}?locale=${lang}&prefilled_email=${profileUser?.email}`, ) } >