mirror of
https://github.com/d0zingcat/NotionNext.git
synced 2026-05-30 15:10:11 +00:00
fix: 🐛 修復 i18n 無法套用語言變體
修復 i18n 無法正確使用語言變體,轉而使用最靠近的語系翻譯
This commit is contained in:
@@ -8,12 +8,7 @@ import {
|
||||
import { useUser } from '@clerk/nextjs'
|
||||
import { useRouter } from 'next/router'
|
||||
import { createContext, useContext, useEffect, useState } from 'react'
|
||||
import {
|
||||
generateLocaleDict,
|
||||
initLocale,
|
||||
redirectUserLang,
|
||||
saveLangToLocalStorage
|
||||
} from './lang'
|
||||
import { generateLocaleDict, initLocale, redirectUserLang } from './lang'
|
||||
|
||||
/**
|
||||
* 全局上下文
|
||||
@@ -81,7 +76,6 @@ export function GlobalContextProvider(props) {
|
||||
|
||||
function changeLang(lang) {
|
||||
if (lang) {
|
||||
saveLangToLocalStorage(lang)
|
||||
updateLang(lang)
|
||||
updateLocale(generateLocaleDict(lang))
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user