更新国际化支持:调整多个组件中的文本引入,优化语言切换和翻译功能,删除不再使用的类型文件。

This commit is contained in:
jxxghp
2025-04-27 20:49:44 +08:00
parent f809c8e538
commit 0396f180ae
21 changed files with 260 additions and 97 deletions

26
src/types/i18n.ts Normal file
View File

@@ -0,0 +1,26 @@
import zhCN from '@/locales/zh-CN'
// 导出类型和常量,而不是作为语言消息文件
export type MessageSchema = typeof zhCN
export type LocaleKey = keyof typeof zhCN
export interface LocaleInfo {
name: string
title: string
flag?: string
}
export const SUPPORTED_LOCALES: Record<string, LocaleInfo> = {
'zh-CN': {
name: 'zh-CN',
title: '简体中文',
flag: '🇨🇳',
},
'en-US': {
name: 'en-US',
title: 'English',
flag: '🇺🇸',
},
}
export type SupportedLocale = keyof typeof SUPPORTED_LOCALES