fix: update language change handling in I18n component (#12596)

ok
This commit is contained in:
Wu Tianwei 2025-01-10 14:47:24 +08:00 committed by GitHub
parent 71976f9192
commit a5e24ff6d3
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -2,7 +2,6 @@
import type { FC } from 'react'
import React, { useEffect } from 'react'
import { changeLanguage } from '@/i18n/i18next-config'
import I18NContext from '@/context/i18n'
import type { Locale } from '@/i18n'
import { setLocaleOnClient } from '@/i18n'
@ -16,7 +15,7 @@ const I18n: FC<II18nProps> = ({
children,
}) => {
useEffect(() => {
changeLanguage(locale)
setLocaleOnClient(locale, false)
}, [locale])
return (