Files

50 lines
1.4 KiB
JavaScript
Raw Permalink Normal View History

2022-07-03 13:49:57 +05:00
/* eslint-disable @typescript-eslint/no-var-requires */
import "@azure/core-asynciterator-polyfill";
2025-02-26 10:18:41 +05:00
import '@formatjs/intl-locale/polyfill-force'
import '@formatjs/intl-pluralrules/polyfill-force'
2024-07-27 10:19:43 +05:00
import '@formatjs/intl-pluralrules/locale-data/en'
2024-01-24 18:58:14 +05:00
import 'react-native-url-polyfill/auto';
2023-11-16 08:54:37 +05:00
import "./polyfills/console-time.js"
2022-07-03 13:49:57 +05:00
global.Buffer = require('buffer').Buffer;
2022-08-29 16:19:17 +05:00
import '../app/common/logger/index';
2022-07-08 18:32:08 +05:00
import { DOMParser } from './worker.js';
global.DOMParser = DOMParser;
2024-10-14 12:54:50 +05:00
import {setI18nGlobal } from "@notesnook/intl";
2024-07-27 10:19:43 +05:00
import { i18n } from "@lingui/core";
import { ScriptManager, Script } from '@callstack/repack/client';
2024-10-19 14:04:16 +05:00
import {
messages as $en
2024-11-11 19:25:56 +05:00
} from "@notesnook/intl/dist/locales/$en.json";
2024-10-14 12:54:50 +05:00
import {
2024-10-19 11:49:53 +05:00
messages as $pseudo
2024-11-11 19:25:56 +05:00
} from "@notesnook/intl/dist/locales/$pseudo-LOCALE.json";
2025-02-17 14:45:04 +05:00
import Config from "react-native-config";
2024-07-27 10:19:43 +05:00
i18n.load({
2025-10-04 23:27:30 +05:00
en: __DEV__ && Config.isTesting !== "true" ? $pseudo : $en
2024-07-27 10:19:43 +05:00
});
2024-10-14 12:54:50 +05:00
setI18nGlobal(i18n);
2024-10-19 14:04:16 +05:00
i18n.activate("en");
2024-07-27 10:19:43 +05:00
setI18nGlobal(i18n);
try {
ScriptManager.shared.addResolver(async (scriptId) => {
// `scriptId` will be either 'student' or 'teacher'
// In dev mode, resolve script location to dev server.
if (__DEV__) {
return {
url: Script.getDevServerURL(scriptId),
cache: false,
};
}
return {
url: Script.getFileSystemURL(scriptId)
};
});
} catch(e) {
/** ignore error when running with metro bundler */
}