How to set the converted English text to another textbox using Google Translator Api?

后端 未结 4 1321
萌比男神i
萌比男神i 2021-02-06 19:26

I have two text box one for English another for Hindi, when i type in English on first box, the texts should appear as Hindi version on the second box (on key up event).

4条回答
  •  挽巷
    挽巷 (楼主)
    2021-02-06 19:53

    Convert from English (sourceLanguage) to your Langunage, Then Pass your destination language like Hindi for hi, gujarati for gu, Type into the editor text will converted to your language

          function onLoad() {
            var options = {
              sourceLanguage: 'en',
              destinationLanguage: ['gu'],
              shortcutKey: 'ctrl+m',
              transliterationEnabled: true
            }
    

    Complete Example :

          
    
          
    
          

提交回复
热议问题