mirror of
https://github.com/documenso/documenso.git
synced 2026-07-25 01:15:49 +10:00
138d663c25
Merge origin/main into feat/external-2fa-codes. Resolve formatting conflicts caused by biome rollout; preserve both feature streams: PR's external 2FA token + signing-session 2FA proof additions plus main's RateLimit/RecipientExpired/signingReminders/date-auto-insert. In complete-document-with-token.ts, drop the duplicate early field-fetching block introduced when main moved that logic later with date auto-insert support; keep the EXTERNAL_TWO_FACTOR_AUTH check using derivedRecipientActionAuth.
28 lines
666 B
TypeScript
28 lines
666 B
TypeScript
import { type Messages, setupI18n } from '@lingui/core';
|
|
import { I18nProvider } from '@lingui/react';
|
|
import { useState } from 'react';
|
|
|
|
import type { I18nLocaleData } from '../../constants/i18n';
|
|
|
|
export function I18nClientProvider({
|
|
children,
|
|
initialLocaleData,
|
|
initialMessages,
|
|
}: {
|
|
children: React.ReactNode;
|
|
initialLocaleData: I18nLocaleData;
|
|
initialMessages: Messages;
|
|
}) {
|
|
const { lang, locales } = initialLocaleData;
|
|
|
|
const [i18n] = useState(() => {
|
|
return setupI18n({
|
|
locale: lang,
|
|
locales: locales,
|
|
messages: { [lang]: initialMessages },
|
|
});
|
|
});
|
|
|
|
return <I18nProvider i18n={i18n}>{children}</I18nProvider>;
|
|
}
|