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:
1 parent
fea6d8db04
commit
b0d0e3a5f3
301 files changed
+28002
-2705
No files matched your search
@@ -1,12 +1,17 @@
|
||||
import { describe, expect, it } from 'vitest'
|
||||
import { beforeEach, describe, expect, it } from 'vitest'
|
||||
import { normalizeAppSettings } from '../../src/stores/settingsStore'
|
||||
import { isAppLanguage } from '../../src/i18n/detectLocale'
|
||||
|
||||
describe('settings migration', () => {
|
||||
it('drops obsolete legacy settings while preserving supported values', () => {
|
||||
beforeEach(() => {
|
||||
// language default depends on navigator; tests assert explicit values
|
||||
})
|
||||
|
||||
it('keeps supported language and drops obsolete legacy settings', () => {
|
||||
const settings = normalizeAppSettings({
|
||||
theme: 'light',
|
||||
timeout: 45,
|
||||
language: 'en-US',
|
||||
language: 'en',
|
||||
showNotifications: true,
|
||||
encryptPasswords: false,
|
||||
lockOnSleep: true,
|
||||
@@ -14,9 +19,14 @@ describe('settings migration', () => {
|
||||
|
||||
expect(settings.theme).toBe('light')
|
||||
expect(settings.timeout).toBe(45)
|
||||
expect(settings).not.toHaveProperty('language')
|
||||
expect(settings.language).toBe('en')
|
||||
expect(settings).not.toHaveProperty('showNotifications')
|
||||
expect(settings).not.toHaveProperty('encryptPasswords')
|
||||
expect(settings).not.toHaveProperty('lockOnSleep')
|
||||
})
|
||||
|
||||
it('falls back to a valid language when stored value is invalid', () => {
|
||||
const settings = normalizeAppSettings({ language: 'fr-FR' })
|
||||
expect(isAppLanguage(settings.language)).toBe(true)
|
||||
})
|
||||
})
|
||||
Reference in new issue
Block a user