From b666bed740642ce1a587a9c55d8707a04159041b Mon Sep 17 00:00:00 2001 From: hailin Date: Sun, 8 Mar 2026 01:48:25 -0800 Subject: [PATCH] =?UTF-8?q?fix:=20show=20OpenClaw=20in=20non-Chinese,=20?= =?UTF-8?q?=E5=B0=8F=E9=BE=99=E8=99=BE=20only=20in=20zh/zh=5FTW?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Flutter app: - app_zh.arb: OpenClaw → 小龙虾 - app_zh_TW.arb: OpenClaw → 小龍蝦 - app_en.arb: revert 小龙虾 back to OpenClaw Web admin: - Add serverPool/openclawInstances keys to en/zh sidebar.json - en: "OpenClaw Instances", zh: "小龙虾实例" - sidebar.tsx: use t() instead of hardcoded strings - openclaw-instances + server-pool pages: use t('openclawInstances') Co-Authored-By: Claude Sonnet 4.6 --- .../src/app/(admin)/openclaw-instances/page.tsx | 6 ++++-- .../src/app/(admin)/server-pool/page.tsx | 6 ++++-- it0-web-admin/src/i18n/locales/en/sidebar.json | 4 +++- it0-web-admin/src/i18n/locales/zh/sidebar.json | 4 +++- .../presentation/components/layout/sidebar.tsx | 4 ++-- it0_app/lib/l10n/app_en.arb | 8 ++++---- it0_app/lib/l10n/app_localizations_en.dart | 8 ++++---- it0_app/lib/l10n/app_localizations_zh.dart | 16 ++++++++-------- it0_app/lib/l10n/app_zh.arb | 8 ++++---- it0_app/lib/l10n/app_zh_TW.arb | 8 ++++---- 10 files changed, 40 insertions(+), 32 deletions(-) diff --git a/it0-web-admin/src/app/(admin)/openclaw-instances/page.tsx b/it0-web-admin/src/app/(admin)/openclaw-instances/page.tsx index c35f8c6..c5197c5 100644 --- a/it0-web-admin/src/app/(admin)/openclaw-instances/page.tsx +++ b/it0-web-admin/src/app/(admin)/openclaw-instances/page.tsx @@ -5,6 +5,7 @@ import { useQuery, useQueryClient } from '@tanstack/react-query'; import { toast } from 'sonner'; import { RefreshCw, Boxes, CheckCircle, AlertCircle, Clock, XCircle, StopCircle } from 'lucide-react'; import { apiClient } from '@/infrastructure/api/api-client'; +import { useTranslation } from 'react-i18next'; interface AgentInstance { id: string; @@ -60,6 +61,7 @@ function formatDate(iso: string) { } export default function OpenClawInstancesPage() { + const { t } = useTranslation('sidebar'); const queryClient = useQueryClient(); const [statusFilter, setStatusFilter] = useState('all'); @@ -113,9 +115,9 @@ export default function OpenClawInstancesPage() { {/* Header */}
-

小龙虾实例

+

{t('openclawInstances')}

- 跨租户查看所有用户的小龙虾智能体实例 + 跨租户查看所有用户的{t('openclawInstances')}智能体实例

diff --git a/it0-web-admin/src/i18n/locales/en/sidebar.json b/it0-web-admin/src/i18n/locales/en/sidebar.json index 9f15b0e..12e5e66 100644 --- a/it0-web-admin/src/i18n/locales/en/sidebar.json +++ b/it0-web-admin/src/i18n/locales/en/sidebar.json @@ -41,5 +41,7 @@ "tenants": "Tenants", "users": "Users", "settings": "Settings", - "collapse": "Collapse" + "collapse": "Collapse", + "serverPool": "Server Pool", + "openclawInstances": "OpenClaw Instances" } diff --git a/it0-web-admin/src/i18n/locales/zh/sidebar.json b/it0-web-admin/src/i18n/locales/zh/sidebar.json index c8d54ef..ea8dba4 100644 --- a/it0-web-admin/src/i18n/locales/zh/sidebar.json +++ b/it0-web-admin/src/i18n/locales/zh/sidebar.json @@ -41,5 +41,7 @@ "tenants": "租户", "users": "用户", "settings": "设置", - "collapse": "折叠" + "collapse": "折叠", + "serverPool": "服务器池", + "openclawInstances": "小龙虾实例" } diff --git a/it0-web-admin/src/presentation/components/layout/sidebar.tsx b/it0-web-admin/src/presentation/components/layout/sidebar.tsx index ca5c4f0..06d04d0 100644 --- a/it0-web-admin/src/presentation/components/layout/sidebar.tsx +++ b/it0-web-admin/src/presentation/components/layout/sidebar.tsx @@ -122,8 +122,8 @@ export function Sidebar() { { key: 'campaigns', label: t('campaigns'), href: '/campaigns', icon: }, { key: 'segments', label: t('segments'), href: '/segments', icon: }, { key: 'notifications', label: t('notifications'), href: '/notifications', icon: }, - { key: 'serverPool', label: '服务器池', href: '/server-pool', icon: }, - { key: 'openclawInstances', label: '小龙虾实例', href: '/openclaw-instances', icon: }, + { key: 'serverPool', label: t('serverPool'), href: '/server-pool', icon: }, + { key: 'openclawInstances', label: t('openclawInstances'), href: '/openclaw-instances', icon: }, { key: 'billing', label: t('billing'), diff --git a/it0_app/lib/l10n/app_en.arb b/it0_app/lib/l10n/app_en.arb index 7d5e262..d406476 100644 --- a/it0_app/lib/l10n/app_en.arb +++ b/it0_app/lib/l10n/app_en.arb @@ -48,20 +48,20 @@ "officialAgent3Desc": "Slow query analysis, index optimization, backup verification", "noOwnAgentsTitle": "No agents yet", - "noOwnAgentsDesc": "Tap the robot button below and tell iAgent:\n\"Recruit a 小龙虾 agent for me\"", + "noOwnAgentsDesc": "Tap the robot button below and tell iAgent:\n\"Recruit an OpenClaw agent for me\"", "quickTipsHeader": "You can say...", "quickTip1": "💬 \"Recruit an agent to monitor GitHub Actions\"", - "quickTip2": "🔧 \"Export my 小龙虾 config as JSON\"", + "quickTip2": "🔧 \"Export my OpenClaw config as JSON\"", "quickTip3": "📊 \"Analyze server load for the past 7 days\"", "quickTip4": "🛡️ \"Set up automatic database backup at 2AM daily\"", "myAgentsTitle": "My Agents", "myAgentsEmptyTitle": "Recruit your own agent", - "myAgentsEmptyDesc": "Chat with iAgent to recruit various agents:\n小龙虾 coding assistant, ops bot, data analyst...", + "myAgentsEmptyDesc": "Chat with iAgent to recruit various agents:\nOpenClaw coding assistant, ops bot, data analyst...", "myAgentsStep1Title": "Tap the robot button", "myAgentsStep1Desc": "Open a conversation with iAgent", "myAgentsStep2Title": "Describe the agent you want", - "myAgentsStep2Desc": "e.g. \"Recruit a 小龙虾 coding assistant for me\"", + "myAgentsStep2Desc": "e.g. \"Recruit an OpenClaw coding assistant for me\"", "myAgentsStep3Title": "iAgent auto-deploys", "myAgentsStep3Desc": "It appears here after deployment. Chat via Telegram/WhatsApp.", "myAgentsTemplatesHeader": "Popular templates (tell iAgent which one you want)", diff --git a/it0_app/lib/l10n/app_localizations_en.dart b/it0_app/lib/l10n/app_localizations_en.dart index 081806a..e4afede 100644 --- a/it0_app/lib/l10n/app_localizations_en.dart +++ b/it0_app/lib/l10n/app_localizations_en.dart @@ -120,7 +120,7 @@ class AppLocalizationsEn extends AppLocalizations { @override String get noOwnAgentsDesc => - 'Tap the robot button below and tell iAgent:\n\"Recruit a 小龙虾 agent for me\"'; + 'Tap the robot button below and tell iAgent:\n\"Recruit an OpenClaw agent for me\"'; @override String get quickTipsHeader => 'You can say...'; @@ -129,7 +129,7 @@ class AppLocalizationsEn extends AppLocalizations { String get quickTip1 => '💬 \"Recruit an agent to monitor GitHub Actions\"'; @override - String get quickTip2 => '🔧 \"Export my 小龙虾 config as JSON\"'; + String get quickTip2 => '🔧 \"Export my OpenClaw config as JSON\"'; @override String get quickTip3 => '📊 \"Analyze server load for the past 7 days\"'; @@ -146,7 +146,7 @@ class AppLocalizationsEn extends AppLocalizations { @override String get myAgentsEmptyDesc => - 'Chat with iAgent to recruit various agents:\n小龙虾 coding assistant, ops bot, data analyst...'; + 'Chat with iAgent to recruit various agents:\nOpenClaw coding assistant, ops bot, data analyst...'; @override String get myAgentsStep1Title => 'Tap the robot button'; @@ -159,7 +159,7 @@ class AppLocalizationsEn extends AppLocalizations { @override String get myAgentsStep2Desc => - 'e.g. \"Recruit a 小龙虾 coding assistant for me\"'; + 'e.g. \"Recruit an OpenClaw coding assistant for me\"'; @override String get myAgentsStep3Title => 'iAgent auto-deploys'; diff --git a/it0_app/lib/l10n/app_localizations_zh.dart b/it0_app/lib/l10n/app_localizations_zh.dart index 20059fc..1933e59 100644 --- a/it0_app/lib/l10n/app_localizations_zh.dart +++ b/it0_app/lib/l10n/app_localizations_zh.dart @@ -116,7 +116,7 @@ class AppLocalizationsZh extends AppLocalizations { String get noOwnAgentsTitle => '还没有自己的智能体'; @override - String get noOwnAgentsDesc => '点击下方机器人按钮,告诉 我智能体\n\"帮我招募一个 OpenClaw 智能体\"'; + String get noOwnAgentsDesc => '点击下方机器人按钮,告诉 我智能体\n\"帮我招募一个 小龙虾 智能体\"'; @override String get quickTipsHeader => '你可以这样说...'; @@ -125,7 +125,7 @@ class AppLocalizationsZh extends AppLocalizations { String get quickTip1 => '💬 \"帮我招募一个监控 GitHub Actions 的智能体\"'; @override - String get quickTip2 => '🔧 \"把我的 OpenClaw 配置导出为 JSON\"'; + String get quickTip2 => '🔧 \"把我的 小龙虾 配置导出为 JSON\"'; @override String get quickTip3 => '📊 \"分析我的服务器最近7天的负载情况\"'; @@ -141,7 +141,7 @@ class AppLocalizationsZh extends AppLocalizations { @override String get myAgentsEmptyDesc => - '通过与 我智能体 对话,你可以招募各种智能体:\nOpenClaw 编程助手、运维机器人、数据分析师...'; + '通过与 我智能体 对话,你可以招募各种智能体:\n小龙虾 编程助手、运维机器人、数据分析师...'; @override String get myAgentsStep1Title => '点击下方机器人'; @@ -153,7 +153,7 @@ class AppLocalizationsZh extends AppLocalizations { String get myAgentsStep2Title => '描述你想要的智能体'; @override - String get myAgentsStep2Desc => '例如:\"帮我招募一个 OpenClaw 编程助手\"'; + String get myAgentsStep2Desc => '例如:\"帮我招募一个 小龙虾 编程助手\"'; @override String get myAgentsStep3Title => '我智能体 自动部署'; @@ -1139,7 +1139,7 @@ class AppLocalizationsZhTw extends AppLocalizationsZh { String get noOwnAgentsTitle => '還沒有自己的智能體'; @override - String get noOwnAgentsDesc => '點擊下方機器人按鈕,告訴 我智能體\n\"幫我招募一個 OpenClaw 智能體\"'; + String get noOwnAgentsDesc => '點擊下方機器人按鈕,告訴 我智能體\n\"幫我招募一個 小龍蝦 智能體\"'; @override String get quickTipsHeader => '你可以這樣說...'; @@ -1148,7 +1148,7 @@ class AppLocalizationsZhTw extends AppLocalizationsZh { String get quickTip1 => '💬 \"幫我招募一個監控 GitHub Actions 的智能體\"'; @override - String get quickTip2 => '🔧 \"把我的 OpenClaw 配置匯出為 JSON\"'; + String get quickTip2 => '🔧 \"把我的 小龍蝦 配置匯出為 JSON\"'; @override String get quickTip3 => '📊 \"分析我的伺服器最近7天的負載情況\"'; @@ -1164,13 +1164,13 @@ class AppLocalizationsZhTw extends AppLocalizationsZh { @override String get myAgentsEmptyDesc => - '透過與 我智能體 對話,你可以招募各種智能體:\nOpenClaw 程式助手、運維機器人、資料分析師...'; + '透過與 我智能體 對話,你可以招募各種智能體:\n小龍蝦 程式助手、運維機器人、資料分析師...'; @override String get myAgentsStep1Desc => '打開與 我智能體 的對話視窗'; @override - String get myAgentsStep2Desc => '例如:\"幫我招募一個 OpenClaw 程式助手\"'; + String get myAgentsStep2Desc => '例如:\"幫我招募一個 小龍蝦 程式助手\"'; @override String get myAgentsStep3Title => '我智能體 自動部署'; diff --git a/it0_app/lib/l10n/app_zh.arb b/it0_app/lib/l10n/app_zh.arb index 4c038e2..a7ab00e 100644 --- a/it0_app/lib/l10n/app_zh.arb +++ b/it0_app/lib/l10n/app_zh.arb @@ -48,20 +48,20 @@ "officialAgent3Desc": "慢查询分析、索引优化、备份验证", "noOwnAgentsTitle": "还没有自己的智能体", - "noOwnAgentsDesc": "点击下方机器人按钮,告诉 我智能体\n\"帮我招募一个 OpenClaw 智能体\"", + "noOwnAgentsDesc": "点击下方机器人按钮,告诉 我智能体\n\"帮我招募一个 小龙虾 智能体\"", "quickTipsHeader": "你可以这样说...", "quickTip1": "💬 \"帮我招募一个监控 GitHub Actions 的智能体\"", - "quickTip2": "🔧 \"把我的 OpenClaw 配置导出为 JSON\"", + "quickTip2": "🔧 \"把我的 小龙虾 配置导出为 JSON\"", "quickTip3": "📊 \"分析我的服务器最近7天的负载情况\"", "quickTip4": "🛡️ \"帮我设置每天凌晨2点自动备份数据库\"", "myAgentsTitle": "我的智能体", "myAgentsEmptyTitle": "招募你的专属智能体", - "myAgentsEmptyDesc": "通过与 我智能体 对话,你可以招募各种智能体:\nOpenClaw 编程助手、运维机器人、数据分析师...", + "myAgentsEmptyDesc": "通过与 我智能体 对话,你可以招募各种智能体:\n小龙虾 编程助手、运维机器人、数据分析师...", "myAgentsStep1Title": "点击下方机器人", "myAgentsStep1Desc": "打开与 我智能体 的对话窗口", "myAgentsStep2Title": "描述你想要的智能体", - "myAgentsStep2Desc": "例如:\"帮我招募一个 OpenClaw 编程助手\"", + "myAgentsStep2Desc": "例如:\"帮我招募一个 小龙虾 编程助手\"", "myAgentsStep3Title": "我智能体 自动部署", "myAgentsStep3Desc": "部署完成后出现在这里,通过 Telegram/WhatsApp 等渠道与它对话", "myAgentsTemplatesHeader": "热门模板(告诉 我智能体 你想要哪种)", diff --git a/it0_app/lib/l10n/app_zh_TW.arb b/it0_app/lib/l10n/app_zh_TW.arb index cdb9579..79924f6 100644 --- a/it0_app/lib/l10n/app_zh_TW.arb +++ b/it0_app/lib/l10n/app_zh_TW.arb @@ -11,18 +11,18 @@ "officialAgent1Desc": "伺服器管理、SSH 執行、日誌分析", "myAgentsSection": "我的智能體", "noOwnAgentsTitle": "還沒有自己的智能體", - "noOwnAgentsDesc": "點擊下方機器人按鈕,告訴 我智能體\n\"幫我招募一個 OpenClaw 智能體\"", + "noOwnAgentsDesc": "點擊下方機器人按鈕,告訴 我智能體\n\"幫我招募一個 小龍蝦 智能體\"", "quickTipsHeader": "你可以這樣說...", "quickTip1": "💬 \"幫我招募一個監控 GitHub Actions 的智能體\"", - "quickTip2": "🔧 \"把我的 OpenClaw 配置匯出為 JSON\"", + "quickTip2": "🔧 \"把我的 小龍蝦 配置匯出為 JSON\"", "quickTip3": "📊 \"分析我的伺服器最近7天的負載情況\"", "quickTip4": "🛡️ \"幫我設置每天凌晨2點自動備份資料庫\"", "myAgentsTitle": "我的智能體", "myAgentsEmptyTitle": "招募你的專屬智能體", - "myAgentsEmptyDesc": "透過與 我智能體 對話,你可以招募各種智能體:\nOpenClaw 程式助手、運維機器人、資料分析師...", + "myAgentsEmptyDesc": "透過與 我智能體 對話,你可以招募各種智能體:\n小龍蝦 程式助手、運維機器人、資料分析師...", "myAgentsStep1Desc": "打開與 我智能體 的對話視窗", - "myAgentsStep2Desc": "例如:\"幫我招募一個 OpenClaw 程式助手\"", + "myAgentsStep2Desc": "例如:\"幫我招募一個 小龍蝦 程式助手\"", "myAgentsStep3Title": "我智能體 自動部署", "myAgentsStep3Desc": "部署完成後出現在這裡,透過 Telegram/WhatsApp 等渠道與它對話", "myAgentsTemplatesHeader": "熱門模板(告訴 我智能體 你想要哪種)",