fix: close browser would reset to browser default language (#19665)

This commit is contained in:
Joel 2025-05-14 15:00:28 +08:00 committed by GitHub
parent 5360180a2a
commit 85a44b7349
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

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