]> khamidou — GitHub mirrors - popcorn-js.git/commitdiff
added Bogomil's wiki language fix [#101 state:peer-review-requested]
authorAnna Sobiepanek <annaopensource@gmail.com>
Tue, 5 Oct 2010 01:36:34 +0000 (21:36 -0400)
committerAnna Sobiepanek <annaopensource@gmail.com>
Tue, 5 Oct 2010 01:36:34 +0000 (21:36 -0400)
demos/semantic_video/xml/webMadeMovies.xml
popcorn.js

index 3ff05acb7e1b32adf0e382c836ebddc8385a73ed..934c1ea7c3fa325a31c86bf7255ff0f9ea387e9f 100644 (file)
@@ -91,7 +91,7 @@
       <videotag target="inthisvideo" in="00:00:05:02" out="00:00:10:07">Steve Song</videotag>
       <attribution in="00:00:05:02" out="00:00:10:07" target="container5" resourceid="villagetelcoattrib"></attribution>
       <twitter in="00:00:05:02" out="00:00:10:07" title="Steve Song" source="from:stevesong" target="personaltwitter" width="238" height="120"/>
-      <wiki in="00:00:05:02" out="00:00:10:07" resourceid="villagetelco" numberOfWords="200" target="wikidiv"/>
+      <wiki in="00:00:05:02" out="00:00:10:07" resourceid="villagetelco" numberOfWords="200" lang="bg" target="wikidiv"/>
       <flickr in="00:00:05:02" out="00:00:10:07" target="personalflickr" userid="78868639@N00" numberofimages="8" padding="4px"/>
       <googlenews in="00:00:05:02" out="00:00:10:07" target="googlenewsdiv" topic="Village Telco"/>
 
index d66e03395095ef7e8cfb32fa99cfaa3c20eaea1d..ea3142f56b7006193ec08c17ac093c52cf8b70ad 100644 (file)
   
   Popcorn.WikiCommand = function(name, params, text, videoManager) {
     Popcorn.VideoCommand.call(this, name, params, text, videoManager);
-    
+    //L10n
     var src = this.params.src;
+    var lang = this.params.lang;
+    if (lang === undefined) {lang="en";}   
+    //end L10n
     var length = this.params.numberOfWords;
     // Setup a default, hidden div to hold the images
     var target = document.createElement('div');
     // Div is hidden by default
     target.setAttribute('style', 'display:none');
     // This uses jquery
-    $.getJSON("http://en.wikipedia.org/w/api.php?action=parse&props=text&page=" + ( this.params.title || src.slice(src.lastIndexOf("/")+1) ) + "&format=json&callback=?", function(data){
+    $.getJSON("http://"+lang+".wikipedia.org/w/api.php?action=parse&props=text&page=" + ( this.params.title || src.slice(src.lastIndexOf("/")+1) ) + "&format=json&callback=?", function(data){
       if(data) {
         //make a link to the document
         var link = document.createElement('a');
         target.appendChild(desc);
       }
     }); 
-    
+
     this.target = target;
     this.onIn = function() {
       this.target.setAttribute('style', 'display:inline');
     this.onOut = function() {
       this.target.setAttribute('style', 'display:none');
     };
-       };
+  };
   ////////////////////////////////////////////////////////////////////////////
   // Footnote Command
   ////////////////////////////////////////////////////////////////////////////