Add translation values to activity log output
This commit is contained in:
parent
06427f8d13
commit
4d30cc9e7e
4 changed files with 25 additions and 5 deletions
14
resources/scripts/components/elements/Translate.tsx
Normal file
14
resources/scripts/components/elements/Translate.tsx
Normal file
|
@ -0,0 +1,14 @@
|
|||
import React from 'react';
|
||||
import { Trans, TransProps, useTranslation } from 'react-i18next';
|
||||
|
||||
type Props = Omit<TransProps, 't'>;
|
||||
|
||||
export default ({ ns, children, ...props }: Props) => {
|
||||
const { t } = useTranslation(ns);
|
||||
|
||||
return (
|
||||
<Trans t={t} {...props}>
|
||||
{children}
|
||||
</Trans>
|
||||
);
|
||||
};
|
Reference in a new issue