mirror of
https://github.com/ConvoyPanel/panel.git
synced 2026-06-12 08:22:27 +08:00
17 lines
369 B
TypeScript
17 lines
369 B
TypeScript
import type { TransProps } from 'react-i18next'
|
|
import { Trans, useTranslation } from 'react-i18next'
|
|
|
|
type Props = Omit<TransProps<string, string>, 't'>
|
|
|
|
function Translate({ ns, children, ...props }: Props) {
|
|
const { t } = useTranslation(ns)
|
|
|
|
return (
|
|
<Trans t={t} {...props}>
|
|
{children}
|
|
</Trans>
|
|
)
|
|
}
|
|
|
|
export default Translate
|