feat(i18n): add i18n types, config, provider, context, and custom hook
This commit is contained in:
15
src/contexts/LangaugeContext.ts
Normal file
15
src/contexts/LangaugeContext.ts
Normal 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: () => '',
|
||||
});
|
||||
Reference in New Issue
Block a user