mirror of
https://github.com/jxxghp/MoviePilot-Frontend.git
synced 2026-06-08 17:20:38 +08:00
更新国际化支持:调整多个组件中的文本引入,优化语言切换和翻译功能,删除不再使用的类型文件。
This commit is contained in:
26
src/types/i18n.ts
Normal file
26
src/types/i18n.ts
Normal 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
|
||||
Reference in New Issue
Block a user