Added the foundation for making the frontend multilingual. Now only need to import useTranslation and use t('key') for all user-facing text for all pages (+add key:value pairs in src/locales for each language ofc)

- package.json -> Imported packages i18next & react-i18next for multilingual functionality.
- src/App.jsx -> Imported LanguageSwitcher from ./components/LanguageSwitcher and added <LanguageSwitcher /> component at the beginning of layout so it's always visible.
- src/components/LanguageSwitcher.jsx -> LanguageSwitcher component, consists of a dropdown menu that always appears at top right corner for choosing language.
- src/i18n.js -> Initialize and configure i18next for app-wide multilingual support.
- src/locales/en.json + src/locales/fr.json -> Empty json files that will soon contain translation key:value pairs for each page.
- src/main.jsx -> Imported src/i18n.js for multilingual functionality.
This commit is contained in:
K
2025-06-26 23:06:25 +05:30
parent 816d115fbc
commit 7dc8a49a8d
7 changed files with 83 additions and 0 deletions
+2
View File
@@ -13,10 +13,12 @@
"@reduxjs/toolkit": "^2.6.0",
"@tailwindcss/vite": "^4.0.9",
"axios": "^1.8.4",
"i18next": "^25.2.1",
"lucide-react": "^0.476.0",
"react": "^19.0.0",
"react-dom": "^19.0.0",
"react-hot-toast": "^2.5.2",
"react-i18next": "^15.5.3",
"react-icons": "^5.5.0",
"react-redux": "^9.2.0",
"react-router-dom": "^7.2.0"