i18n & Currency
Pay4SaaS supports bilingual (Chinese/English) content and automatic currency switching, targeting both domestic (China) and international markets.
Site Detection
The system determines whether the current site is domestic or international based on NEXT_PUBLIC_SITE_URL:
NEXT_PUBLIC_SITE_URL=https://example.com # International site
NEXT_PUBLIC_SITE_URL=https://example.cn # Domestic site (.cn suffix)URLs ending with .cn are recognized as domestic sites. You can also configure other top-level domains to be recognized as domestic in config/site.ts.
What Switches Automatically
| Dimension | International Site | Domestic Site |
|---|---|---|
| Currency | USD ($) | CNY (¥) |
| Prices | amount / priceMonthly | amountCNY / priceMonthlyCNY |
| Payment | Manually configured via NEXT_PUBLIC_PAYMENT_PROVIDERS | Manually configured via NEXT_PUBLIC_PAYMENT_PROVIDERS |
| Language | English | Chinese |
Price Switching
In config/payment.ts, each plan can have both USD and CNY prices configured:
basic: {
amount: 9.99, // USD (used on international site)
amountCNY: 29, // CNY (used on domestic site)
// ...
}If amountCNY is not configured, the domestic site will use the USD price (no automatic currency conversion).
Payment Provider Override
Payment providers must be configured manually via environment variables — there are no defaults:
NEXT_PUBLIC_PAYMENT_PROVIDERS=paypal,creem,stripeSeparate multiple providers with commas. The pricing page will display the providers you've enabled.
Documentation i18n
Documentation uses Fumadocs' file naming convention for Chinese/English separation:
content/docs/
├── index.mdx # English version
├── index.cn.mdx # Chinese version
├── pricing-models.mdx
├── pricing-models.cn.mdx
└── ...- English docs:
/docs/xxx - Chinese docs:
/cn/docs/xxx