feat: performance optimization (#22810)

This commit is contained in:
Wu Tianwei 2025-07-23 16:04:46 +08:00 • committed by GitHub
commit a366de26c4
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
30 changed files with 138 additions and 83 deletions

View file

@ -11,9 +11,9 @@ export const i18n = {
export type Locale = typeof i18n['locales'][number]
export const setLocaleOnClient = (locale: Locale, reloadPage = true) => {
export const setLocaleOnClient = async (locale: Locale, reloadPage = true) => {
Cookies.set(LOCALE_COOKIE_NAME, locale, { expires: 365 })
changeLanguage(locale)
await changeLanguage(locale)
reloadPage && location.reload()
}