mirror of
https://github.com/silenty4ng/k5web
synced 2025-01-10 05:42:50 +00:00
23 lines
477 B
TypeScript
23 lines
477 B
TypeScript
|
import { createI18n } from 'vue-i18n';
|
||
|
import en from './en-US';
|
||
|
import cn from './zh-CN';
|
||
|
|
||
|
export const LOCALE_OPTIONS = [
|
||
|
{ label: '中文', value: 'zh-CN' },
|
||
|
{ label: 'English', value: 'en-US' },
|
||
|
];
|
||
|
const defaultLocale = localStorage.getItem('arco-locale') || 'zh-CN';
|
||
|
|
||
|
const i18n = createI18n({
|
||
|
locale: defaultLocale,
|
||
|
fallbackLocale: 'en-US',
|
||
|
legacy: false,
|
||
|
allowComposition: true,
|
||
|
messages: {
|
||
|
'en-US': en,
|
||
|
'zh-CN': cn,
|
||
|
},
|
||
|
});
|
||
|
|
||
|
export default i18n;
|