WIP - starting to implement I18n

This commit is contained in:
2025-04-25 17:34:01 +02:00
committed by ewandor
parent cc73fc4af2
commit f71dccf166
8 changed files with 625 additions and 360 deletions

View File

@@ -1,4 +1,5 @@
import { Authenticated, Refine } from "@refinedev/core";
import { Authenticated, I18nProvider, Refine } from "@refinedev/core";
import { useTranslation } from "react-i18next";
import { RefineSnackbarProvider, useNotificationProvider } from "@refinedev/mui";
@@ -26,6 +27,15 @@ import { FirmRoutes } from "./pages/firm";
import rpcTheme from "./theme";
function App() {
const { t, i18n } = useTranslation();
const i18nProvider: I18nProvider = {
translate: (key: string, options?: any) => t(key, options) as string,
changeLocale: (lang: string) => i18n.changeLanguage(lang),
getLocale: () => i18n.language,
};
return (
<BrowserRouter>
<ThemeProvider theme={rpcTheme}>
@@ -36,6 +46,7 @@ function App() {
<Refine
authProvider={authProvider}
dataProvider={dataProvider}
i18nProvider={i18nProvider}
notificationProvider={useNotificationProvider}
routerProvider={routerBindings}
options={{