Translations for Email Notifications (#1278)

Co-authored-by: Niko Heller <hellerniko@gmail.com>
This commit is contained in:
Luke Vella 2024-09-02 19:30:58 +01:00 committed by GitHub
parent aa52a0f26f
commit f4218c3115
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
51 changed files with 1071 additions and 970 deletions

View file

@ -2,9 +2,15 @@ import { Trans as BaseTrans } from "react-i18next";
import { useTranslation } from "@/app/i18n/client";
type TransWithContextProps = Omit<React.ComponentProps<typeof BaseTrans>, "t">;
import { I18nNamespaces } from "../../declarations/i18next";
export const Trans = (props: TransWithContextProps) => {
const { t } = useTranslation();
return <BaseTrans t={t} {...props} />;
export const Trans = (props: {
i18nKey: keyof I18nNamespaces["app"];
defaults?: string;
values?: Record<string, string | number | boolean | undefined>;
children?: React.ReactNode;
components?: Record<string, React.ReactElement> | React.ReactElement[];
}) => {
const { t } = useTranslation("app");
return <BaseTrans ns="app" t={t} {...props} />;
};