File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed
Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -5,13 +5,13 @@ import koKR from './ko-KR.json'
55import elementEnLocale from 'element-plus-secondary/es/locale/lang/en'
66import elementZhLocale from 'element-plus-secondary/es/locale/lang/zh-cn'
77import { useCache } from '@/utils/useCache'
8+ import { getBrowserLocale } from '@/utils/utils'
89
910const elementKoLocale = elementEnLocale
1011const { wsCache } = useCache ( )
1112
1213const getDefaultLocale = ( ) => {
13- const language = wsCache . get ( 'user.language' )
14- return language || 'zh-CN'
14+ return wsCache . get ( 'user.language' ) || getBrowserLocale ( ) || 'zh-CN'
1515}
1616
1717const messages = {
@@ -32,7 +32,7 @@ const messages = {
3232export const i18n = createI18n ( {
3333 legacy : false ,
3434 locale : getDefaultLocale ( ) ,
35- fallbackLocale : 'en ' ,
35+ fallbackLocale : 'zh-CN ' ,
3636 globalInjection : true ,
3737 messages,
3838} )
@@ -46,4 +46,4 @@ const elementLocales = {
4646export const getElementLocale = ( ) => {
4747 const locale = i18n . global . locale . value as keyof typeof elementLocales
4848 return elementLocales [ locale ] ?? elementEnLocale
49- }
49+ }
You can’t perform that action at this time.
0 commit comments