From c281eadd73e5d83bc2c4808956e4c0029aff4034 Mon Sep 17 00:00:00 2001 From: AshAnand34 Date: Sat, 12 Jul 2025 23:15:17 -0700 Subject: [PATCH] feat: add Hindi translations for various tools and components --- src/components/Navbar/index.tsx | 41 +++++- src/i18n/hi.json | 187 ++++++++++++++++++++++++++ src/i18n/index.ts | 28 ++++ src/pages/tools/audio/i18n/hi.json | 64 +++++++++ src/pages/tools/csv/i18n/hi.json | 123 +++++++++++++++++ src/pages/tools/image/i18n/hi.json | 172 ++++++++++++++++++++++++ src/pages/tools/json/i18n/hi.json | 80 ++++++++++++ src/pages/tools/list/i18n/hi.json | 138 ++++++++++++++++++++ src/pages/tools/number/i18n/hi.json | 45 +++++++ src/pages/tools/pdf/i18n/hi.json | 82 ++++++++++++ src/pages/tools/string/i18n/hi.json | 196 ++++++++++++++++++++++++++++ src/pages/tools/time/i18n/hi.json | 105 +++++++++++++++ src/pages/tools/video/i18n/hi.json | 140 ++++++++++++++++++++ src/pages/tools/xml/i18n/hi.json | 42 ++++++ 14 files changed, 1441 insertions(+), 2 deletions(-) create mode 100644 src/i18n/hi.json create mode 100644 src/pages/tools/audio/i18n/hi.json create mode 100644 src/pages/tools/csv/i18n/hi.json create mode 100644 src/pages/tools/image/i18n/hi.json create mode 100644 src/pages/tools/json/i18n/hi.json create mode 100644 src/pages/tools/list/i18n/hi.json create mode 100644 src/pages/tools/number/i18n/hi.json create mode 100644 src/pages/tools/pdf/i18n/hi.json create mode 100644 src/pages/tools/string/i18n/hi.json create mode 100644 src/pages/tools/time/i18n/hi.json create mode 100644 src/pages/tools/video/i18n/hi.json create mode 100644 src/pages/tools/xml/i18n/hi.json diff --git a/src/components/Navbar/index.tsx b/src/components/Navbar/index.tsx index 39fa477..44389a9 100644 --- a/src/components/Navbar/index.tsx +++ b/src/components/Navbar/index.tsx @@ -13,7 +13,10 @@ import { ListItem, ListItemButton, ListItemText, - Stack + Stack, + Select, + MenuItem, + FormControl } from '@mui/material'; import useMediaQuery from '@mui/material/useMediaQuery'; import { useTheme } from '@mui/material/styles'; @@ -30,7 +33,7 @@ const Navbar: React.FC = ({ mode, onChangeMode: onChangeMode }) => { - const { t } = useTranslation(); + const { t, i18n } = useTranslation(); const navigate = useNavigate(); const theme = useTheme(); const isMobile = useMediaQuery(theme.breakpoints.down('md')); @@ -38,12 +41,46 @@ const Navbar: React.FC = ({ const toggleDrawer = (open: boolean) => () => { setDrawerOpen(open); }; + + const handleLanguageChange = (event: any) => { + i18n.changeLanguage(event.target.value); + }; + const navItems: { label: string; path: string }[] = [ // { label: 'Features', path: '/features' } // { label: 'About Us', path: '/about-us' } ]; + const languageSelector = ( + + + + ); + const buttons: ReactNode[] = [ + languageSelector,