This commit is contained in:
crazywoola 2024-04-29 18:59:37 +08:00 • committed by GitHub
commit b1194da6a5
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 6 additions and 2 deletions

View file

@ -16,3 +16,7 @@ export const setLocaleOnClient = (locale: Locale, reloadPage = true) => {
changeLanguage(locale)
reloadPage && location.reload()
}
export const getLocaleOnClient = (): Locale => {
return Cookies.get(LOCALE_COOKIE_NAME) as Locale || i18n.defaultLocale
}