diff --git a/website/src/components/welcome-promo-modal.test.ts b/website/src/components/welcome-promo-modal.test.ts index 7d4da30415e7..73d5b8c44673 100644 --- a/website/src/components/welcome-promo-modal.test.ts +++ b/website/src/components/welcome-promo-modal.test.ts @@ -3,12 +3,17 @@ import { LOCALES } from "@/lib/locales"; import { isWelcomePromoHomepage, shouldSuppressWelcomePromo, WELCOME_PROMO_COPY } from "./welcome-promo-modal"; describe("welcome promotion modal", () => { + test("uses a limited-time free label for the English free-trial offer", () => { + expect(WELCOME_PROMO_COPY.en.freeLimited).toBe("Free for a limited time"); + }); + test("provides translated copy for every website locale", () => { expect(Object.keys(WELCOME_PROMO_COPY).sort()).toEqual([...LOCALES].sort()); for (const locale of LOCALES) { const copy = WELCOME_PROMO_COPY[locale]; expect(copy.title.length).toBeGreaterThan(1); expect(copy.topup.length).toBeGreaterThan(10); + expect(copy.freeLimited.length).toBeGreaterThan(1); expect(copy.closeLabel.length).toBeGreaterThan(1); } for (const locale of LOCALES.filter((item) => item !== "en" && item !== "id")) { diff --git a/website/src/components/welcome-promo-modal.tsx b/website/src/components/welcome-promo-modal.tsx index 953f6c830dfb..d091c6ee9a57 100644 --- a/website/src/components/welcome-promo-modal.tsx +++ b/website/src/components/welcome-promo-modal.tsx @@ -12,7 +12,7 @@ type WelcomePromoCopy = { topup: string; getApiKey: string; exploreModels: string; - freeToTry: string; + freeLimited: string; off: string; closeLabel: string; dialogLabel: string; @@ -27,7 +27,7 @@ export const WELCOME_PROMO_COPY: Record = withIdFallba topup: "Top up your account – additional 80% off", getApiKey: "Get API Key", exploreModels: "Explore Models", - freeToTry: "Free to try", + freeLimited: "Free for a limited time", off: "55% off", closeLabel: "Close promotion", dialogLabel: "Free trial promotion", @@ -40,7 +40,7 @@ export const WELCOME_PROMO_COPY: Record = withIdFallba topup: "充值到账户,额外享受 80% 折扣", getApiKey: "获取 API 密钥", exploreModels: "探索模型", - freeToTry: "免费试用", + freeLimited: "限时免费", off: "55% 折扣", closeLabel: "关闭优惠弹窗", dialogLabel: "免费试用优惠", @@ -53,7 +53,7 @@ export const WELCOME_PROMO_COPY: Record = withIdFallba topup: "Recarga tu cuenta y obtén un 80 % de descuento adicional", getApiKey: "Obtener clave API", exploreModels: "Explorar modelos", - freeToTry: "Prueba gratis", + freeLimited: "Gratis por tiempo limitado", off: "55 % de descuento", closeLabel: "Cerrar promoción", dialogLabel: "Promoción de prueba gratis", @@ -66,7 +66,7 @@ export const WELCOME_PROMO_COPY: Record = withIdFallba topup: "Rechargez votre compte : 80 % de remise supplémentaire", getApiKey: "Obtenir une clé API", exploreModels: "Explorer les modèles", - freeToTry: "Essai gratuit", + freeLimited: "Gratuit pour une durée limitée", off: "55 % de remise", closeLabel: "Fermer la promotion", dialogLabel: "Promotion d'essai gratuit", @@ -79,7 +79,7 @@ export const WELCOME_PROMO_COPY: Record = withIdFallba topup: "Adicione saldo à conta e ganhe 80% de desconto adicional", getApiKey: "Obter chave de API", exploreModels: "Explorar modelos", - freeToTry: "Teste grátis", + freeLimited: "Grátis por tempo limitado", off: "55% de desconto", closeLabel: "Fechar promoção", dialogLabel: "Promoção de teste grátis", @@ -92,7 +92,7 @@ export const WELCOME_PROMO_COPY: Record = withIdFallba topup: "Пополните счёт и получите дополнительные 80% скидки", getApiKey: "Получить API-ключ", exploreModels: "Изучить модели", - freeToTry: "Бесплатно", + freeLimited: "Бесплатно на ограниченный срок", off: "Скидка 55%", closeLabel: "Закрыть акцию", dialogLabel: "Акция бесплатного пробного периода", @@ -105,7 +105,7 @@ export const WELCOME_PROMO_COPY: Record = withIdFallba topup: "アカウントにチャージすると、さらに 80% OFF", getApiKey: "API キーを取得", exploreModels: "モデルを見る", - freeToTry: "無料で試す", + freeLimited: "期間限定無料", off: "55% OFF", closeLabel: "キャンペーンを閉じる", dialogLabel: "無料トライアルキャンペーン", @@ -118,7 +118,7 @@ export const WELCOME_PROMO_COPY: Record = withIdFallba topup: "Nạp tiền vào tài khoản để được giảm thêm 80%", getApiKey: "Lấy API key", exploreModels: "Khám phá model", - freeToTry: "Dùng thử miễn phí", + freeLimited: "Miễn phí có thời hạn", off: "Giảm 55%", closeLabel: "Đóng khuyến mãi", dialogLabel: "Khuyến mãi dùng thử miễn phí", @@ -131,7 +131,7 @@ export const WELCOME_PROMO_COPY: Record = withIdFallba topup: "Laden Sie Ihr Konto auf und erhalten Sie zusätzlich 80 % Rabatt", getApiKey: "API-Key abrufen", exploreModels: "Modelle entdecken", - freeToTry: "Kostenlos testen", + freeLimited: "Zeitlich begrenzt kostenlos", off: "55 % Rabatt", closeLabel: "Aktion schließen", dialogLabel: "Aktion zum kostenlosen Testen", @@ -146,8 +146,8 @@ type ModelCardProps = { name: string; description: string; offer: string; + secondaryOffer?: string; offerClassName?: string; - highlighted?: boolean; }; const desktopTitleClassByLocale: Record = { @@ -193,11 +193,14 @@ function ModelCard(props: ModelCardProps) { return (
{props.logoAlt} -
+

{props.name}

-

{props.description}

+

{props.description}

+
+
+ {props.secondaryOffer ? : null} + {props.offer}
- {props.offer}
); } @@ -297,7 +300,7 @@ export function WelcomePromoModal({ locale }: { locale: Locale }) {
- +