feat: 国际化语言切换时切换字体
This commit is contained in:
parent
6f15741496
commit
b8a3ed8ed6
|
@ -2,6 +2,13 @@ import type { LocaleType } from '#/global';
|
|||
|
||||
export function setHtmlPageLang(locale: LocaleType) {
|
||||
document.querySelector('html')?.setAttribute('lang', locale);
|
||||
let fontFamily = '';
|
||||
if (locale === 'en-US') {
|
||||
fontFamily = 'Helvetica Neue, Arial';
|
||||
} else {
|
||||
fontFamily = 'PingFang SC, Microsoft YaHei';
|
||||
}
|
||||
document.body.style.fontFamily = fontFamily;
|
||||
}
|
||||
|
||||
export const loadLocalePool: LocaleType[] = [];
|
||||
|
|
Loading…
Reference in New Issue