Google Translate Widget - Translation complete callback

后端 未结 3 1125
梦谈多话
梦谈多话 2021-01-17 18:26

I\'m using the google translate widget on one of my sites with the following google supplied code:

<
3条回答
  •  天命终不由人
    2021-01-17 18:55

    You can detect changes like this:

    $('#some-translatable-element').bind('DOMSubtreeModified', function() {
      yourCallback();
    });
    

    The drawback is that the event is beeing fired multiple times since google translate does multiple changes in the process.

    A suggestion is to detect changes on the last element on your page, cause then you know all elements above is translated.

提交回复
热议问题