Addition of Hindi Language

This commit is contained in:
Amruth Pillai
2020-03-30 20:56:06 +05:30
parent 6a9999d633
commit a5e8c6dcc1
6 changed files with 72 additions and 52 deletions

View File

@ -1,4 +1,5 @@
import React, { useEffect, useContext, Suspense } from 'react';
import { useTranslation } from 'react-i18next';
import AppContext from '../../context/AppContext';
import LeftSidebar from '../LeftSidebar/LeftSidebar';
@ -7,14 +8,16 @@ import RightSidebar from '../RightSidebar/RightSidebar';
import templates from '../../templates';
const App = () => {
const { i18n } = useTranslation();
const context = useContext(AppContext);
const { state, dispatch } = context;
const { theme } = state;
const { theme, settings } = state;
useEffect(() => {
i18n.changeLanguage(settings.language);
const storedState = JSON.parse(localStorage.getItem('state'));
dispatch({ type: 'import_data', payload: storedState });
}, [dispatch]);
}, [dispatch, i18n, settings.language]);
return (
<Suspense fallback="Loading...">