diff --git a/frontend/src/App.jsx b/frontend/src/App.jsx
index cc51905..65fa1b4 100644
--- a/frontend/src/App.jsx
+++ b/frontend/src/App.jsx
@@ -16,6 +16,7 @@ import NotificationPage from "./Pages/notification";
import Chatbot from "./components/chatbot";
import ContactUs from "./Pages/ContactUs";
import Settings from "./components/Settings";
+import GoogleTranslate from "./Pages/GoogleTranslate";
import Help from "./components/help";
import Contributor from "./Pages/contributor";
import Payment from "./Pages/Payment";
@@ -44,6 +45,7 @@ function App() {
} />
} />
} />
+ } />
} />
} />
} />
@@ -51,7 +53,8 @@ function App() {
} />
} />
} />
- } /> {/* Restored PrivacyPolicy */}
+ } />{" "}
+ {/* Restored PrivacyPolicy */}
} /> {/* Added User */}
} />
diff --git a/frontend/src/Pages/GoogleTranslate.jsx b/frontend/src/Pages/GoogleTranslate.jsx
new file mode 100644
index 0000000..b5df449
--- /dev/null
+++ b/frontend/src/Pages/GoogleTranslate.jsx
@@ -0,0 +1,148 @@
+import React, { useEffect } from "react";
+
+const GoogleTranslate = () => {
+ useEffect(() => {
+ window.googleTranslateInit = () => {
+ if (!window.google?.translate?.TranslateElement) {
+ setTimeout(window.googleTranslateInit, 100);
+ } else {
+ new window.google.translate.TranslateElement(
+ {
+ pageLanguage: "en",
+ includedLanguages:
+ "en,hi,pa,sa,mr,ur,bn,es,ja,ko,zh-CN,es,nl,fr,de,it,ta,te",
+ layout:
+ window.google.translate.TranslateElement.InlineLayout.HORIZONTAL,
+ defaultLanguage: "en",
+ autoDisplay: false,
+ },
+ "google_element"
+ );
+ }
+ cleanUpGadgetText();
+ };
+
+ const loadGoogleTranslateScript = () => {
+ if (!document.getElementById("google_translate_script")) {
+ const script = document.createElement("script");
+ script.type = "text/javascript";
+ script.src =
+ "https://translate.google.com/translate_a/element.js?cb=googleTranslateInit";
+ script.id = "google_translate_script";
+ script.onerror = () =>
+ console.error("Error loading Google Translate script");
+ document.body.appendChild(script);
+ }
+ };
+
+ const cleanUpGadgetText = () => {
+ const gadgetElement = document.querySelector(".goog-te-gadget");
+ if (gadgetElement) {
+ const textNodes = gadgetElement.childNodes;
+ textNodes.forEach((node) => {
+ if (node.nodeType === Node.TEXT_NODE) {
+ node.textContent = ""; // Clear text content
+ }
+ });
+ }
+ };
+ loadGoogleTranslateScript();
+
+ if (window.google && window.google.translate) {
+ window.googleTranslateInit();
+ }
+
+ return () => {
+ // Cleanup logic if necessary
+ };
+ }, []);
+
+ return (
+
+
+
+ );
+};
+
+export default GoogleTranslate;
diff --git a/frontend/src/Pages/Herosection.jsx b/frontend/src/Pages/Herosection.jsx
index d674302..750dcf4 100644
--- a/frontend/src/Pages/Herosection.jsx
+++ b/frontend/src/Pages/Herosection.jsx
@@ -17,6 +17,7 @@ import Navbar from "../components/navbar";
import Language from "../components/language";
import { FaUserAlt } from "react-icons/fa";
import Popup from "../components/popup";
+import GoogleTranslate from "./GoogleTranslate";
const Herosection = () => {
const navigate = useNavigate();
@@ -63,12 +64,19 @@ const Herosection = () => {
+
-
+
+
+
+
Namaste !! Yatree{" "}