mirror of
https://github.com/qingchencloud/clawpanel.git
synced 2026-05-29 04:10:00 +08:00
fix(ui): sync latest upgrade copy in locale bundles
The runtime locale JSON bundles still contained the older About/Services policy copy even after the module-level strings were updated, so the About page could continue to show the old "recommended only" message in Chinese. This syncs the zh-CN/en locale bundles with the latest-upstream upgrade copy and mirrors the suffixed OpenClaw version comparison fix in the Web dev API. ## Verification - npm run build - node --check scripts/dev-api.js - cargo check
This commit is contained in:
@@ -758,15 +758,25 @@ function baseVersion(v) {
|
||||
return String(v || '').split('-')[0]
|
||||
}
|
||||
|
||||
function hasVersionSuffix(v) {
|
||||
return String(v || '').includes('-')
|
||||
}
|
||||
|
||||
// 判断 CLI 版本是否与推荐版匹配(考虑汉化版 -zh.x 后缀差异)
|
||||
function versionsMatch(cliVer, recommended) {
|
||||
if (cliVer === recommended) return true
|
||||
return baseVersion(cliVer) === baseVersion(recommended)
|
||||
if (baseVersion(cliVer) !== baseVersion(recommended)) return false
|
||||
return !hasVersionSuffix(cliVer)
|
||||
}
|
||||
|
||||
// 判断推荐版是否真的比当前版本更新(忽略 -zh.x 后缀)
|
||||
function recommendedIsNewer(recommended, current) {
|
||||
return versionGt(baseVersion(recommended), baseVersion(current))
|
||||
const baseCmp = versionCompare(baseVersion(recommended), baseVersion(current))
|
||||
if (baseCmp !== 0) return baseCmp > 0
|
||||
if (hasVersionSuffix(recommended) && hasVersionSuffix(current)) {
|
||||
return versionGt(recommended, current)
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
function loadVersionPolicy() {
|
||||
|
||||
@@ -217,10 +217,11 @@
|
||||
"currentImageVer": "Already on current image version",
|
||||
"rollbackToRecommended": "Rollback to recommended",
|
||||
"switchToRecommended": "Switch to recommended",
|
||||
"upgradeToLatest": "Upgrade to latest",
|
||||
"versionLoadFailed": "Failed to load version info",
|
||||
"serviceLoadFailed": "Failed to load service list",
|
||||
"policyAhead": "Local version {ver} is ahead of panel recommended stable {recommended}. Continued use may have compatibility or stability risks. Consider rolling back.",
|
||||
"policyDefault": "Only the panel-verified recommended stable version is suggested by default. To try other versions or latest features, manually switch in the About page and verify compatibility yourself. To request newer version support, file an issue.",
|
||||
"policyDefault": "The panel recommends the verified stable version by default. If the latest upstream is detected, you can also click \"Upgrade to latest\" and verify compatibility yourself.",
|
||||
"configEditor": "Config Editor",
|
||||
"configEditorHint": "Edit the openclaw.json config file directly. A backup is auto-created before saving. Changes may require a Gateway restart.",
|
||||
"saveAndRestart": "Save & Restart",
|
||||
@@ -251,8 +252,9 @@
|
||||
"backupDeleted": "Backup deleted",
|
||||
"backupLoadFailed": "Failed to load backup list",
|
||||
"upgradeTitle": "Upgrade / Switch Version",
|
||||
"upgradeConfirm": "Switch OpenClaw to the panel-recommended stable {source}{version}?\nGateway will be briefly interrupted.\nTo try the latest version, manually switch in the About page.",
|
||||
"switchSourceConfirm": "Switch to {target}{version}?\nThis installs the corresponding npm package. Config data is not affected.\nTo try the latest, manually switch in the About page.",
|
||||
"upgradeConfirm": "Switch OpenClaw to the panel-recommended stable {source}{version}?\nGateway will be briefly interrupted.",
|
||||
"upgradeLatestConfirm": "Upgrade OpenClaw to the latest upstream {source}{version}?\nThe latest version may include API or config changes that are not fully verified yet. Gateway will be briefly interrupted.",
|
||||
"switchSourceConfirm": "Switch to {target}{version}?\nThis installs the corresponding npm package. Config data is not affected.",
|
||||
"taskStarted": "Background task started, please wait...",
|
||||
"webModeNoLog": "Web mode: Upgrade logs unavailable, please wait...",
|
||||
"taskDone": "Operation complete",
|
||||
@@ -1778,7 +1780,7 @@
|
||||
"official": "Official",
|
||||
"chinese": "Chinese",
|
||||
"policyAhead": "Your local installation {current} is ahead of the recommended stable version. There may be API, event, or config compatibility issues. Consider rolling back to {recommended}; if you want to keep the newer version, verify compatibility yourself and watch issues/releases.",
|
||||
"policyDefault": "This panel only guarantees compatibility with the recommended stable version. If you want to try other versions or previews, verify compatibility yourself. Submit an issue if you want us to support the latest version sooner.",
|
||||
"policyDefault": "The panel recommends the verified stable version by default. If the latest upstream is detected, you can also click \"Upgrade to latest\" and verify compatibility yourself.",
|
||||
"notInstalled": "Not installed",
|
||||
"aheadOfRecommended": "Current version is ahead of recommended stable: {ver}",
|
||||
"rollbackToRecommended": "Rollback to recommended",
|
||||
@@ -1786,6 +1788,7 @@
|
||||
"switchToRecommended": "Switch to recommended",
|
||||
"isRecommended": "Already on recommended stable",
|
||||
"latestUpstream": "Latest upstream: {ver}",
|
||||
"switchToLatest": "Upgrade to latest",
|
||||
"switchVersion": "Switch Version",
|
||||
"installOpenclaw": "Install OpenClaw",
|
||||
"uninstall": "Uninstall",
|
||||
@@ -1794,6 +1797,7 @@
|
||||
"configNotFound": "Config file not found",
|
||||
"rollbackToRecommendedStable": "Rollback to recommended stable",
|
||||
"switchToRecommendedStable": "Switch to recommended stable",
|
||||
"switchToLatestVersion": "Upgrade to latest upstream",
|
||||
"confirmUninstall": "Are you sure you want to uninstall OpenClaw?\n\nThis will stop the Gateway service and uninstall the npm global package.\nConfig files (~/.openclaw/) are kept by default and can be deleted manually later.",
|
||||
"uninstallTitle": "Uninstall OpenClaw",
|
||||
"uninstallStarting": "Starting OpenClaw uninstall...",
|
||||
|
||||
@@ -16,7 +16,7 @@ export default {
|
||||
chinese: _('汉化版', 'Chinese', '漢化版', '中国語版', '중국어판'),
|
||||
unknownSource: _('未知来源', 'Unknown Source', '未知來源', '不明なソース', '알 수 없는 출처'),
|
||||
policyAhead: _('检测到你本地安装的是高于推荐稳定版的 {current},可能存在接口、事件或配置兼容性问题。建议回退到 {recommended};如果你要继续使用高版本,请自行验证兼容性并关注 issue / release。', 'Your local installation {current} is ahead of the recommended stable version. There may be API, event, or config compatibility issues. Consider rolling back to {recommended}; if you want to keep the newer version, verify compatibility yourself and watch issues/releases.', '檢測到你本地安裝的是高於推薦穩定版的 {current},可能存在介面、事件或設定相容性問題。建議回退到 {recommended};如果你要繼續使用高版本,請自行驗證相容性並關注 issue / release。'),
|
||||
policyDefault: _('当前面板默认只保证推荐稳定版的兼容性;如果你要尝试其他版本或预览版,请自行验证兼容性。若希望面板尽快支持最新版特性,欢迎提交 issue 告诉我们。', 'This panel only guarantees compatibility with the recommended stable version. If you want to try other versions or previews, verify compatibility yourself. Submit an issue if you want us to support the latest version sooner.', '目前面板預設只保證推薦穩定版的相容性;如果你要尝試其他版本或預覽版,請自行驗證相容性。若希望面板尽快支援最新版特性,欢迎提交 issue 告诉我們。'),
|
||||
policyDefault: _('默认建议当前面板已验证的推荐稳定版;如果检测到最新上游,也可以点击「升级到最新版」自行验证兼容性。', 'The panel recommends the verified stable version by default. If the latest upstream is detected, you can also click "Upgrade to latest" and verify compatibility yourself.', '預設建議目前面板已驗證的推薦穩定版;如果檢測到最新上游,也可以點擊「升級到最新版」自行驗證相容性。'),
|
||||
notInstalled: _('未安装', 'Not installed', '未安裝', '未インストール', '미설치', 'Chưa cài đặt', 'No instalado', 'Não instalado', 'Не установлен', 'Non installé', 'Nicht installiert'),
|
||||
installed: _('已安装', 'Installed', '已安裝'),
|
||||
hermesSetup: _('前往配置', 'Go to Setup', '前往配置'),
|
||||
|
||||
@@ -299,10 +299,11 @@
|
||||
"currentImageVer": "已是当前镜像版本",
|
||||
"rollbackToRecommended": "回退到推荐版",
|
||||
"switchToRecommended": "切换到推荐版",
|
||||
"upgradeToLatest": "升级到最新版",
|
||||
"versionLoadFailed": "版本信息加载失败",
|
||||
"serviceLoadFailed": "加载服务列表失败",
|
||||
"policyAhead": "检测到当前本地版本 {ver} 高于面板推荐稳定版 {recommended},继续使用可能存在兼容或稳定性风险,建议尽快回退到推荐版。",
|
||||
"policyDefault": "默认只建议当前面板已验证的推荐稳定版。如需尝试其它版本或最新特性,请到「关于」页手动切换版本并自行验证兼容性;若希望面板优先适配最新版,欢迎提交 issue。",
|
||||
"policyDefault": "默认建议当前面板已验证的推荐稳定版;如果检测到最新上游,也可以点击「升级到最新版」自行验证兼容性。",
|
||||
"configEditor": "配置文件编辑",
|
||||
"configEditorHint": "直接编辑 openclaw.json 主配置文件。保存前会自动创建备份,修改后可能需要重启 Gateway 生效。",
|
||||
"saveAndRestart": "保存并重启",
|
||||
@@ -333,8 +334,9 @@
|
||||
"backupDeleted": "备份已删除",
|
||||
"backupLoadFailed": "加载备份列表失败",
|
||||
"upgradeTitle": "升级 / 切换版本",
|
||||
"upgradeConfirm": "确定要将 OpenClaw 切换到当前面板推荐的稳定{source}{version}吗?\n切换过程中 Gateway 会短暂中断。\n如果你想尝试最新版,请到「关于」页手动切换版本并自测兼容性。",
|
||||
"switchSourceConfirm": "确定要切换到{target}{version}吗?\n这会安装对应的 npm 包,配置数据不受影响。\n如需尝试最新版,请到「关于」页手动切换版本。",
|
||||
"upgradeConfirm": "确定要将 OpenClaw 切换到当前面板推荐的稳定{source}{version}吗?\n切换过程中 Gateway 会短暂中断。",
|
||||
"upgradeLatestConfirm": "确定要将 OpenClaw 升级到最新上游{source}{version}吗?\n最新版可能包含尚未完全验证的接口或配置变化,升级过程中 Gateway 会短暂中断。",
|
||||
"switchSourceConfirm": "确定要切换到{target}{version}吗?\n这会安装对应的 npm 包,配置数据不受影响。",
|
||||
"taskStarted": "后台任务已启动,请等待完成...",
|
||||
"webModeNoLog": "Web 模式:升级过程日志不可用,请等待完成...",
|
||||
"taskDone": "操作完成",
|
||||
@@ -1861,7 +1863,7 @@
|
||||
"official": "原版",
|
||||
"chinese": "汉化版",
|
||||
"policyAhead": "检测到你本地安装的是高于推荐稳定版的 {current},可能存在接口、事件或配置兼容性问题。建议回退到 {recommended};如果你要继续使用高版本,请自行验证兼容性并关注 issue / release。",
|
||||
"policyDefault": "当前面板默认只保证推荐稳定版的兼容性;如果你要尝试其他版本或预览版,请自行验证兼容性。若希望面板尽快支持最新版特性,欢迎提交 issue 告诉我们。",
|
||||
"policyDefault": "默认建议当前面板已验证的推荐稳定版;如果检测到最新上游,也可以点击「升级到最新版」自行验证兼容性。",
|
||||
"notInstalled": "未安装",
|
||||
"aheadOfRecommended": "当前版本高于推荐稳定版: {ver}",
|
||||
"rollbackToRecommended": "回退到推荐版",
|
||||
@@ -1869,6 +1871,7 @@
|
||||
"switchToRecommended": "切换到推荐版",
|
||||
"isRecommended": "已是推荐稳定版",
|
||||
"latestUpstream": "最新上游: {ver}",
|
||||
"switchToLatest": "升级到最新版",
|
||||
"switchVersion": "切换版本",
|
||||
"installOpenclaw": "安装 OpenClaw",
|
||||
"uninstall": "卸载",
|
||||
@@ -1877,6 +1880,7 @@
|
||||
"configNotFound": "未找到配置文件",
|
||||
"rollbackToRecommendedStable": "回退到推荐稳定版",
|
||||
"switchToRecommendedStable": "切换到推荐稳定版",
|
||||
"switchToLatestVersion": "升级到最新上游版",
|
||||
"confirmUninstall": "确定要卸载 OpenClaw 吗?\n\n这将停止 Gateway 服务并卸载 npm 全局包。\n配置文件(~/.openclaw/)默认保留,可稍后手动删除。",
|
||||
"uninstallTitle": "卸载 OpenClaw",
|
||||
"uninstallStarting": "开始卸载 OpenClaw...",
|
||||
|
||||
Reference in New Issue
Block a user