md,
setTheme,
} from '../utils';
-import { i18n, i18nextSetup } from '../i18next';
+import { i18n } from '../i18next';
interface NavbarState {
isLoggedIn: boolean;
this.requestNotificationPermission();
this.fetchUnreads();
setTheme(data.my_user.theme, true);
+ i18n.changeLanguage(data.my_user.lang);
}
this.state.isLoggedIn = true;
}
- i18nextSetup();
-
this.state.siteLoading = false;
this.setState(this.state);
}
return format === 'uppercase' ? value.toUpperCase() : value;
}
-export function i18nextSetup() {
- i18next.init({
- debug: false,
- // load: 'languageOnly',
+i18next.init({
+ debug: false,
+ // load: 'languageOnly',
+
+ // initImmediate: false,
+ lng: getLanguage(),
+ fallbackLng: 'en',
+ resources,
+ interpolation: { format },
+});
- // initImmediate: false,
- lng: getLanguage(),
- fallbackLng: 'en',
- resources,
- interpolation: { format },
- });
-}
export { i18next as i18n, resources };