refactor: 移除英文翻译,仅保留中文
删除 public/_locales/en/ 目录,清理 chromeI18n.ts 中未使用的语言切换相关导出。 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
+3
-7
@@ -3,11 +3,9 @@ import { afterEach, beforeEach, vi } from 'vitest';
|
||||
import React from 'react';
|
||||
|
||||
// Load actual zh translations for getMessage mock
|
||||
// eslint-disable-next-line @typescript-eslint/no-require-imports
|
||||
const zhMessages: Record<
|
||||
string,
|
||||
{ message: string }
|
||||
> = require('./public/_locales/zh/messages.json');
|
||||
const zhMessages: Record<string, { message: string }> =
|
||||
// eslint-disable-next-line @typescript-eslint/no-require-imports
|
||||
require('./public/_locales/zh/messages.json');
|
||||
|
||||
vi.mock('@/utils/chromeI18n', () => ({
|
||||
useI18n: (ns?: string | string[]) => ({
|
||||
@@ -37,8 +35,6 @@ vi.mock('@/utils/chromeI18n', () => ({
|
||||
}),
|
||||
getMessage: (msgId: string) => zhMessages[msgId]?.message ?? msgId,
|
||||
getLanguage: () => 'zh',
|
||||
normalizeLanguage: (lng: string) => (lng.startsWith('zh') ? 'zh' : 'en'),
|
||||
SUPPORTED_LANGUAGES: ['zh', 'en'],
|
||||
preloadNamespaces: vi.fn().mockResolvedValue(undefined),
|
||||
}));
|
||||
|
||||
|
||||
Reference in New Issue
Block a user