Changeset 6313
- Timestamp:
- 02/15/08 16:15:48 (1 year ago)
- Files:
-
- trunk/openlayers/lib/OpenLayers.js (modified) (2 diffs)
- trunk/openlayers/lib/OpenLayers/Ajax.js (modified) (1 diff)
- trunk/openlayers/lib/OpenLayers/BaseTypes.js (modified) (10 diffs)
- trunk/openlayers/lib/OpenLayers/BaseTypes/Bounds.js (modified) (1 diff)
- trunk/openlayers/lib/OpenLayers/BaseTypes/LonLat.js (modified) (1 diff)
- trunk/openlayers/lib/OpenLayers/BaseTypes/Pixel.js (modified) (1 diff)
- trunk/openlayers/lib/OpenLayers/Control/LayerSwitcher.js (modified) (2 diffs)
- trunk/openlayers/lib/OpenLayers/Control/OverviewMap.js (modified) (1 diff)
- trunk/openlayers/lib/OpenLayers/Control/Permalink.js (modified) (1 diff)
- trunk/openlayers/lib/OpenLayers/Control/Scale.js (modified) (1 diff)
- trunk/openlayers/lib/OpenLayers/Format.js (modified) (2 diffs)
- trunk/openlayers/lib/OpenLayers/Format/GML.js (modified) (1 diff)
- trunk/openlayers/lib/OpenLayers/Format/KML.js (modified) (1 diff)
- trunk/openlayers/lib/OpenLayers/Format/WFS.js (modified) (2 diffs)
- trunk/openlayers/lib/OpenLayers/Lang (added)
- trunk/openlayers/lib/OpenLayers/Lang.js (added)
- trunk/openlayers/lib/OpenLayers/Lang/en-CA.js (added)
- trunk/openlayers/lib/OpenLayers/Lang/en.js (added)
- trunk/openlayers/lib/OpenLayers/Lang/fr.js (added)
- trunk/openlayers/lib/OpenLayers/Layer/GML.js (modified) (1 diff)
- trunk/openlayers/lib/OpenLayers/Layer/Google.js (modified) (1 diff)
- trunk/openlayers/lib/OpenLayers/Layer/MultiMap.js (modified) (1 diff)
- trunk/openlayers/lib/OpenLayers/Layer/Vector.js (modified) (3 diffs)
- trunk/openlayers/lib/OpenLayers/Layer/VirtualEarth.js (modified) (1 diff)
- trunk/openlayers/lib/OpenLayers/Layer/WFS.js (modified) (3 diffs)
- trunk/openlayers/lib/OpenLayers/Layer/Yahoo.js (modified) (1 diff)
- trunk/openlayers/lib/OpenLayers/Map.js (modified) (1 diff)
- trunk/openlayers/lib/OpenLayers/Tile.js (modified) (1 diff)
- trunk/openlayers/lib/OpenLayers/Util.js (modified) (3 diffs)
- trunk/openlayers/tests/list-tests.html (modified) (1 diff)
- trunk/openlayers/tests/test_Lang.html (added)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/openlayers/lib/OpenLayers.js
r6240 r6313 5 5 /* 6 6 * @requires OpenLayers/BaseTypes.js 7 * @requires OpenLayers/Lang/en.js 7 8 */ 8 9 … … 202 203 "OpenLayers/Control/MouseToolbar.js", 203 204 "OpenLayers/Control/NavToolbar.js", 204 "OpenLayers/Control/EditingToolbar.js" 205 "OpenLayers/Control/EditingToolbar.js", 206 "OpenLayers/Lang.js", 207 "OpenLayers/Lang/en.js" 205 208 ); // etc. 206 209 trunk/openlayers/lib/OpenLayers/Ajax.js
r6190 r6313 35 35 */ 36 36 OpenLayers.nullHandler = function(request) { 37 alert( "Unhandled request return " + request.statusText);37 alert(OpenLayers.i18n("unhandledRequest", {'statusText':request.statusText})); 38 38 }; 39 39 trunk/openlayers/lib/OpenLayers/BaseTypes.js
r5686 r6313 10 10 * @requires OpenLayers/BaseTypes/Bounds.js 11 11 * @requires OpenLayers/BaseTypes/Element.js 12 * @requires OpenLayers/Lang/en.js 12 13 */ 13 14 /** 14 15 /** 15 16 * Header: OpenLayers Base Types 16 17 * OpenLayers custom string, number and function functions are described here. … … 24 25 25 26 OpenLayers.String = { 27 26 28 /** 27 29 * APIFunction: OpenLayers.String.startsWith … … 91 93 return camelizedString; 92 94 }, 93 95 94 96 /** 95 97 * APIFunction: OpenLayers.String.format … … 142 144 */ 143 145 String.prototype.startsWith = function(sStart) { 144 OpenLayers.Console.warn( 145 "This method has been deprecated and will be removed in 3.0. " + 146 "Please use OpenLayers.String.startsWith instead" 147 ); 146 OpenLayers.Console.warn(OpenLayers.i18n("methodDeprecated", 147 {'newMethod':'OpenLayers.String.startsWith'})); 148 148 return OpenLayers.String.startsWith(this, sStart); 149 149 }; … … 162 162 */ 163 163 String.prototype.contains = function(str) { 164 OpenLayers.Console.warn( 165 "This method has been deprecated and will be removed in 3.0. " + 166 "Please use OpenLayers.String.contains instead" 167 ); 164 OpenLayers.Console.warn(OpenLayers.i18n("methodDeprecated", 165 {'newMethod':'OpenLayers.String.contains'})); 168 166 return OpenLayers.String.contains(this, str); 169 167 }; … … 180 178 */ 181 179 String.prototype.trim = function() { 182 OpenLayers.Console.warn( 183 "This method has been deprecated and will be removed in 3.0. " + 184 "Please use OpenLayers.String.trim instead" 185 ); 180 OpenLayers.Console.warn(OpenLayers.i18n("methodDeprecated", 181 {'newMethod':'OpenLayers.String.trim'})); 186 182 return OpenLayers.String.trim(this); 187 183 }; … … 199 195 */ 200 196 String.prototype.camelize = function() { 201 OpenLayers.Console.warn( 202 "This method has been deprecated and will be removed in 3.0. " + 203 "Please use OpenLayers.String.camelize instead" 204 ); 197 OpenLayers.Console.warn(OpenLayers.i18n("methodDeprecated", 198 {'newMethod':'OpenLayers.String.camelize'})); 205 199 return OpenLayers.String.camelize(this); 206 200 }; … … 316 310 */ 317 311 Number.prototype.limitSigDigs = function(sig) { 318 OpenLayers.Console.warn( 319 "This method has been deprecated and will be removed in 3.0. " + 320 "Please use OpenLayers.Number.limitSigDigs instead" 321 ); 312 OpenLayers.Console.warn(OpenLayers.i18n("methodDeprecated", 313 {'newMethod':'OpenLayers.String.limitSigDigs'})); 322 314 return OpenLayers.Number.limitSigDigs(this, sig); 323 315 }; … … 389 381 */ 390 382 Function.prototype.bind = function() { 391 OpenLayers.Console.warn( 392 "This method has been deprecated and will be removed in 3.0. " + 393 "Please use OpenLayers.Function.bind instead" 394 ); 383 OpenLayers.Console.warn(OpenLayers.i18n("methodDeprecated", 384 {'newMethod':'OpenLayers.String.bind'})); 395 385 // new function takes the same arguments with this function up front 396 386 Array.prototype.unshift.apply(arguments, [this]); … … 412 402 */ 413 403 Function.prototype.bindAsEventListener = function(object) { 414 OpenLayers.Console.warn( 415 "This method has been deprecated and will be removed in 3.0. " + 416 "Please use OpenLayers.Function.bindAsEventListener instead" 417 ); 404 OpenLayers.Console.warn(OpenLayers.i18n("methodDeprecated", 405 {'newMethod':'OpenLayers.String.bindAsEventListener'})); 418 406 return OpenLayers.Function.bindAsEventListener(this, object); 419 407 }; trunk/openlayers/lib/OpenLayers/BaseTypes/Bounds.js
r6131 r6313 233 233 add:function(x, y) { 234 234 if ( (x == null) || (y == null) ) { 235 var msg = "You must pass both x and y values to the add function.";235 var msg = OpenLayers.i18n("boundsAddError"); 236 236 OpenLayers.Console.error(msg); 237 237 return null; trunk/openlayers/lib/OpenLayers/BaseTypes/LonLat.js
r6131 r6313 85 85 add:function(lon, lat) { 86 86 if ( (lon == null) || (lat == null) ) { 87 var msg = "You must pass both lon and lat values " + 88 "to the add function."; 87 var msg = OpenLayers.i18n("lonlatAddError"); 89 88 OpenLayers.Console.error(msg); 90 89 return null; trunk/openlayers/lib/OpenLayers/BaseTypes/Pixel.js
r6131 r6313 92 92 add:function(x, y) { 93 93 if ( (x == null) || (y == null) ) { 94 var msg = "You must pass both x and y values to the add function.";94 var msg = OpenLayers.i18n("pixelAddError"); 95 95 OpenLayers.Console.error(msg); 96 96 return null; trunk/openlayers/lib/OpenLayers/Control/LayerSwitcher.js
r6149 r6313 505 505 506 506 this.baseLbl = document.createElement("div"); 507 this.baseLbl.innerHTML = "<u>Base Layer</u>";507 this.baseLbl.innerHTML = OpenLayers.i18n("baseLayer"); 508 508 this.baseLbl.style.marginTop = "3px"; 509 509 this.baseLbl.style.marginLeft = "3px"; … … 518 518 519 519 this.dataLbl = document.createElement("div"); 520 this.dataLbl.innerHTML = "<u>Overlays</u>";520 this.dataLbl.innerHTML = OpenLayers.i18n("overlays"); 521 521 this.dataLbl.style.marginTop = "3px"; 522 522 this.dataLbl.style.marginLeft = "3px"; trunk/openlayers/lib/OpenLayers/Control/OverviewMap.js
r6149 r6313 499 499 if(this.map.units != 'degrees') { 500 500 if(this.ovmap.getProjection() && (this.map.getProjection() != this.ovmap.getProjection())) { 501 alert( 'The overview map only works when it is in the same projection as the main map');501 alert(OpenLayers.i18n("sameProjection")); 502 502 } 503 503 } trunk/openlayers/lib/OpenLayers/Control/Permalink.js
r6149 r6313 112 112 this.div.className = this.displayClass; 113 113 this.element = document.createElement("a"); 114 this.element.innerHTML = "Permalink";114 this.element.innerHTML = OpenLayers.i18n("permalink"); 115 115 this.element.href=""; 116 116 this.div.appendChild(this.element); trunk/openlayers/lib/OpenLayers/Control/Scale.js
r5614 r6313 69 69 } 70 70 71 this.element.innerHTML = "Scale = 1 : " + scale;71 this.element.innerHTML = OpenLayers.i18n("scale", {'scaleDenom':scale}); 72 72 }, 73 73 trunk/openlayers/lib/OpenLayers/Format.js
r5614 r6313 69 69 */ 70 70 read: function(data) { 71 alert( "Read not implemented.");71 alert(OpenLayers.i18n("readNotImplemented")); 72 72 }, 73 73 … … 83 83 */ 84 84 write: function(object) { 85 alert( "Write not implemented.");85 alert(OpenLayers.i18n("writeNotImplemented")); 86 86 }, 87 87 trunk/openlayers/lib/OpenLayers/Format/GML.js
r5614 r6313 155 155 } 156 156 } else { 157 OpenLayers.Console.error( "Unsupported geometry type: " +158 type);157 OpenLayers.Console.error(OpenLayers.i18n( 158 "unsupportedGeometryType", {'geomType':type})); 159 159 } 160 160 // stop looking for different geometry types trunk/openlayers/lib/OpenLayers/Format/KML.js
r6195 r6313 581 581 } 582 582 } else { 583 OpenLayers.Console.error( "Unsupported geometry type: " +584 type);583 OpenLayers.Console.error(OpenLayers.i18n( 584 "unsupportedGeometryType", {'geomType':type})); 585 585 } 586 586 // stop looking for different geometry types trunk/openlayers/lib/OpenLayers/Format/WFS.js
r6150 r6313 130 130 */ 131 131 update: function(feature) { 132 if (!feature.fid) { alert( "Can't update a feature for which there is no FID."); }132 if (!feature.fid) { alert(OpenLayers.i18n("noFID")); } 133 133 var updateNode = this.createElementNS(this.wfsns, 'wfs:Update'); 134 134 updateNode.setAttribute("typeName", this.layerName); … … 187 187 remove: function(feature) { 188 188 if (!feature.fid) { 189 alert( "Can't delete a feature for which there is no FID.");189 alert(OpenLayers.i18n("noFID")); 190 190 return false; 191 191 } trunk/openlayers/lib/OpenLayers/Layer/GML.js
r5828 r6313 158 158 */ 159 159 requestFailure: function(request) { 160 alert( "Error in loading GML file "+this.url);160 alert(OpenLayers.i18n("errorLoadingGML", {'url':this.url})); 161 161 this.events.triggerEvent("loadend"); 162 162 }, trunk/openlayers/lib/OpenLayers/Layer/Google.js
r5614 r6313 310 310 */ 311 311 getWarningHTML:function() { 312 313 var html = ""; 314 html += "The Google Layer was unable to load correctly.<br>"; 315 html += "<br>"; 316 html += "To get rid of this message, select a new BaseLayer "; 317 html += "in the layer switcher in the upper-right corner.<br>"; 318 html += "<br>"; 319 html += "Most likely, this is because the Google Maps library"; 320 html += " script was either not included, or does not contain the"; 321 html += " correct API key for your site.<br>"; 322 html += "<br>"; 323 html += "Developers: For help getting this working correctly, "; 324 html += "<a href='http://trac.openlayers.org/wiki/Google' "; 325 html += "target='_blank'>"; 326 html += "click here"; 327 html += "</a>"; 328 329 return html; 312 return OpenLayers.i18n("googleWarning"); 330 313 }, 331 314 trunk/openlayers/lib/OpenLayers/Layer/MultiMap.js
r5614 r6313 98 98 */ 99 99 getWarningHTML:function() { 100 101 var html = ""; 102 html += "The MM Layer was unable to load correctly.<br>"; 103 html += "<br>"; 104 html += "To get rid of this message, select a new BaseLayer "; 105 html += "in the layer switcher in the upper-right corner.<br>"; 106 html += "<br>"; 107 html += "Most likely, this is because the MM library"; 108 html += " script was either not correctly included.<br>"; 109 html += "<br>"; 110 html += "Demmlopers: For help getting this working correctly, "; 111 html += "<a href='http://trac.openlayers.org/wiki/MultiMap' "; 112 html += "target='_blank'>"; 113 html += "click here"; 114 html += "</a>"; 115 116 return html; 100 return OpenLayers.i18n( 101 "getLayerWarning", {'layerType':"MM", 'layerLib':"MultiMap"} 102 ); 117 103 }, 118 104 trunk/openlayers/lib/OpenLayers/Layer/Vector.js
r6247 r6313 215 215 displayError: function() { 216 216 if (this.reportError) { 217 var message = "Your browser does not support vector rendering. " + 218 "Currently supported renderers are:\n"; 219 message += this.renderers.join("\n"); 220 alert(message); 217 alert(OpenLayers.i18n("browserNotSupported", 218 {'renderers':this.renderers.join("\n")})); 221 219 } 222 220 }, … … 310 308 311 309 if (this.geometryType && 312 !(feature.geometry instanceof this.geometryType)) {313 var throwStr = "addFeatures : component should be an " +314 this.geometryType.prototype.CLASS_NAME;315 throw throwStr;316 }310 !(feature.geometry instanceof this.geometryType)) { 311 var throwStr = OpenLayers.i18n('componentShouldBe', 312 {'geomType':this.geometryType.prototype.CLASS_NAME}); 313 throw throwStr; 314 } 317 315 318 316 this.features.push(feature); … … 451 449 getFeatureFromEvent: function(evt) { 452 450 if (!this.renderer) { 453 OpenLayers.Console.error( "getFeatureFromEvent called on layer with no renderer. This usually means you destroyed a layer, but not some handler which is associated with it.");451 OpenLayers.Console.error(OpenLayers.i18n("getFeatureError")); 454 452 return null; 455 453 } trunk/openlayers/lib/OpenLayers/Layer/VirtualEarth.js
r5614 r6313 138 138 */ 139 139 getWarningHTML:function() { 140 141 var html = ""; 142 html += "The VE Layer was unable to load correctly.<br>"; 143 html += "<br>"; 144 html += "To get rid of this message, select a new BaseLayer "; 145 html += "in the layer switcher in the upper-right corner.<br>"; 146 html += "<br>"; 147 html += "Most likely, this is because the VE library"; 148 html += " script was either not correctly included.<br>"; 149 html += "<br>"; 150 html += "Developers: For help getting this working correctly, "; 151 html += "<a href='http://trac.openlayers.org/wiki/VirtualEarth' "; 152 html += "target='_blank'>"; 153 html += "click here"; 154 html += "</a>"; 155 156 return html; 140 return OpenLayers.i18n( 141 "getLayerWarning", {'layerType':'VE', 'layerLib':'VirtualEarth'} 142 ); 157 143 }, 158 144 trunk/openlayers/lib/OpenLayers/Layer/WFS.js
r6171 r6313 235 235 // don't load data if current zoom level doesn't match 236 236 if (this.options.minZoomLevel) { 237 238 var err = "The minZoomLevel property is only intended for use " + 239 "with the FixedZoomLevels-descendent layers. That this " + 240 "wfs layer checks for minZoomLevel is a relic of the" + 241 "past. We cannot, however, remove it without possibly " + 242 "breaking OL based applications that may depend on it." + 243 " Therefore we are deprecating it -- the minZoomLevel " + 244 "check below will be removed at 3.0. Please instead " + 245 "use min/max resolution setting as described here: " + 246 "http://trac.openlayers.org/wiki/SettingZoomLevels"; 247 OpenLayers.Console.warn(err); 237 OpenLayers.Console.warn(OpenLayers.i18n('minZoomLevelError')); 248 238 249 239 if (this.map.getZoom() < this.options.minZoomLevel) { … … 482 472 var response = request.responseText; 483 473 if (response.indexOf('SUCCESS') != -1) { 484 this.commitReport( 'WFS Transaction: SUCCESS', response);474 this.commitReport(OpenLayers.i18n("commitSuccess", {'response':response})); 485 475 486 476 for(var i = 0; i < this.features.length; i++) { … … 491 481 } else if (response.indexOf('FAILED') != -1 || 492 482 response.indexOf('Exception') != -1) { 493 this.commitReport( 'WFS Transaction: FAILED', response);483 this.commitReport(OpenLayers.i18n("commitFailed", {'response':response})); 494 484 } 495 485 }, trunk/openlayers/lib/OpenLayers/Layer/Yahoo.js
r5614 r6313 156 156 */ 157 157 getWarningHTML:function() { 158 159 var html = ""; 160 html += "The Yahoo Layer was unable to load correctly.<br>"; 161 html += "<br>"; 162 html += "To get rid of this message, select a new BaseLayer "; 163 html += "in the layer switcher in the upper-right corner.<br>"; 164 html += "<br>"; 165 html += "Most likely, this is because the Yahoo library"; 166 html += " script was either not correctly included.<br>"; 167 html += "<br>"; 168 html += "Developers: For help getting this working correctly, "; 169 html += "<a href='http://trac.openlayers.org/wiki/Yahoo' "; 170 html += "target='_blank'>"; 171 html += "click here"; 172 html += "</a>"; 173 174 return html; 158 return OpenLayers.i18n( 159 "getLayerWarning", {'layerType':'Yahoo', 'layerLib':'Yahoo'} 160 ); 175 161 }, 176 162 trunk/openlayers/lib/OpenLayers/Map.js
r6204 r6313 727 727 for(var i=0; i < this.layers.length; i++) { 728 728 if (this.layers[i] == layer) { 729 var msg = "You tried to add the layer: " + layer.name +730 " to the map, but it has already been added";729 var msg = OpenLayers.i18n('layerAlreadyAdded', 730 {'layerName':layer.name}); 731 731 OpenLayers.Console.warn(msg); 732 732 return false; trunk/openlayers/lib/OpenLayers/Tile.js
r5854 r6313 214 214 */ 215 215 getBoundsFromBaseLayer: function(position) { 216 OpenLayers.Console.warn("You are using the 'reproject' option " + 217 "on the " + this.layer.name + " layer. This option is deprecated: " + 218 "its use was designed to support displaying data over commercial " + 219 "basemaps, but that functionality should now be achieved by using " + 220 "Spherical Mercator support. More information is available from " + 221 "http://trac.openlayers.org/wiki/SphericalMercator."); 216 var msg = OpenLayers.i18n('reprojectDeprecated', 217 {'layerName':this.layer.name}); 218 OpenLayers.Console.warn(msg); 222 219 var topLeft = this.layer.map.getLonLatFromLayerPx(position); 223 220 var bottomRightPx = position.clone(); trunk/openlayers/lib/OpenLayers/Util.js
r5941 r6313 101 101 */ 102 102 OpenLayers.Util.clearArray = function(array) { 103 var msg = "OpenLayers.Util.clearArray() is Deprecated." + 104 " Please use 'array.length = 0' instead."; 105 OpenLayers.Console.warn(msg); 103 OpenLayers.Console.warn( 104 OpenLayers.i18n( 105 "methodDeprecated", {'newMethod': 'array = []'} 106 ) 107 ); 106 108 array.length = 0; 107 109 }; … … 867 869 */ 868 870 OpenLayers.Util.getArgs = function(url) { 869 var err = "The getArgs() function is deprecated and will be removed " + 870 "with the 3.0 version of OpenLayers. Please instead use " + 871 "OpenLayers.Util.getParameters()."; 872 OpenLayers.Console.warn(err); 871 OpenLayers.Console.warn( 872 OpenLayers.i18n( 873 "methodDeprecated", {'newMethod': 'OpenLayers.Util.getParameters'} 874 ) 875 ); 873 876 return OpenLayers.Util.getParameters(url); 874 877 }; … … 1043 1046 element = element.offsetParent; 1044 1047 } catch(e) { 1045 OpenLayers.Console.error( 1046 "OpenLayers.Util.pagePosition failed: element with id " + 1047 element.id + " may be misplaced." 1048 ); 1048 OpenLayers.Console.error(OpenLayers.i18n( 1049 "pagePositionFailed",{'elemId':element.id})); 1049 1050 break; 1050 1051 } trunk/openlayers/tests/list-tests.html
r6240 r6313 50 50 <li>test_Events.html</li> 51 51 <li>test_Util.html</li> 52 <li>test_Lang.html</li> 52 53 <li>test_Layer.html</li> 53 54 <li>test_Renderer.html</li>
