lingator
Version:
A plug-and-play npm package to auto-translate webpages using Google's Gemini AI.
26 lines (23 loc) • 984 B
HTML
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Lingo Test</title>
<script type="module">
import { initLingo, translatePage } from './index.js';
document.addEventListener("DOMContentLoaded", () => {
initLingo(['en', 'hi', 'mr','fr','de']); // Initialize with desired languages
});
</script>
</head>
<body>
<h1>Hello World</h1>
<p>This is a test page for Lingo.</p>
<button onclick="import('./index.js').then(m => m.translatePage('hi'))">Hindi</button>
<button onclick="import('./index.js').then(m => m.translatePage('mr'))">Marathi</button>
<button onclick="import('./index.js').then(m => m.translatePage('en'))">English</button>
<button onclick="import('./index.js').then(m => m.translatePage('fr'))">French</button>
<button onclick="import('./index.js').then(m => m.translatePage('de'))">German</button>
</body>
</html>