feat: 国际化语言默认为英语
This commit is contained in:
@@ -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]);
|
||||
}
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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;
|
||||
@@ -148,7 +148,7 @@ export const rawRequest = createRequest(
|
||||
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;
|
||||
|
||||
Reference in New Issue
Block a user