Add translation to any website with a single script tag. The widget provides a floating translate button that expands into a full translator UI.
Add this to your HTML:
<script src="https://translator.trooply.in/static/widget.js"
data-target-lang="hi"
data-theme="dark">
</script>
// Open the widget programmatically
TroopolyWidget.open();
// Translate specific text
TroopolyWidget.translate("Hello world", "hi");
// Set languages
TroopolyWidget.setLanguages("en", "fr");
// Close
TroopolyWidget.close();
pip install trooply-translate
from trooply_translate import TroopolyTranslator
tr = TroopolyTranslator(api_key="tr_live_...")
result = tr.translate("Hello", target="hi")
print(result.translated)
npm install @trooply/translate
import { TroopolyTranslator } from '@trooply/translate';
const tr = new TroopolyTranslator({ apiKey: 'tr_live_...' });
const r = await tr.translate('Hello', { target: 'hi' });
console.log(r.translated);