diff --git a/src/App.js b/src/App.js index 0ef649a..34f2e12 100644 --- a/src/App.js +++ b/src/App.js @@ -12,11 +12,14 @@ import HeaderProvider from "./Contexts/HeaderContext"; import { useEffect, useState } from "react"; import StoresProvider from "./Contexts/StoresContext"; import { clarity } from "react-microsoft-clarity"; +import { useTranslation } from "react-i18next"; export default function App() { /*const [notificationApi, notificationContextHolder] = notification.useNotification(); */ + const { t, i18n } = useTranslation(); + const { userSession, setUserSession } = UseUserSession(); //const [isWebSocketReady, setIsWebSocketReady] = useState(false); @@ -35,6 +38,10 @@ export default function App() { if (data.user.analytics_enabled) { clarity.init(Constants.CLARITY_PROJECT_ID); } + + if (data.user.language !== i18n.language) { + i18n.changeLanguage(data.user.language); + } }) .catch(() => { setUserSession();