Skip to content

Commit

Permalink
Merge pull request #1281 from ananyag309/branch
Browse files Browse the repository at this point in the history
added language translator
  • Loading branch information
ajay-dhangar authored Oct 25, 2024
2 parents 9531839 + 8bb5bfe commit 0e333f7
Showing 1 changed file with 25 additions and 2 deletions.
27 changes: 25 additions & 2 deletions src/theme/Footer/index.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,31 @@
import React from "react";
import React, { useEffect } from "react";
import { FaGithub, FaLinkedin, FaDiscord, FaTwitter } from "react-icons/fa";
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
import { faTwitter } from '@fortawesome/free-brands-svg-icons';

import Link from "@docusaurus/Link";

const Footer = () => {
useEffect(() => {
// Create script element for GTranslate
const script = document.createElement("script");
script.src = "https://cdn.gtranslate.net/widgets/latest/popup.js";
script.defer = true;
document.body.appendChild(script);

// Set GTranslate settings
window.gtranslateSettings = {
"default_language": "en",
"detect_browser_language": true,
"wrapper_selector": ".gtranslate_wrapper"
};

// Cleanup script on component unmount
return () => {
document.body.removeChild(script);
};
}, []);

return (
<footer className="bg-[#1a1b26] text-gray-300 py-12">
<div className="container mx-auto px-6 md:px-8">
Expand Down Expand Up @@ -174,6 +194,9 @@ const Footer = () => {
Privacy Policy
</Link>
</li>
<li className="list-none">
<div className="gtranslate_wrapper"></div>
</li>
</ul>
<p className="text-sm text-gray-500 mt-4 md:mt-0">
&copy; {new Date().getFullYear()} Algo, Inc. Built with Docusaurus.
Expand All @@ -184,4 +207,4 @@ const Footer = () => {
);
};

export default Footer;
export default Footer;

0 comments on commit 0e333f7

Please sign in to comment.