mirror of
https://github.com/aljazceru/rabbit.git
synced 2025-12-19 06:54:23 +01:00
feat: i18n
This commit is contained in:
21
src/App.tsx
21
src/App.tsx
@@ -5,12 +5,17 @@ import { persistQueryClient } from '@tanstack/query-persist-client-core';
|
||||
import { createSyncStoragePersister } from '@tanstack/query-sync-storage-persister';
|
||||
import { QueryClient, QueryClientProvider } from '@tanstack/solid-query';
|
||||
|
||||
import i18nextInstance from '@/i18n/i18n';
|
||||
import { I18NextProvider } from '@/i18n/useTranslation';
|
||||
|
||||
const Home = lazy(() => import('@/pages/Home'));
|
||||
const Hello = lazy(() => import('@/pages/Hello'));
|
||||
const NotFound = lazy(() => import('@/pages/NotFound'));
|
||||
|
||||
const queryClient = new QueryClient({});
|
||||
|
||||
const i18next = i18nextInstance();
|
||||
|
||||
const localStoragePersister = createSyncStoragePersister({
|
||||
storage: window.localStorage,
|
||||
});
|
||||
@@ -25,13 +30,15 @@ const App: Component = () => {
|
||||
});
|
||||
|
||||
return (
|
||||
<QueryClientProvider client={queryClient}>
|
||||
<Routes>
|
||||
<Route path="/hello" element={<Hello />} />
|
||||
<Route path="/" element={<Home />} />
|
||||
<Route path="/*" element={<NotFound />} />
|
||||
</Routes>
|
||||
</QueryClientProvider>
|
||||
<I18NextProvider i18next={i18next}>
|
||||
<QueryClientProvider client={queryClient}>
|
||||
<Routes>
|
||||
<Route path="/hello" element={<Hello />} />
|
||||
<Route path="/" element={<Home />} />
|
||||
<Route path="/*" element={<NotFound />} />
|
||||
</Routes>
|
||||
</QueryClientProvider>
|
||||
</I18NextProvider>
|
||||
);
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user