change language depending on account language
parent
c2b17ddae3
commit
72a2ff1d51
|
@ -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();
|
||||
|
|
Loading…
Reference in New Issue