2
0

feat: 国际化语言默认为英语

This commit is contained in:
caiyuchao
2025-03-19 11:06:06 +08:00
parent 2508613b35
commit 8ce4c19962
3 changed files with 4 additions and 4 deletions

View File

@@ -8,13 +8,13 @@ import { localStg } from '@/utils/storage';
*
* @param lang
*/
export function setDayjsLocale(lang: App.I18n.LangType = 'zh-CN') {
export function setDayjsLocale(lang: App.I18n.LangType = 'en-US') {
const localMap = {
'zh-CN': 'zh-cn',
'en-US': 'en'
} satisfies Record<App.I18n.LangType, string>;
const l = lang || localStg.get('lang') || 'zh-CN';
const l = lang || localStg.get('lang') || 'en-US';
locale(localMap[l]);
}

View File

@@ -4,7 +4,7 @@ import { localStg } from '@/utils/storage';
import messages from './locale';
const i18n = createI18n({
locale: localStg.get('lang') || 'zh-CN',
locale: localStg.get('lang') || 'en-US',
fallbackLocale: 'en',
messages,
legacy: false

View File

@@ -29,7 +29,7 @@ export const request = createFlatRequest<App.Service.Response, InstanceState>(
const Authorization = token ? `Bearer ${token}` : null;
// set language
const ContentLanguage = localStg.get('lang') || 'zh-CN';
const ContentLanguage = localStg.get('lang') || 'en-US';
Object.assign(headers, { Authorization, "Content-Language": ContentLanguage });
return config;