refactor(ui): changed frontend to normal i18n without SSR

This commit is contained in:
akhilmhdh
2023-05-09 23:28:23 +05:30
parent 420d71d923
commit 3561c589b1
198 changed files with 5008 additions and 5253 deletions
+3 -11
View File
@@ -2,7 +2,6 @@
import { useEffect } from 'react';
import { AppProps } from 'next/app';
import { useRouter } from 'next/router';
import { appWithTranslation } from 'next-i18next';
import { config } from '@fortawesome/fontawesome-svg-core';
import { QueryClientProvider } from '@tanstack/react-query';
@@ -23,6 +22,8 @@ import { queryClient } from '@app/reactQuery';
import '@fortawesome/fontawesome-svg-core/styles.css';
import '../styles/globals.css';
import '@app/i18n';
config.autoAddCss = false;
type NextAppProp = AppProps & {
@@ -32,15 +33,6 @@ type NextAppProp = AppProps & {
const App = ({ Component, pageProps, ...appProps }: NextAppProp): JSX.Element => {
const router = useRouter();
useEffect(() => {
const storedLang = localStorage.getItem('lang');
if (router.locale ?? storedLang !== 'en' ?? 'en') {
router.push(router.asPath, router.asPath, {
locale: storedLang ?? 'en'
});
}
}, [router.locale, router.pathname]);
useEffect(() => {
// Init for auto capturing
const telemetry = new Telemetry().getInstance();
@@ -95,7 +87,7 @@ const App = ({ Component, pageProps, ...appProps }: NextAppProp): JSX.Element =>
);
};
export default appWithTranslation(App);
export default App;
/* <Script
src="https://www.googletagmanager.com/gtag/js?id=G-DQ1XLJJGG1"