From b8a3ed8ed69d477a0276a9183987f30bd7a30f79 Mon Sep 17 00:00:00 2001 From: baiqi Date: Wed, 7 Jun 2023 14:22:13 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E5=9B=BD=E9=99=85=E5=8C=96=E8=AF=AD?= =?UTF-8?q?=E8=A8=80=E5=88=87=E6=8D=A2=E6=97=B6=E5=88=87=E6=8D=A2=E5=AD=97?= =?UTF-8?q?=E4=BD=93?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/src/locale/helper.ts | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/frontend/src/locale/helper.ts b/frontend/src/locale/helper.ts index e8ebe9efbc..ac2176d087 100644 --- a/frontend/src/locale/helper.ts +++ b/frontend/src/locale/helper.ts @@ -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[] = [];