- Delete `SyncService` and its associated bidirectional synchronization logic. - Add multiple context providers (`OfflineProvider`, `AlertProvider`, `LangContext`, `UserContext`, `SessionContext`, `WorldContext`, `SettingBookContext`) for contextual state management. - Implement `SecureStorage` for OS-level secure data encryption and replace dependency on `SyncService` synchronization. - Update localization files (`en.json`, `fr.json`) with offline mode and error-related strings.
14 lines
379 B
TypeScript
14 lines
379 B
TypeScript
import {Context, createContext, Dispatch, SetStateAction} from "react";
|
|
|
|
export type SupportedLocale = 'fr' | 'en';
|
|
|
|
export interface LangContextProps {
|
|
lang: SupportedLocale;
|
|
setLang: Dispatch<SetStateAction<SupportedLocale>>;
|
|
}
|
|
|
|
export const LangContext: Context<LangContextProps> = createContext<LangContextProps>({
|
|
lang: 'fr',
|
|
setLang: (): void => {
|
|
}
|
|
}); |