Feat: Google Translate translation for page content.

This commit is contained in:
2025-03-04 18:47:45 +00:00
parent e096f03a2a
commit 973df8f70b

View File

@@ -89,6 +89,11 @@
color: var(--accent-color); color: var(--accent-color);
} }
/* Google Translate styles */
.skiptranslate {
/* display: none; */
}
/* Main content styles */ /* Main content styles */
main { main {
max-width: 1200px; max-width: 1200px;
@@ -262,6 +267,7 @@
<header> <header>
<h1>Edward (Teddy) Middleton-Smith</h1> <h1>Edward (Teddy) Middleton-Smith</h1>
<p>Software Engineer | ERP Systems and Business Process Automation</p> <p>Software Engineer | ERP Systems and Business Process Automation</p>
<div id="google_translate_element"></div>
</header> </header>
<nav> <nav>
@@ -456,5 +462,16 @@
}); });
}); });
</script> </script>
<!-- Google Translate Script -->
<script type="text/javascript">
function googleTranslateElementInit() {
new google.translate.TranslateElement({
pageLanguage: 'en',
layout: google.translate.TranslateElement.InlineLayout.SIMPLE
}, 'google_translate_element');
}
</script>
<script type="text/javascript" src="https://translate.google.com/translate_a/element.js?cb=googleTranslateElementInit"></script>
</body> </body>
</html> </html>