2023-07-29 04:44:03 -05:00
|
|
|
import { webcrypto } from 'node:crypto';
|
|
|
|
import { TextEncoder, TextDecoder } from 'node:util';
|
|
|
|
|
2023-04-24 03:05:26 -05:00
|
|
|
import i18next from 'i18next';
|
|
|
|
import { initReactI18next } from 'react-i18next';
|
|
|
|
|
|
|
|
void i18next.use(initReactI18next).init({
|
|
|
|
// Simple resources for testing
|
|
|
|
resources: { en: { translation: { admin_console: { general: { add: 'Add' } } } } },
|
|
|
|
lng: 'en',
|
|
|
|
react: { useSuspense: false },
|
|
|
|
});
|
2023-07-29 04:44:03 -05:00
|
|
|
|
|
|
|
/* eslint-disable @silverhand/fp/no-mutation */
|
|
|
|
// @ts-expect-error monkey-patch for `crypto`
|
|
|
|
crypto.subtle = webcrypto.subtle;
|
|
|
|
global.TextEncoder = TextEncoder;
|
|
|
|
// @ts-expect-error monkey-patch for `TextEncoder`/`TextDecoder`
|
|
|
|
global.TextDecoder = TextDecoder;
|
|
|
|
/* eslint-enable @silverhand/fp/no-mutation */
|