chore: t function removed from context and i18n config moved to a seperated file
This commit is contained in:
@@ -1,7 +1,6 @@
|
||||
import type { Language } from '@/types/language';
|
||||
import { changeLanguage } from 'i18next';
|
||||
import { useLayoutEffect, type JSX, type PropsWithChildren } from 'react';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
import { useLocalStorage } from '@/hooks/useLocalStorage';
|
||||
import { LangaugeContext } from '@/contexts/LangaugeContext';
|
||||
|
||||
@@ -10,7 +9,6 @@ export const LanguageProvider = (props: PropsWithChildren): JSX.Element => {
|
||||
'language',
|
||||
'fa',
|
||||
);
|
||||
const { t } = useTranslation();
|
||||
|
||||
useLayoutEffect(() => {
|
||||
changeLanguage(currentLanguage);
|
||||
@@ -23,7 +21,6 @@ export const LanguageProvider = (props: PropsWithChildren): JSX.Element => {
|
||||
value={{
|
||||
language: currentLanguage,
|
||||
changeLanguage: setCurrentLangauge,
|
||||
t: t,
|
||||
}}
|
||||
>
|
||||
{props.children}
|
||||
|
||||
Reference in New Issue
Block a user