wwf
2 天以前 a430284aa21e3ae1f0d5654e55b2ad2852519cc2
context/i18n.ts
@@ -3,8 +3,7 @@
  useContext,
} from 'use-context-selector'
import type { Locale } from '@/i18n'
import { getDocLanguage, getLanguage, getPricingPageLanguage } from '@/i18n/language'
import { noop } from 'lodash-es'
import { getLanguage } from '@/i18n/language'
type II18NContext = {
  locale: Locale
@@ -15,7 +14,7 @@
const I18NContext = createContext<II18NContext>({
  locale: 'en-US',
  i18n: {},
  setLocaleOnClient: noop,
  setLocaleOnClient: (_lang: Locale, _reloadPage?: boolean) => { },
})
export const useI18N = () => useContext(I18NContext)
@@ -23,16 +22,6 @@
  const { locale } = useI18N()
  return getLanguage(locale)
}
export const useGetDocLanguage = () => {
  const { locale } = useI18N()
  return getDocLanguage(locale)
}
export const useGetPricingPageLanguage = () => {
  const { locale } = useI18N()
  return getPricingPageLanguage(locale)
}
export default I18NContext