Skip to content

Commit

Permalink
Merge pull request #188 from aitok-ai/jinshi/fix-payment-locale
Browse files Browse the repository at this point in the history
Fix stripe payment page locale
  • Loading branch information
jinzishuai authored Apr 1, 2024
2 parents 520c59a + 8378267 commit 2f30f06
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions client/src/components/Profile/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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');

Expand Down Expand Up @@ -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}`,
)
}
>
Expand All @@ -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}`,
)
}
>
Expand Down

0 comments on commit 2f30f06

Please sign in to comment.