Skip to main content
Version: v9.0.0

Events

At some moments you might need some data related to the tool's use, like number of openings, translation, whether the tool is loades, among others. For that, you must listen to the events triggered by HT, just like the quoted example.

The events triggered by HT are:

EventDescriptionReturn
coreReadyAvatar loadedtrue
activatedText Translator was activatedundefined
deactivatedText Translator was deactivatedundefined
signalizedTriggers when the text is full signalizedundefined
errorOnAuthAuthentication errorstring: mensagem referente ao erro ocorrido
errorOnTranslateError while translating the text in the Hand Talk's serverundefined
notCompatibleBrowser or hardware not compatiblestring: 'withoutCanvas' ou 'withoutWebGL'

Example of the Event Listener

Javascript

// Listens to the signalized event
ht.on('signalized', function () {
console.log('New translated phrase!');
});

HTML

<body>
<!-- Takes the latest version of the Hand Talk Plugin. -->
<script src="https://plugin.handtalk.me/web/latest/handtalk.min.js"></script>
<script>
var ht = new HT({
// Change it to your access token
token: 'TOKEN'
});
// Listens to the signalized event
ht.on('signalized', function () {
console.log('New translated phrase!');
});
</script>
</body>