]> khamidou — GitHub mirrors - popcorn-js.git/commitdiff
Merge branch 'translate' of git://github.com/ScottDowne/popcorn-js
authorDaniel Hodgin <dhodgin@gmail.com>
Fri, 25 Jun 2010 16:31:00 +0000 (12:31 -0400)
committerDaniel Hodgin <dhodgin@gmail.com>
Fri, 25 Jun 2010 16:31:00 +0000 (12:31 -0400)
1  2 
popcorn.js

diff --cc popcorn.js
index 82be994ec041fe903fceb7dce19fb01137d14032,ba1c1b2352406e463f25ae62bd48f435a7304f27..6b998ee673f98e41df09e0df55849f07dee9d4a0
    };
    VideoCommand.count = 0;
  
 -  // Child commands. Uses onIn() and onOut() to do time based operations
 -  var SubtitleCommand = function(name, params, text) {
 -    VideoCommand.call(this, name, params, text);
 +  ////////////////////////////////////////////////////////////////////////////
 +  // Subtitle Command
 +  ////////////////////////////////////////////////////////////////////////////
 +
 +  var SubtitleCommand = function(name, params, text, videoManager) {
 +    VideoCommand.call(this, name, params, text, videoManager);
      this.onIn = function() {
-       document.getElementById("sub").innerHTML  = this.text;
+       var i = document.getElementById("language").selectedIndex;
+       google.language.translate(this.text, '', document.getElementById("language").options[i].getAttribute("val"), function(result) {
+         document.getElementById("sub").innerHTML  = result.translation;
+       });
+       
      };
      this.onOut = function() {
        document.getElementById("sub").innerHTML  = "";