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
This commit is contained in:
RockChinQ
2026-10-23 11:43:15 +08:00
committed by GitHub
parent c538e696b2
commit 39645cdd84
10 changed files with 22 additions and 1 deletions
+13 -1
View File
@@ -178,7 +178,19 @@ export function CloudBanner() {
<div className="flex w-full items-start gap-3">
<span className="flex-1">
{customCopy ? (
customCopy
<>
{customCopy}{' '}
{banner.show_links && (
<a
href={banner.dedicated_url}
target="_blank"
rel="noopener noreferrer"
className="font-medium underline hover:opacity-80"
>
{t('cloud_banner.cta_dedicated')}
</a>
)}
</>
) : (
<>
{t('cloud_banner.message')}{' '}
+1
View File
@@ -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: '.',
+1
View File
@@ -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: '.',
+1
View File
@@ -3779,6 +3779,7 @@ const jaJP = {
message:
'現在は LangBot Cloud のマネージド環境です。専用リソースと高い利用上限が必要な場合は、',
dedicated_link: 'LangBot Cloud(専用環境)',
cta_dedicated: '専用環境のプランを見る',
or: 'または',
self_hosted_link: 'セルフホスト版',
period: 'をご検討ください。',
+1
View File
@@ -3794,6 +3794,7 @@ const ruRU = {
message:
'Вы используете LangBot Cloud — управляемый сервис. Для выделенных ресурсов и повышенных лимитов рекомендуем',
dedicated_link: 'LangBot Cloud (выделенная среда)',
cta_dedicated: 'посмотреть выделенные планы',
or: 'или',
self_hosted_link: 'версию с открытым исходным кодом на своём сервере',
period: '.',
+1
View File
@@ -3695,6 +3695,7 @@ const thTH = {
message:
'คุณกำลังใช้งาน LangBot Cloud ซึ่งเป็นบริการแบบมีการจัดการ หากต้องการทรัพยากรเฉพาะและโควตาที่สูงขึ้น โปรดพิจารณาใช้',
dedicated_link: 'LangBot Cloud (สภาพแวดล้อมเฉพาะ)',
cta_dedicated: 'ดูแพ็กเกจสภาพแวดล้อมเฉพาะ',
or: 'หรือ',
self_hosted_link: 'เวอร์ชันโอเพนซอร์สที่โฮสต์เอง',
period: '',
+1
View File
@@ -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: '.',
+1
View File
@@ -3550,6 +3550,7 @@ const zhHans = {
cloud_banner: {
message: '当前为 LangBot Cloud 云服务环境。如需独享资源与更高配额,可选择',
dedicated_link: '独立环境版 LangBot Cloud',
cta_dedicated: '查看独立环境套餐',
or: '或',
self_hosted_link: '自部署开源版本',
period: '。',
+1
View File
@@ -3551,6 +3551,7 @@ const zhHant = {
message:
'目前為 LangBot Cloud 雲端服務環境。如需專屬資源與更高配額,可選擇',
dedicated_link: '獨立環境版 LangBot Cloud',
cta_dedicated: '查看獨立環境套餐',
or: '或',
self_hosted_link: '自行部署的開源版本',
period: '。',