mirror of
https://github.com/langgenius/dify.git
synced 2026-10-04 13:47:55 +08:00
15 lines
414 B
TypeScript
15 lines
414 B
TypeScript
'use client'
|
|
|
|
import type { Locale } from './locale'
|
|
import type { Namespace } from './resources'
|
|
import { useTranslation as useTranslationOriginal } from 'react-i18next'
|
|
|
|
export function useTranslation<T extends Namespace | undefined = undefined>(ns?: T) {
|
|
return useTranslationOriginal(ns)
|
|
}
|
|
|
|
export function useLocale(): Locale {
|
|
const { i18n } = useTranslationOriginal()
|
|
return i18n.language as Locale
|
|
}
|