logoPay4SaaS
Core Concepts

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_LOCALE_SITE:

# International site — do not set NEXT_PUBLIC_LOCALE_SITE
NEXT_PUBLIC_SITE_URL=https://www.example.com

# Domestic site — set NEXT_PUBLIC_LOCALE_SITE=cn
NEXT_PUBLIC_LOCALE_SITE=cn
NEXT_PUBLIC_SITE_URL=https://www.example.cn

When NEXT_PUBLIC_LOCALE_SITE=cn is set, the site switches to domestic mode (CNY, Chinese defaults, etc.). See Dual-Domain Setup for the full configuration guide.

What Switches Automatically

DimensionInternational SiteDomestic Site
CurrencyUSD ($)CNY (¥)
Pricesamount / priceMonthlyamountCNY / priceMonthlyCNY
PaymentManually configured via NEXT_PUBLIC_PAYMENT_PROVIDERSManually configured via NEXT_PUBLIC_PAYMENT_PROVIDERS
LanguageEnglishChinese

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,stripe

Separate multiple providers with commas. However, we recommend configuring only one payment provider per site for the best conversion — see Best Way to Display Payment Options for SaaS for details. The pricing page will automatically display the provider(s) 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

Docs home

Return to the full implementation guide.

Pricing

Review subscriptions, credits, and lifetime options.

Blog

Read more notes on SaaS payments and growth.

On this page