[Mapbender-commits] r6156 - in trunk/mapbender/http: extensions/dataTables-1.5 extensions/dataTables-1.5/lang plugins

svn_mapbender at osgeo.org svn_mapbender at osgeo.org
Tue May 11 02:59:09 EDT 2010


Author: kmq
Date: 2010-05-11 02:59:06 -0400 (Tue, 11 May 2010)
New Revision: 6156

Added:
   trunk/mapbender/http/extensions/dataTables-1.5/lang/
   trunk/mapbender/http/extensions/dataTables-1.5/lang/de.txt
   trunk/mapbender/http/extensions/dataTables-1.5/lang/en.txt
   trunk/mapbender/http/extensions/dataTables-1.5/lang/fr.txt
Modified:
   trunk/mapbender/http/plugins/mb_loadkmlgeorss.js
Log:
added i18n

Added: trunk/mapbender/http/extensions/dataTables-1.5/lang/de.txt
===================================================================
--- trunk/mapbender/http/extensions/dataTables-1.5/lang/de.txt	                        (rev 0)
+++ trunk/mapbender/http/extensions/dataTables-1.5/lang/de.txt	2010-05-11 06:59:06 UTC (rev 6156)
@@ -0,0 +1,17 @@
+{
+	"sProcessing":   "Bitte warten...",
+	"sLengthMenu":   "_MENU_ Einträge anzeigen",
+	"sZeroRecords":  "Keine Einträge vorhanden.",
+	"sInfo":         "_START_ bis _END_ von _TOTAL_ Einträgen",
+	"sInfoEmpty":    "0 bis 0 von 0 Einträgen",
+	"sInfoFiltered": "(gefiltert von _MAX_  Einträgen)",
+	"sInfoPostFix":  "",
+	"sSearch":       "Suchen",
+	"sUrl":          "",
+	"oPaginate": {
+		"sFirst":    "Erster",
+		"sPrevious": "Zurück",
+		"sNext":     "Nächster",
+		"sLast":     "Letzter"
+	}
+}

Added: trunk/mapbender/http/extensions/dataTables-1.5/lang/en.txt
===================================================================
--- trunk/mapbender/http/extensions/dataTables-1.5/lang/en.txt	                        (rev 0)
+++ trunk/mapbender/http/extensions/dataTables-1.5/lang/en.txt	2010-05-11 06:59:06 UTC (rev 6156)
@@ -0,0 +1,17 @@
+{
+	"sProcessing":   "Processing...",
+	"sLengthMenu":   "Show _MENU_ entries",
+	"sZeroRecords":  "No matching records found",
+	"sInfo":         "Showing _START_ to _END_ of _TOTAL_ entries",
+	"sInfoEmpty":    "Showing 0 to 0 of 0 entries",
+	"sInfoFiltered": "(filtered from _MAX_ total entries)",
+	"sInfoPostFix":  "",
+	"sSearch":       "Search:",
+	"sUrl":          "",
+	"oPaginate": {
+		"sFirst":    "First",
+		"sPrevious": "Previous",
+		"sNext":     "Next",
+		"sLast":     "Last"
+	}
+}

Added: trunk/mapbender/http/extensions/dataTables-1.5/lang/fr.txt
===================================================================
--- trunk/mapbender/http/extensions/dataTables-1.5/lang/fr.txt	                        (rev 0)
+++ trunk/mapbender/http/extensions/dataTables-1.5/lang/fr.txt	2010-05-11 06:59:06 UTC (rev 6156)
@@ -0,0 +1,17 @@
+{
+	"sProcessing":   "Traitement en cours...",
+	"sLengthMenu":   "Afficher _MENU_ éléments",
+	"sZeroRecords":  "Aucun élément à afficher",
+	"sInfo":         "Affichage de l\'élement _START_ à _END_ sur _TOTAL_ éléments",
+	"sInfoEmpty":    "Affichage de l\'élement 0 à 0 sur 0 éléments",
+	"sInfoFiltered": "(filtré de _MAX_ éléments au total)",
+	"sInfoPostFix":  "",
+	"sSearch":       "Rechercher :",
+	"sUrl":          "",
+	"oPaginate": {
+		"sFirst":    "Premier",
+		"sPrevious": "Précédent",
+		"sNext":     "Suivant",
+		"sLast":     "Dernier"
+	}
+}

Modified: trunk/mapbender/http/plugins/mb_loadkmlgeorss.js
===================================================================
--- trunk/mapbender/http/plugins/mb_loadkmlgeorss.js	2010-05-10 15:28:00 UTC (rev 6155)
+++ trunk/mapbender/http/plugins/mb_loadkmlgeorss.js	2010-05-11 06:59:06 UTC (rev 6156)
@@ -46,18 +46,39 @@
  * and Simplified BSD license.  
  * http://svn.osgeo.org/mapbender/trunk/mapbender/license/license.txt
  */
-options.buffer || 0.10;
+options.buffer = options.buffer || 0.10;
 options.position = options.position || 'center';
 var originalI18nObject = {
-	"labelLoadError" : "Could not load Document"
-}
+	"labelLoadError" : "Could not load Document",
+	"labelName":"Name",
+	"labelUntitled":"Untitled",
+	"labelUrlBox": "Paste URL here",
+	"sProcessing":   "Processing...",
+	"sLengthMenu":   "Show _MENU_ entries",
+	"sZeroRecords":  "No matching records found",
+	"sInfo":         "SLowing _START_ to _END_ of _TOTAL_ entries",
+	"sInfoEmpty":    "Showing 0 to 0 of 0 entries",
+	"sInfoFiltered": "(filtered from _MAX_ total entries)",
+	"sInfoPostFix":  "",
+	"sSearch":       "Search:",
+	"sUrl":          "",
+	"oPaginate": {
+		"sFirst":    "First",
+		"sPrevious": "Previous",
+		"sNext":     "Next",
+		"sLast":     "Last"
+	 }
 
 
+};
+
+var translatedI18nObject = Mapbender.cloneObject(originalI18nObject);
+
 var that = this;
 
-$('<div id="'+ options.id +'_dialog"><label>GeoRSS <input type="radio" name="type" value="GeoRSS" checked="checked"/></label>\
-	 <label>KML<input type="radio" name="type" value="KML"></label><br />\
-	 <label>Paste Url here </label> <input id="' + options.id +'_url" type="text" /></div>').dialog({
+$('<div id="'+ options.id +'_dialog"><label>GeoRSS <input type="radio" name="type" value="GeoRSS" checked="checked"/></label>'+
+	 '<label>KML<input type="radio" name="type" value="KML"></label><br />'+
+	 '<label class="labelUrlBox">'+ translatedI18nObject.labelUrlBox  +'</label> <input id="' + options.id +'_url" type="text" /></div>').dialog({
                 bgiframe: true,
                 autoOpen: false,
                 height: 240,
@@ -70,10 +91,11 @@
 						$dialog.dialog("close");
 				
 						var format = $("input:checked",$dialog).val();
+						var endpointURL = "";
 						if( format == "GeoRSS"){
-							var endpointURL = "../php/geoRSSToGeoJSON.php";
+							endpointURL = "../php/geoRSSToGeoJSON.php";
 						}else{
-							var endpointURL = "../php/kmlToGeoJSON.php";
+							endpointURL = "../php/kmlToGeoJSON.php";
 						}
 						$.ajax({ url: endpointURL,
 							data: {url: url},
@@ -82,7 +104,7 @@
 							success: function(data,textStatus,xhr){
 						
 							if(data.errorMessage){
-								$("<div>Could not load Document<div>").dialog({ buttons: {"OK":function(){ $(this).dialog("close");  }} });
+								$("<div class='labelLoadError'>"+ translatedI18nObject.labelLoadError +"<div>").dialog({ buttons: {"OK":function(){ $(this).dialog("close"); } } } );
 								return;
 							}
 
@@ -91,14 +113,14 @@
 							var title = "";
 							var popup = null;
 							$("table", $dialog).remove();
-							var $table = $("<table><thead><tr><th>Name</th></tr></thead><tbody></tbody></table>");
+							var $table = $("<table><thead><tr><th class='labelName'>"+ translatedI18nObject.labelName  +"</th></tr></thead><tbody></tbody></table>");
 							if(data.features){
 								// we always transform _from_ 4326 geoRSS and KML use this as their default
 								var projSrc = new Proj4js.Proj('EPSG:4326');
 								var projDest = new Proj4js.Proj($map.epsg);
 								var markeroptions = {width: "19px", height: "34px"};
 								for(var i in data.features){
-									title = data.features[i].properties.title || data.features[i].properties.name || "untitled";
+									title = data.features[i].properties.title || data.features[i].properties.name || translatedI18nObject.labelUntitled;
 									$row = $("<tr><td>"+ title +"</td></tr>");
 									if(data.features[i].properties.iconurl){
 										markeroptions.img = {url: data.features[i].properties.iconurl, offset: {x:0,y:0}} ;
@@ -132,10 +154,10 @@
 											var highlightmarker = new Mapbender.Marker(point,$map, markeroptions);
 									
 											$('<div style="max-height:20em; max-width:20em">'+ feature.properties.description + "</div>").dialog({
-												title: feature.properties.title || feature.properties.name || "untitled",
+												title: feature.properties.title || feature.properties.name || translatedI18nObject.labelUntitled,
 												position: [mapPoint.x+offset.left+20, mapPoint.y + offset.top+20 ],
 												autoOpen: true,
-												buttons : {"Close":function(){
+												buttons : {"Close" :function(){
 													$(this).dialog("close");
 													}},
 												close: function(){
@@ -149,7 +171,7 @@
 													markers.push(marker);
 												}
 												});
-										}
+										};
 									})(data.features[i], marker));
 									$row.css("cursor","pointer");
 									$("tbody",$table).append($row);
@@ -174,13 +196,17 @@
 								}
 							});
 							$tableDialog.append($table);
-							$table.dataTable({"bJQueryUI": true });
+							Mapbender.languageId;
+							$table.dataTable({"bJQueryUI": true ,
+								"oLanguage":{
+									"sUrl":"../extensions/dataTables-1.5/lang/"+Mapbender.languageId +".txt"
+									} });
 							
 
 							$dialog.dialog('close');
 							},
 							error: function(xhr, ajaxOptions,error){
-								$("<div>Could not load Document</div>").dialog({ buttons: {"OK":function(){ $(this).dialog("close");  }} });	
+								$("<div class='labelLoadError'>"+ translatedI18nObject.labelLoadError +"</div>").dialog({ buttons: {"OK":function(){ $(this).dialog("close");  }} });	
 							}
 						});
 					},
@@ -189,6 +215,13 @@
 					}
 				}
 });
+Mapbender.events.localize.register(function(){
+	Mapbender.modules.i18n.queue(options.id, originalI18nObject, function(translatedI18nObject){
+		alert('need to localize here');
+		$('.labelLoadError').text(translatedI18nObject.labelLoadError); 
+		$('.labelUrlBox').text(translatedI18nObject.labelUrlBox); 
+	})
+});
 
 Mapbender.events.init.register(function () {
 	$(that).click(function(){



More information about the Mapbender_commits mailing list