feat(i18n): initialize internationalization and update Vite config for locale handling

- Added `initI18n` function call in `main.tsx` to bootstrap internationalization before rendering the app.
- Updated Vite configuration to handle specific locale files for English and Chinese.
This commit is contained in:
shuaiplus
2026-04-29 02:49:45 +08:00
parent 3c5f43ecc2
commit 29a846c562
12 changed files with 2138 additions and 1828 deletions
+12 -6
View File
@@ -1,6 +1,7 @@
import { render } from 'preact';
import { QueryClient, QueryClientProvider } from '@tanstack/react-query';
import App from './App';
import { initI18n } from './lib/i18n';
import './tailwind.css';
import './styles.css';
@@ -14,9 +15,14 @@ const queryClient = new QueryClient({
},
});
render(
<QueryClientProvider client={queryClient}>
<App />
</QueryClientProvider>,
document.getElementById('root')!
);
async function bootstrap(): Promise<void> {
await initI18n();
render(
<QueryClientProvider client={queryClient}>
<App />
</QueryClientProvider>,
document.getElementById('root')!
);
}
void bootstrap();