muaz-khan / WebRTC-Experiment

WebRTC, WebRTC and WebRTC. Everything here is all about WebRTC!!
https://www.webrtc-experiment.com/
MIT License
11.73k stars 3.95k forks source link

Autotranslation doesn't work #253

Open lavachat opened 10 years ago

lavachat commented 10 years ago

If automatic translation is enabled, no messages are received. The rtcMultiConnection.onmessage event doesn't fire. I tested this issue on my own experimental site and on https://www.webrtc-experiment.com/RTCMultiConnection/MultiRTC/

muaz-khan commented 10 years ago

I think API-Key is expired:

translator.translateLanguage(textToConvert, {
    from: 'language-of-the-text',
    to: 'convert-into',
    api_key: 'AIzaSyCUmCjvKRb-kOYrnoL2xaXb8I-_JJeKpf0', // use your own key
    callback: function (translatedText) {
        console.log('translated text', translatedText);
    }
});

https://github.com/muaz-khan/WebRTC-Experiment/tree/master/Translator.js#translatelanguage

lavachat commented 10 years ago

And what about switching to a free service like: http://www.microsoft.com/en-us/translator/developers.aspx

This API is available for free for usage up to 2 million characters per month.

If you don't want another API than the Google-API: Is it possible to give an alert, if the API-Key is expired or just omit the translation and return the original text as translation?