feat(i18n): add i18n types, config, provider, context, and custom hook

This commit is contained in:
2025-07-04 00:22:01 +03:30
parent e2d37ac7b2
commit 01658964f7
13 changed files with 312 additions and 23 deletions

View File

@@ -0,0 +1,15 @@
import { type Language } from '@/types/language';
import { createContext } from 'react';
export interface LangaugeContextModel {
language: Language;
changeLanguage: (langauge: Language) => void;
t: (key: string) => string;
}
// The context is used by the LangaugeProvider
export const LangaugeContext = createContext<LangaugeContextModel>({
language: 'fa',
changeLanguage: () => {},
t: () => '',
});