Public Access
Add i18n, routing and dark-mode support
Introduce internationalization and basic routing: add i18n initialization (src/i18n.js), translation files (public/i18n/en.json, de.json), and wire i18n into the app (import in main.jsx). Update App.jsx to use react-router (BrowserRouter, Routes) and react-i18next (useTranslation), provide simple Landing/Login/Imprint pages, a language toggle and a dark-mode toggle. Add dependencies in package.json (i18next, i18next-http-backend, react-i18next, react-router-dom) and small Tailwind style tweak (custom-variant for dark) in src/style.css.
This commit is contained in:
1 parent
7ff53c0f6c
commit
c8f1d66cd2
8 files changed
+342
-63
No files matched your search
+19
@@ -0,0 +1,19 @@
|
||||
import i18n from 'i18next';
|
||||
import {initReactI18next} from 'react-i18next';
|
||||
import HttpBackend from 'i18next-http-backend';
|
||||
|
||||
|
||||
i18n.use(HttpBackend)
|
||||
.use(initReactI18next)
|
||||
.init({
|
||||
lng: 'de',
|
||||
fallbackLng: 'en',
|
||||
backend: {
|
||||
loadPath: '/i18n/{{lng}}.json',
|
||||
},
|
||||
interpolation: {
|
||||
escapeValue: false
|
||||
}
|
||||
});
|
||||
|
||||
export default i18n;
|
||||
Reference in new issue
Block a user