From 39645cdd84d91ccaa5dee37169c779ee56c79f9c Mon Sep 17 00:00:00 2001 From: RockChinQ Date: Fri, 23 Oct 2026 11:43:15 +0800 Subject: [PATCH] fix(web): keep the dedicated-environment link on a custom Cloud banner (#2760) * fix(web): keep the dedicated-environment link on a custom Cloud banner The Cloud banner can carry per-language copy, but the custom-copy branch rendered that text alone: everything else in the banner swaps the built-in message for an override so the operator can say what is actually happening, and doing so silently dropped the link to the dedicated environment -- the only destination that turns a warning into an upgrade. Render the dedicated link after the override when show_links is on, using new cta_dedicated copy in every locale so the second half of the sentence reads as a call to action rather than repeating the environment name. * test(web): expect the new banner CTA copy in every locale --- web/src/components/CloudBanner.tsx | 14 +++++++++++++- web/src/i18n/locales/en-US.ts | 1 + web/src/i18n/locales/es-ES.ts | 1 + web/src/i18n/locales/ja-JP.ts | 1 + web/src/i18n/locales/ru-RU.ts | 1 + web/src/i18n/locales/th-TH.ts | 1 + web/src/i18n/locales/vi-VN.ts | 1 + web/src/i18n/locales/zh-Hans.ts | 1 + web/src/i18n/locales/zh-Hant.ts | 1 + web/tests/unit/cloud-banner.test.mjs | 1 + 10 files changed, 22 insertions(+), 1 deletion(-) diff --git a/web/src/components/CloudBanner.tsx b/web/src/components/CloudBanner.tsx index 119ea5dca..4f9c9868d 100644 --- a/web/src/components/CloudBanner.tsx +++ b/web/src/components/CloudBanner.tsx @@ -178,7 +178,19 @@ export function CloudBanner() {
{customCopy ? ( - customCopy + <> + {customCopy}{' '} + {banner.show_links && ( + + {t('cloud_banner.cta_dedicated')} + + )} + ) : ( <> {t('cloud_banner.message')}{' '} diff --git a/web/src/i18n/locales/en-US.ts b/web/src/i18n/locales/en-US.ts index a06dcb8c1..a34b14b6c 100644 --- a/web/src/i18n/locales/en-US.ts +++ b/web/src/i18n/locales/en-US.ts @@ -3768,6 +3768,7 @@ const enUS = { message: 'You are using LangBot Cloud, the managed service. For dedicated capacity and higher quotas, consider', dedicated_link: 'LangBot Cloud (dedicated environment)', + cta_dedicated: 'see dedicated plans', or: 'or', self_hosted_link: 'the self-hosted open-source version', period: '.', diff --git a/web/src/i18n/locales/es-ES.ts b/web/src/i18n/locales/es-ES.ts index 2ac0e6e60..9fc2930a1 100644 --- a/web/src/i18n/locales/es-ES.ts +++ b/web/src/i18n/locales/es-ES.ts @@ -3836,6 +3836,7 @@ const esES = { message: 'Estás usando LangBot Cloud, el servicio gestionado. Para obtener recursos dedicados y cuotas mayores, considera usar', dedicated_link: 'LangBot Cloud (entorno dedicado)', + cta_dedicated: 'ver los planes dedicados', or: 'o', self_hosted_link: 'la versión de código abierto autoalojada', period: '.', diff --git a/web/src/i18n/locales/ja-JP.ts b/web/src/i18n/locales/ja-JP.ts index a38943157..f37bd4939 100644 --- a/web/src/i18n/locales/ja-JP.ts +++ b/web/src/i18n/locales/ja-JP.ts @@ -3779,6 +3779,7 @@ const jaJP = { message: '現在は LangBot Cloud のマネージド環境です。専用リソースと高い利用上限が必要な場合は、', dedicated_link: 'LangBot Cloud(専用環境)', + cta_dedicated: '専用環境のプランを見る', or: 'または', self_hosted_link: 'セルフホスト版', period: 'をご検討ください。', diff --git a/web/src/i18n/locales/ru-RU.ts b/web/src/i18n/locales/ru-RU.ts index cbac723d9..c0fe6abc8 100644 --- a/web/src/i18n/locales/ru-RU.ts +++ b/web/src/i18n/locales/ru-RU.ts @@ -3794,6 +3794,7 @@ const ruRU = { message: 'Вы используете LangBot Cloud — управляемый сервис. Для выделенных ресурсов и повышенных лимитов рекомендуем', dedicated_link: 'LangBot Cloud (выделенная среда)', + cta_dedicated: 'посмотреть выделенные планы', or: 'или', self_hosted_link: 'версию с открытым исходным кодом на своём сервере', period: '.', diff --git a/web/src/i18n/locales/th-TH.ts b/web/src/i18n/locales/th-TH.ts index 834566e94..9f79c7612 100644 --- a/web/src/i18n/locales/th-TH.ts +++ b/web/src/i18n/locales/th-TH.ts @@ -3695,6 +3695,7 @@ const thTH = { message: 'คุณกำลังใช้งาน LangBot Cloud ซึ่งเป็นบริการแบบมีการจัดการ หากต้องการทรัพยากรเฉพาะและโควตาที่สูงขึ้น โปรดพิจารณาใช้', dedicated_link: 'LangBot Cloud (สภาพแวดล้อมเฉพาะ)', + cta_dedicated: 'ดูแพ็กเกจสภาพแวดล้อมเฉพาะ', or: 'หรือ', self_hosted_link: 'เวอร์ชันโอเพนซอร์สที่โฮสต์เอง', period: '', diff --git a/web/src/i18n/locales/vi-VN.ts b/web/src/i18n/locales/vi-VN.ts index e0a8e2feb..7d13960aa 100644 --- a/web/src/i18n/locales/vi-VN.ts +++ b/web/src/i18n/locales/vi-VN.ts @@ -3749,6 +3749,7 @@ const viVN = { message: 'Bạn đang sử dụng LangBot Cloud, dịch vụ được quản lý. Nếu cần tài nguyên riêng và hạn mức cao hơn, hãy cân nhắc', dedicated_link: 'LangBot Cloud (môi trường riêng)', + cta_dedicated: 'xem các gói môi trường riêng', or: 'hoặc', self_hosted_link: 'phiên bản mã nguồn mở tự lưu trữ', period: '.', diff --git a/web/src/i18n/locales/zh-Hans.ts b/web/src/i18n/locales/zh-Hans.ts index 96695503f..ba1d97d1b 100644 --- a/web/src/i18n/locales/zh-Hans.ts +++ b/web/src/i18n/locales/zh-Hans.ts @@ -3550,6 +3550,7 @@ const zhHans = { cloud_banner: { message: '当前为 LangBot Cloud 云服务环境。如需独享资源与更高配额,可选择', dedicated_link: '独立环境版 LangBot Cloud', + cta_dedicated: '查看独立环境套餐', or: '或', self_hosted_link: '自部署开源版本', period: '。', diff --git a/web/src/i18n/locales/zh-Hant.ts b/web/src/i18n/locales/zh-Hant.ts index a1efb250e..998993710 100644 --- a/web/src/i18n/locales/zh-Hant.ts +++ b/web/src/i18n/locales/zh-Hant.ts @@ -3551,6 +3551,7 @@ const zhHant = { message: '目前為 LangBot Cloud 雲端服務環境。如需專屬資源與更高配額,可選擇', dedicated_link: '獨立環境版 LangBot Cloud', + cta_dedicated: '查看獨立環境套餐', or: '或', self_hosted_link: '自行部署的開源版本', period: '。', diff --git a/web/tests/unit/cloud-banner.test.mjs b/web/tests/unit/cloud-banner.test.mjs index ab899bbae..d13540840 100644 --- a/web/tests/unit/cloud-banner.test.mjs +++ b/web/tests/unit/cloud-banner.test.mjs @@ -75,6 +75,7 @@ test('every locale carries the cloud_banner copy', () => { const expectedKeys = [ 'message', 'dedicated_link', + 'cta_dedicated', 'or', 'self_hosted_link', 'period',