From efc6384490e455f71b329544ee7e442d18175b9d Mon Sep 17 00:00:00 2001 From: rustdesk Date: Fri, 17 Apr 2026 22:53:01 +0800 Subject: [PATCH] select currency --- v3/build.sh | 1 + v3/src/components/widgets/Pricing.astro | 279 +++++++++++++++++++++--- v3/src/pages/ar/pricing.astro | 17 +- v3/src/pages/de/pricing.astro | 17 +- v3/src/pages/es/pricing.astro | 17 +- v3/src/pages/fr/pricing.astro | 17 +- v3/src/pages/it/pricing.astro | 17 +- v3/src/pages/ja/pricing.astro | 17 +- v3/src/pages/ko/pricing.astro | 17 +- v3/src/pages/pricing.astro | 17 +- v3/src/pages/pt/pricing.astro | 17 +- v3/src/pages/zh-cn/pricing.astro | 22 +- v3/src/pages/zh-tw/pricing.astro | 17 +- v3/src/types.d.ts | 11 + v3/zh/pricing.html | 4 +- 15 files changed, 429 insertions(+), 58 deletions(-) diff --git a/v3/build.sh b/v3/build.sh index e0f213fc..f116dcb9 100755 --- a/v3/build.sh +++ b/v3/build.sh @@ -11,6 +11,7 @@ ln -s careers/index.html careers.html ln -s open-source/index.html open-source.html ln -s ../v2/self-host + ln -s ../currencies.json ln -s ../v2/web cp -rf ../zh ./ tar czf x * diff --git a/v3/src/components/widgets/Pricing.astro b/v3/src/components/widgets/Pricing.astro index a2a74c6b..1db44380 100644 --- a/v3/src/components/widgets/Pricing.astro +++ b/v3/src/components/widgets/Pricing.astro @@ -5,17 +5,29 @@ import Headline from '~/components/ui/Headline.astro'; import WidgetWrapper from '~/components/ui/WidgetWrapper.astro'; import type { Pricing as Props } from '~/types'; +const defaultCurrencyCopy = { + title: 'Select payment currency', + label: 'Payment currency', + tip: 'The currency you choose will also be used on your invoice.', + emailTip: 'After successful payment, you will receive your invoice and license by email. Please enter the correct email address on the next payment page.', + businessTip: 'If you need a business invoice with your business name and tax number, please check the "I\'m purchasing as a business" checkbox on the next payment page.', + confirm: 'Continue to checkout', + cancel: 'Cancel', +} as const; + const { title = '', subtitle = '', tagline = '', prices = [], + currencyCopy = defaultCurrencyCopy, id, isDark = false, classes = {}, bg = await Astro.slots.render('bg'), } = Astro.props; +const defaultCurrency = 'USD'; --- @@ -29,8 +41,8 @@ const { > { prices && - prices.map( - ({ + prices.map((priceItem, index) => { + const { title, subtitle, price, @@ -42,7 +54,9 @@ const { content, id, ribbonTitle, - }) => ( + } = priceItem; + + return (
)}
-
- $ - - - +
+
+ $ + + + + + USD + +
{period}
@@ -96,36 +115,236 @@ const { )}
{content && } - {callToAction && ( -
- {typeof callToAction === 'string' ? ( - - ) : ( - callToAction && - (callToAction.href || callToAction.onclick) && ( -
)} -
- )} - {callToAction2 && ( -
- {typeof callToAction2 === 'string' ? ( - - ) : ( - callToAction2 && - (callToAction2.href || callToAction2.onclick) && ( -
)} )} )} - ) - ) + ); + }) }
+ + diff --git a/v3/src/pages/ar/pricing.astro b/v3/src/pages/ar/pricing.astro index d7bd0fb5..082c0f76 100644 --- a/v3/src/pages/ar/pricing.astro +++ b/v3/src/pages/ar/pricing.astro @@ -70,17 +70,28 @@ const faqItems = faqRawItems.map((item) => ({ answer: item.description.replace(/<[^>]*>/g, ''), })); +const currencyCopy = { + title: 'اختر عملة الدفع', + label: 'عملة الدفع', + tip: 'العملة التي تختارها ستُستخدم أيضًا في فاتورتك.', + emailTip: 'بعد إتمام الدفع بنجاح، ستتلقى الفاتورة والترخيص عبر البريد الإلكتروني. يرجى إدخال عنوان البريد الإلكتروني الصحيح في صفحة الدفع التالية.', + businessTip: 'إذا كنت بحاجة إلى فاتورة عمل تتضمن اسم الشركة ورقمها الضريبي، فيرجى تحديد مربع الاختيار "أقوم بالشراء بصفتي شركة" في صفحة الدفع التالية.', + confirm: 'متابعة إلى الدفع', + cancel: 'إلغاء', +}; + ---