feat(client): add i18n with i18next and react-i18next
- install i18next and react-i18next - create src/i18n/index.ts bootstrapping i18next with initReactI18next - add src/i18n/locales/en.json with keys for nav, all pages, and ThemeSwitcher - replace hardcoded English strings in App, all pages, and ThemeSwitcher with t() - move static column definitions inside components where useTranslation is available
This commit is contained in:
1 parent
aefa1db2bd
commit
876b1518da
11 files changed
+207
-56
No files matched your search
+10
-6
@@ -5,18 +5,22 @@ import { KeysPage } from './pages/KeysPage';
|
||||
import { SessionsPage } from './pages/SessionsPage';
|
||||
import { ScenariosPage } from './pages/ScenariosPage';
|
||||
import { useState } from 'react';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
|
||||
type Section = 'environments' | 'keys' | 'sessions' | 'scenarios';
|
||||
|
||||
const NAV: { id: Section; label: string }[] = [
|
||||
{ id: 'environments', label: 'Environments' },
|
||||
{ id: 'keys', label: 'Keys' },
|
||||
{ id: 'sessions', label: 'Sessions' },
|
||||
{ id: 'scenarios', label: 'Scenarios' },
|
||||
];
|
||||
|
||||
|
||||
export default function App() {
|
||||
const [active, setActive] = useState<Section>('scenarios');
|
||||
const { t } = useTranslation();
|
||||
|
||||
const NAV: { id: Section; label: string }[] = [
|
||||
{ id: 'environments', label: t('nav.environments') },
|
||||
{ id: 'keys', label: t('nav.keys') },
|
||||
{ id: 'sessions', label: t('nav.sessions') },
|
||||
{ id: 'scenarios', label: t('nav.scenarios') },
|
||||
];
|
||||
|
||||
return (
|
||||
<div className={styles.shell}>
|
||||
|
||||
Reference in new issue
Block a user