Removed shamefully-hoist and updated all packages to respect that

This commit is contained in:
giancarlo
2024-04-10 01:45:03 +08:00
parent 9e1199f3f4
commit f729bf6077
33 changed files with 1504 additions and 1470 deletions

View File

@@ -5,19 +5,17 @@ import { initReactI18next } from 'react-i18next';
import { I18N_COOKIE_NAME, getI18nSettings } from './i18n.settings';
let promise: Promise<i18n>;
export function initializeI18nClient(
lng: string | undefined,
i18nResolver: (lang: string, namespace: string) => Promise<object>,
): Promise<i18n> {
const settings = getI18nSettings(lng);
if (promise !== undefined) {
return promise;
if (i18next.isInitialized) {
return Promise.resolve(i18next);
}
promise = new Promise<i18n>((resolve, reject) => {
return new Promise<i18n>((resolve, reject) => {
void i18next
.use(initReactI18next)
.use(
@@ -49,6 +47,4 @@ export function initializeI18nClient(
},
);
});
return promise;
}