@ -9,10 +9,16 @@ export const LOCALES = ['en', 'cn'] as const;
|
||||
export type Locale = (typeof LOCALES)[number];
|
||||
|
||||
/** 语言显示名(用于语言切换器等 UI)。 */
|
||||
export const LOCALE_NAMES: Record<Locale, string> = {
|
||||
en: 'English',
|
||||
cn: '中文',
|
||||
};
|
||||
export const LOCALE_NAMES: Record<string, { name: string; nativeName: string }> = {
|
||||
cn: {
|
||||
name: '中文',
|
||||
nativeName: '中文',
|
||||
},
|
||||
en: {
|
||||
name: 'English',
|
||||
nativeName: 'English',
|
||||
},
|
||||
} as const;
|
||||
|
||||
/** 浏览器 Accept-Language / navigator.language → 本项目支持的语言。 */
|
||||
export const BROWSER_LOCALE_MAP: Record<string, Locale> = {
|
||||
|
||||
Reference in New Issue
Block a user