fix(i18n): add functions to retrieve document and pricing page languages (#19142)

This commit is contained in:
Wu Tianwei
2025-04-30 14:58:49 +08:00
committed by GitHub
parent d5ee465bf9
commit 3dff21e0be
4 changed files with 40 additions and 9 deletions

View File

@@ -3,7 +3,7 @@ import {
useContext,
} from 'use-context-selector'
import type { Locale } from '@/i18n'
import { getLanguage } from '@/i18n/language'
import { getDocLanguage, getLanguage, getPricingPageLanguage } from '@/i18n/language'
import { noop } from 'lodash-es'
type II18NContext = {
@@ -24,5 +24,15 @@ export const useGetLanguage = () => {
return getLanguage(locale)
}
export const useGetDocLanguage = () => {
const { locale } = useI18N()
return getDocLanguage(locale)
}
export const useGetPricingPageLanguage = () => {
const { locale } = useI18N()
return getPricingPageLanguage(locale)
}
export default I18NContext