feat(i18n): add multi-language support (ja/ko/vi/ru/zh-TW) with system auto-detection

- Extend AppLanguage to 7 locales: zh-CN, zh-TW, en, ja, ko, vi, ru
- Auto-detect system language via navigator.languages; fallback to English
- Add BCP47 locale mapping for date formatting and sorting
- Create 50 translation JSON files (5 languages × 10 namespaces, 1137 keys each)
- Update language selector with native language names
- Extend locale key parity test to cover all 7 languages (70 assertions)
- Add VNC/RDP desktop, serial terminal, AI agent, port forwarding, and SFTP features
- Add credential encryption, host metrics, session backup crypto, and zmodem bridge
- Update Rust backend: desktop services, host metrics, SSH/SFTP enhancements
This commit is contained in:
Logan.Li committed 2026-08-12 00:07:48 +08:00
1 parent fea6d8db04
commit b0d0e3a5f3
301 files changed
+28002 -2705

No files matched your search

+9 -9
View File
@@ -2,14 +2,16 @@
* UpgradeWall — intercepts Pro features for Free users
*/
import { useTranslation } from 'react-i18next'
import { Crown, Sparkles, X } from 'lucide-react'
import {
PRO_FEATURE_LABELS,
proFeatureLabel,
useEntitlementStore,
type ProFeature,
} from '../../stores/entitlementStore'
export default function UpgradeWall() {
const { t } = useTranslation('common')
const wall = useEntitlementStore((s) => s.wall)
const closeWall = useEntitlementStore((s) => s.closeWall)
const openUpgradeTab = useEntitlementStore((s) => s.openUpgradeTab)
@@ -17,7 +19,7 @@ export default function UpgradeWall() {
if (!wall.open) return null
const feature = wall.feature as ProFeature | undefined
const label = feature ? PRO_FEATURE_LABELS[feature] : '专业功能'
const label = feature ? proFeatureLabel(feature) : t('pro.feature')
const comingSoon = wall.comingSoon
return (
@@ -36,7 +38,7 @@ export default function UpgradeWall() {
type="button"
onClick={closeWall}
className="absolute right-3 top-3 rounded-lg p-1.5 text-txt-muted hover:bg-dark-700 hover:text-content-primary"
aria-label="关闭"
aria-label={t('action.close')}
>
<X className="h-4 w-4" />
</button>
@@ -46,13 +48,11 @@ export default function UpgradeWall() {
<Crown className="h-5 w-5" />
</div>
<h2 id="upgrade-wall-title" className="text-base font-semibold text-content-primary">
{comingSoon ? `${label} · 即将推出` : `解锁 ${label}`}
{comingSoon ? `${label}${t('pro.wallComingSoonSuffix')}` : t('pro.wallUnlock', { feature: label })}
</h2>
<p className="mt-1.5 text-sm leading-relaxed text-txt-muted">
{wall.message ||
(comingSoon
? '该能力属于 OpsXShell Pro,协议实现尚在开发中。升级后可优先体验。'
: '此功能属于 OpsXShell Pro。升级后即可在本机使用。')}
(comingSoon ? t('pro.wallMessageComingSoon') : t('pro.wallMessageDefault'))}
</p>
</div>
@@ -62,7 +62,7 @@ export default function UpgradeWall() {
onClick={closeWall}
className="flex-1 rounded-lg border border-dark-600 px-3 py-2.5 text-sm text-content-secondary transition-colors hover:bg-dark-700"
>
稍后再说
{t('pro.later')}
</button>
<button
type="button"
@@ -70,7 +70,7 @@ export default function UpgradeWall() {
className="flex flex-1 items-center justify-center gap-1.5 rounded-lg bg-accent-blue px-3 py-2.5 text-sm font-medium text-white transition-colors hover:bg-blue-600"
>
<Sparkles className="h-3.5 w-3.5" />
查看 Pro
{t('pro.viewPro')}
</button>
</div>
</div>