Locale 模块重命名

This commit is contained in:
tangly1024
2022-03-03 15:10:42 +08:00
parent 7a46c08131
commit 3453bf9b11

View File

@@ -11,7 +11,7 @@ const GlobalContext = createContext()
* @constructor
*/
export function GlobalContextProvider ({ children }) {
const [locale, changeLocale] = useState(generateLocaleDict('en-US'))
const [locale, updateLocale] = useState(generateLocaleDict('en-US'))
const [isDarkMode, updateDarkMode] = useState(loadDarkModeFromCookies())
const [onLoading, changeLoadingState] = useState(false)
Router.events.on('routeChangeStart', (...args) => {
@@ -25,7 +25,7 @@ export function GlobalContextProvider ({ children }) {
// 服务端静态渲染在渲染hooks后根据前端变量做初始化工作
useEffect(() => {
initTheme(isDarkMode, updateDarkMode)
initLocale(locale, changeLocale)
initLocale(locale, updateLocale)
})
return (