mirror of
https://github.com/hellodigua/ChatLab.git
synced 2026-10-25 17:54:34 +08:00
fix(database): add missing i18n for v8 migration
Add the missing translations for the v8 database migration across the desktop locales and cover them with a regression assertion. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
1 parent
d0f6972202
commit
509f7b4262
5 files changed
+25
-5
No files matched your search
@@ -20,6 +20,7 @@ function makePathProvider(root: string): PathProvider {
|
||||
getSystemDir: () => path.join(root, 'system'),
|
||||
getUserDataDir: () => path.join(root, 'data'),
|
||||
getDatabaseDir: () => path.join(root, 'data', 'databases'),
|
||||
getVectorDir: () => path.join(root, 'data', 'vector'),
|
||||
getAiDataDir: () => path.join(root, 'system', 'ai'),
|
||||
getSettingsDir: () => path.join(root, 'system', 'settings'),
|
||||
getCacheDir: () => path.join(root, 'system', 'cache'),
|
||||
@@ -84,11 +85,20 @@ test('migrateDatabase writes data directory compatibility meta after segment sch
|
||||
})
|
||||
})
|
||||
|
||||
test('getPendingMigrationInfos maps v7 to its own localized message', () => {
|
||||
test('getPendingMigrationInfos maps each version to its own localized message', () => {
|
||||
const migrations = getPendingMigrationInfos(6)
|
||||
|
||||
assert.equal(migrations.length, 1)
|
||||
assert.equal(migrations[0].version, 7)
|
||||
assert.match(migrations[0].userMessage, /Repair|修复/)
|
||||
assert.doesNotMatch(migrations[0].userMessage, /Owner/)
|
||||
assert.deepEqual(
|
||||
migrations.map((m) => m.version),
|
||||
[7, 8]
|
||||
)
|
||||
|
||||
const v7 = migrations[0]
|
||||
assert.match(v7.userMessage, /Repair|修复/)
|
||||
assert.doesNotMatch(v7.userMessage, /Owner/)
|
||||
|
||||
// v8 必须有自己的本地化消息,而非回退到首个迁移文案
|
||||
const v8 = migrations[1]
|
||||
assert.match(v8.userMessage, /index|索引|インデックス/i)
|
||||
assert.doesNotMatch(v8.userMessage, /Owner/)
|
||||
})
|
||||
@@ -54,6 +54,9 @@ export default {
|
||||
migrationV6Message: 'Upgrade the session index structure while preserving existing indexes and summaries',
|
||||
migrationV7Desc: 'Repair missing session message mappings',
|
||||
migrationV7Message: 'Repair missing session index mappings while preserving existing sessions and summaries',
|
||||
migrationV8Desc: 'Add analysis tool performance indexes',
|
||||
migrationV8Message:
|
||||
'Add performance indexes for analysis tools to speed up queries without affecting existing data',
|
||||
integrityError:
|
||||
'Database structure is incomplete: missing meta table. Please delete this database file and re-import.',
|
||||
checkFailed: 'Database check failed: {{error}}',
|
||||
|
||||
@@ -55,6 +55,9 @@ export default {
|
||||
migrationV6Message: '既存のインデックスと要約を保持したまま、セッションインデックス構造を更新します',
|
||||
migrationV7Desc: '欠落したセッションメッセージの関連付けを修復',
|
||||
migrationV7Message: '既存のセッションと要約を保持したまま、欠落したメッセージの関連付けを修復します',
|
||||
migrationV8Desc: '分析ツールのパフォーマンスインデックスを追加',
|
||||
migrationV8Message:
|
||||
'分析ツールのクエリを高速化するパフォーマンスインデックスを追加します(既存データには影響しません)',
|
||||
integrityError:
|
||||
'データベース構造が不完全です:meta テーブルがありません。このデータベースファイルを削除して再インポートすることをお勧めします。',
|
||||
checkFailed: 'データベースチェックに失敗しました: {{error}}',
|
||||
|
||||
@@ -53,6 +53,8 @@ export default {
|
||||
migrationV6Message: '升级会话索引结构,并保留现有索引和摘要',
|
||||
migrationV7Desc: '修复缺失的会话消息关联',
|
||||
migrationV7Message: '修复会话索引中缺失的消息关联,并保留现有会话和摘要',
|
||||
migrationV8Desc: '添加分析工具性能索引',
|
||||
migrationV8Message: '为分析工具添加性能索引,提升查询速度,不影响现有数据',
|
||||
integrityError: '数据库结构不完整:缺少 meta 表。建议删除此数据库文件后重新导入。',
|
||||
checkFailed: '数据库检查失败: {{error}}',
|
||||
},
|
||||
|
||||
@@ -54,6 +54,8 @@ export default {
|
||||
migrationV6Message: '升級會話索引結構,並保留現有索引和摘要',
|
||||
migrationV7Desc: '修復缺少的會話訊息關聯',
|
||||
migrationV7Message: '修復會話索引中缺少的訊息關聯,並保留現有會話和摘要',
|
||||
migrationV8Desc: '新增分析工具效能索引',
|
||||
migrationV8Message: '為分析工具新增效能索引,提升查詢速度,不影響現有資料',
|
||||
integrityError: '資料庫結構不完整:缺少 meta 資料表。建議刪除此資料庫檔案後重新匯入。',
|
||||
checkFailed: '資料庫檢查失敗: {{error}}',
|
||||
},
|
||||
|
||||
Reference in new issue
Block a user