refactor: 移除英文翻译,仅保留中文

删除 public/_locales/en/ 目录,清理 chromeI18n.ts 中未使用的语言切换相关导出。

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
雨霖铃
2026-05-28 19:27:15 +08:00
parent 8b6bac9f2c
commit 1daf049737
3 changed files with 4 additions and 1319 deletions
+3 -7
View File
@@ -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),
}));