fix(i18n): add functions to retrieve document and pricing page languages (#19142)
This commit is contained in:
@@ -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
|
||||
|
Reference in New Issue
Block a user