Files
platform/src/apps/officer-web/lib/I18nBridge.tsx
T
2026-02-17 21:36:12 +00:00

24 lines
615 B
TypeScript

import type { ReactNode } from 'react';
import type { TranslationMap } from 'i18n';
import { I18nProvider } from 'i18n';
import { useSettings } from '@/state/useSettings';
import en from '../locales/en.json';
import pt from '../locales/pt.json';
const translations: TranslationMap = { en, pt };
type I18nBridgeProps = {
children: ReactNode;
};
export const I18nBridge = ({ children }: I18nBridgeProps) => {
const { settings } = useSettings();
const locale = settings.languages.default;
return (
<I18nProvider translations={translations} locale={locale}>
{children}
</I18nProvider>
);
};