From 77950e48c76f4a3b29d01831d43039caba29888a Mon Sep 17 00:00:00 2001
From: wwf <1971391498@qq.com>
Date: 星期二, 18 十一月 2025 14:12:42 +0800
Subject: [PATCH] 修改
---
i18n/index.ts | 9 +--------
1 files changed, 1 insertions(+), 8 deletions(-)
diff --git a/i18n/index.ts b/i18n/index.ts
index eb49759..1eec0f3 100644
--- a/i18n/index.ts
+++ b/i18n/index.ts
@@ -12,18 +12,11 @@
export type Locale = typeof i18n['locales'][number]
export const setLocaleOnClient = (locale: Locale, reloadPage = true) => {
- Cookies.set(LOCALE_COOKIE_NAME, locale, { expires: 365 })
+ Cookies.set(LOCALE_COOKIE_NAME, locale)
changeLanguage(locale)
reloadPage && location.reload()
}
export const getLocaleOnClient = (): Locale => {
return Cookies.get(LOCALE_COOKIE_NAME) as Locale || i18n.defaultLocale
-}
-
-export const renderI18nObject = (obj: Record<string, string>, language: string) => {
- if (!obj) return ''
- if (obj?.[language]) return obj[language]
- if (obj?.en_US) return obj.en_US
- return Object.values(obj)[0]
}
--
Gitblit v1.8.0