Skip to content

Commit

Permalink
MultiLangauge Facility
Browse files Browse the repository at this point in the history
  • Loading branch information
Ojas-Arora committed Oct 4, 2024
1 parent c484e45 commit cb7f868
Showing 1 changed file with 34 additions and 0 deletions.
34 changes: 34 additions & 0 deletions frontend/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,42 @@
<link rel="icon" type="image/svg+xml" href="./src/assets/stationsaarthi.svg" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Station Saarthi</title>
<style>
/* Style for the Google Translate element */
#google_element {
position: absolute;
top: 10px; /* Distance from the top */
left: 25%; /* Position between middle and left corner */
transform: translateX(-50%); /* Adjust for half the element's width */
z-index: 1000; /* Ensure it stays on top */
}
</style>
</head>
<body>
<div id="google_element"></div>
<!-- Load Google Translate script over HTTPS and handle errors -->
<script
type="text/javascript"
src="https://translate.google.com/translate_a/element.js?cb=loadGoogleTranslate"
onerror="handleError(this)"
></script>

<script type="text/javascript">
function loadGoogleTranslate() {
new google.translate.TranslateElement(
{
pageLanguage: "en",
includedLanguages: "en,hi,pa,sa,mr,ur,bn,es,fr,de,it",
layout: google.translate.TranslateElement.InlineLayout.SIMPLE,
},
"google_element"
);
}

function handleError(error) {
console.error("Error loading Google Translate script:", error);
}
</script>
<div id="root"></div>
<script type="module" src="/src/main.jsx"></script>
</body>
Expand Down

0 comments on commit cb7f868

Please sign in to comment.