Ticket #109: i18n.patch
| File i18n.patch, 55.2 kB (added by madair, 1 year ago) |
|---|
-
examples/i18n.html
old new 1 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" 2 "http://www.w3.org/TR/2000/REC-xhtml1-20000126/DTD/xhtml1-strict.dtd"> 3 <html xmlns="http://www.w3.org/1999/xhtml"> 4 <head> 5 <meta http-equiv=Content-Type content="text/html; charset=UTF-8"> 6 <title>OpenLayers I18N Example</title> 7 <style type="text/css"> 8 body { 9 margin: 0 2em; 10 font-family: sans-serif; 11 } 12 </style> 13 14 <script src="../lib/OpenLayers.js" type="text/javascript"></script> 15 <script src="../lib/OpenLayers/Lang/en-CA.js" type="text/javascript"></script> 16 <script src="../lib/OpenLayers/Lang/fr.js" type="text/javascript"></script> 17 18 <script type="text/javascript"> 19 20 var myStrings = { 21 'en': { 22 myTest: 'spell color for me', 23 myTemplate: 'language code currently set to ${lang}' 24 }, 25 'en-CA': { 26 myTest: 'spell colour for me, eh', 27 myTemplate: 'language code currently set to ${lang}, eh' 28 }, 29 'fr': { 30 myTest: "c'est couleur en français", 31 myTemplate: 'code de langage est fixé à ${lang}' 32 } 33 } 34 35 function init() { 36 //this shows adding in application defined string files 37 for (var langCode in myStrings) { 38 if (OpenLayers.Lang[langCode]) { 39 OpenLayers.Util.extend(OpenLayers.Lang[langCode], myStrings[langCode]); 40 } 41 } 42 43 displayStrings(OpenLayers.String.langCode); 44 } 45 46 function displayStrings(langCode) { 47 OpenLayers.String.langCode = langCode; 48 49 clearTable(); 50 var header = addRow('lang code', OpenLayers.String.langCode); 51 header.style.fontStyle = 'italic'; 52 53 var key = 'test1'; 54 var i18nString = OpenLayers.String.translate(key); 55 addRow(key, i18nString); 56 57 key = 'test2'; 58 i18nString = OpenLayers.String.translate(key); 59 addRow(key, i18nString); 60 61 key = 'test3'; 62 i18nString = OpenLayers.String.translate(key,{'testArg1':'canada','testArg2':456}); 63 addRow(key, i18nString); 64 65 key = 'noKey'; 66 i18nString = OpenLayers.String.translate(key); 67 addRow(key, i18nString); 68 69 key = 'myTest'; 70 i18nString = OpenLayers.String.translate(key); 71 addRow(key, i18nString); 72 73 key = 'myTemplate'; 74 i18nString = OpenLayers.String.translate(key, {'lang':OpenLayers.String.langCode}); 75 addRow(key, i18nString); 76 } 77 78 function addRow(key, text) { 79 var outputTable = document.getElementById('egOutput'); 80 row = document.createElement('tr'); 81 td = document.createElement('td'); 82 td.innerHTML = key; 83 row.appendChild(td); 84 td = document.createElement('td'); 85 td.innerHTML = text; 86 row.appendChild(td); 87 outputTable.tBodies[0].appendChild(row); 88 return row; 89 } 90 91 function clearTable() { 92 var outputTable = document.getElementById('egOutput'); 93 outputTable.tBodies[0].innerHTML = ''; 94 } 95 96 window.onload = init; 97 </script> 98 </head> 99 <body> 100 <h3>OpenLayers I18N Example</h3> 101 <p>This example shows how OpenLayers handles internationalization of strings</p> 102 <p>Show strings in: 103 <a href='javascript:displayStrings("en")'>english</a> 104 <a href='javascript:displayStrings("en-CA")'>english - Canadian</a> 105 <a href='javascript:displayStrings("fr")'>french</a> 106 <a href='javascript:displayStrings("sw")'>swahili (undefined, should default to en)</a> 107 </p> 108 <table id='egOutput'> 109 <tr><th>key</th><th>result</th></tr> 110 </table> 111 </body> 112 </html> -
lib/OpenLayers.js
old new 201 201 "OpenLayers/Layer/WFS.js", 202 202 "OpenLayers/Control/MouseToolbar.js", 203 203 "OpenLayers/Control/NavToolbar.js", 204 "OpenLayers/Control/EditingToolbar.js" 204 "OpenLayers/Control/EditingToolbar.js", 205 "OpenLayers/Lang/en.js" 205 206 ); // etc. 206 207 207 208 var agent = navigator.userAgent; -
lib/OpenLayers/Ajax.js
old new 34 34 * @param {} request 35 35 */ 36 36 OpenLayers.nullHandler = function(request) { 37 alert( "Unhandled request return " + request.statusText);37 alert(OpenLayers.String.translate("unhandledRequest", {'statusText':request.statusText})); 38 38 }; 39 39 40 40 /** -
lib/OpenLayers/BaseTypes.js
old new 9 9 * @requires OpenLayers/BaseTypes/Pixel.js 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. 17 18 */ … … 23 24 *********************/ 24 25 25 26 OpenLayers.String = { 27 /** 28 * APIProperty: langCode 29 * {String} Current language code to use in OpenLayers. These codes follow 30 * the IETF recommendations at http://www.ietf.org/rfc/rfc3066.txt 31 * This value is initialized from the browser's language setting, but may be 32 * changed by the application. 33 **/ 34 langCode: (OpenLayers.Util.getBrowserName() == "msie") ? 35 navigator.userLanguage:navigator.language, 36 37 /** 38 * APIProperty: defaultLangCode 39 * {String} default language to use when a specific language can't be found 40 **/ 41 defaultLangCode: 'en', 42 26 43 /** 27 44 * APIFunction: OpenLayers.String.startsWith 28 45 * Test whether a string starts with another string. … … 90 107 } 91 108 return camelizedString; 92 109 }, 93 110 94 111 /** 112 * APIMethod: OpenLayers.String.translate 113 * uses the key into a dictionary of values based on the current language string. 114 * 115 * Any number of additional arguments may be passed, in which case they 116 * will be interpolated in the string template in order. String templates in the 117 * dictionary can use {0}, {1}, etc. as placeholders to be substituted by the 118 * additional arguments. 119 * 120 * Parameters: 121 * key - {String} The key for an i18n string value in the dictionary 122 * 123 * Returns: 124 * {String} A internationalized string 125 */ 126 translate: function(key, context) { 127 var langCode = null; 128 var langParts = OpenLayers.String.langCode.split('-'); 129 langParts[0] = langParts[0].toLowerCase(); 130 //first check the language base code 131 if (OpenLayers.Lang[langParts[0]]) { 132 langCode = langParts[0]; 133 } 134 //now check for regional extensions 135 if (langParts[1] && langParts[1].length>0) { 136 testLang = langParts[0] + '-' + langParts[1].toUpperCase(); 137 if (OpenLayers.Lang[testLang]) { 138 langCode = testLang; 139 } 140 } 141 if (!langCode) { 142 var msg = 'failed to find ' +OpenLayers.String.langCode+ ' dictionary, falling back to default language'; 143 OpenLayers.Console.log(msg); 144 langCode = OpenLayers.String.defaultLangCode; 145 } 146 147 var dictionary = OpenLayers.Lang[langCode]; 148 var message = "NoMsgsFound"; 149 var msgValue = dictionary[key]; 150 if (!msgValue) { 151 // Message not found, fall back to message key 152 message = key; 153 } else { 154 // Message found; pick last one so user can override messages 155 message = msgValue; 156 if (context) { 157 message = this.format(message, context); 158 } 159 } 160 return message; 161 }, 162 163 /** 95 164 * APIFunction: OpenLayers.String.format 96 165 * Given a string with tokens in the form ${token}, return a string 97 166 * with tokens replaced with properties from the given context … … 129 198 130 199 }; 131 200 201 /** 202 * Header: OpenLayers.Lang 203 * OpenLayers I18n string dictionary in various languages. 204 * Each language dictionary consists of a hash table with key/value pairs. 205 * See the directory lib/OpenLayers/Lang for examples. 206 * 207 * Default language is English, langcode='en'. 208 */ 209 OpenLayers.Lang = {}; 210 132 211 if (!String.prototype.startsWith) { 133 212 /** 134 213 * APIMethod: String.startsWith … … 141 220 * {Boolean} Whether or not this string starts with the string passed in. 142 221 */ 143 222 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 ); 223 OpenLayers.Console.warn(OpenLayers.String.translate("methodDeprecated", 224 {'newMethod':'OpenLayers.String.startsWith'})); 148 225 return OpenLayers.String.startsWith(this, sStart); 149 226 }; 150 227 } … … 161 238 * {Boolean} Whether or not this string contains with the string passed in. 162 239 */ 163 240 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 ); 241 OpenLayers.Console.warn(OpenLayers.String.translate("methodDeprecated", 242 {'newMethod':'OpenLayers.String.contains'})); 168 243 return OpenLayers.String.contains(this, str); 169 244 }; 170 245 } … … 179 254 * trailing spaces removed 180 255 */ 181 256 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 ); 257 OpenLayers.Console.warn(OpenLayers.String.translate("methodDeprecated", 258 {'newMethod':'OpenLayers.String.trim'})); 186 259 return OpenLayers.String.trim(this); 187 260 }; 188 261 } … … 198 271 * {String} The string, camelized 199 272 */ 200 273 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 ); 274 OpenLayers.Console.warn(OpenLayers.String.translate("methodDeprecated", 275 {'newMethod':'OpenLayers.String.camelize'})); 205 276 return OpenLayers.String.camelize(this); 206 277 }; 207 278 } … … 315 386 * If null, 0, or negative value passed in, returns 0 316 387 */ 317 388 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 ); 389 OpenLayers.Console.warn(OpenLayers.String.translate("methodDeprecated", 390 {'newMethod':'OpenLayers.String.limitSigDigs'})); 322 391 return OpenLayers.Number.limitSigDigs(this, sig); 323 392 }; 324 393 } … … 388 457 * argument. 389 458 */ 390 459 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 ); 460 OpenLayers.Console.warn(OpenLayers.String.translate("methodDeprecated", 461 {'newMethod':'OpenLayers.String.bind'})); 395 462 // new function takes the same arguments with this function up front 396 463 Array.prototype.unshift.apply(arguments, [this]); 397 464 return OpenLayers.Function.bind.apply(null, arguments); … … 411 478 * {Function} 412 479 */ 413 480 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 ); 481 OpenLayers.Console.warn(OpenLayers.String.translate("methodDeprecated", 482 {'newMethod':'OpenLayers.String.bindAsEventListener'})); 418 483 return OpenLayers.Function.bindAsEventListener(this, object); 419 484 }; 420 485 } -
lib/OpenLayers/BaseTypes/Bounds.js
old new 232 232 */ 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.String.translate("boundsAddError"); 236 236 OpenLayers.Console.error(msg); 237 237 return null; 238 238 } -
lib/OpenLayers/BaseTypes/LonLat.js
old new 84 84 */ 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.String.translate("lonlatAddError"); 89 88 OpenLayers.Console.error(msg); 90 89 return null; 91 90 } -
lib/OpenLayers/BaseTypes/Pixel.js
old new 91 91 */ 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.String.translate("pixelAddError"); 95 95 OpenLayers.Console.error(msg); 96 96 return null; 97 97 } -
lib/OpenLayers/Control/LayerSwitcher.js
old new 504 504 505 505 506 506 this.baseLbl = document.createElement("div"); 507 this.baseLbl.innerHTML = "<u>Base Layer</u>";507 this.baseLbl.innerHTML = OpenLayers.String.translate("baseLayer"); 508 508 this.baseLbl.style.marginTop = "3px"; 509 509 this.baseLbl.style.marginLeft = "3px"; 510 510 this.baseLbl.style.marginBottom = "3px"; … … 517 517 518 518 519 519 this.dataLbl = document.createElement("div"); 520 this.dataLbl.innerHTML = "<u>Overlays</u>";520 this.dataLbl.innerHTML = OpenLayers.String.translate("overlays"); 521 521 this.dataLbl.style.marginTop = "3px"; 522 522 this.dataLbl.style.marginLeft = "3px"; 523 523 this.dataLbl.style.marginBottom = "3px"; -
lib/OpenLayers/Control/OverviewMap.js
old new 498 498 // as the base layer for the main map. This should be made more robust. 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.String.translate("sameProjection")); 502 502 } 503 503 } 504 504 var pxBounds = this.getRectBoundsFromMapBounds(this.map.getExtent()); -
lib/OpenLayers/Control/Permalink.js
old new 111 111 if (!this.element) { 112 112 this.div.className = this.displayClass; 113 113 this.element = document.createElement("a"); 114 this.element.innerHTML = "Permalink";114 this.element.innerHTML = OpenLayers.String.translate("permalink"); 115 115 this.element.href=""; 116 116 this.div.appendChild(this.element); 117 117 } -
lib/OpenLayers/Control/Scale.js
old new 68 68 scale = Math.round(scale); 69 69 } 70 70 71 this.element.innerHTML = "Scale = 1 : " + scale;71 this.element.innerHTML = OpenLayers.String.translate("scale", {'scaleDenom':scale}); 72 72 }, 73 73 74 74 CLASS_NAME: "OpenLayers.Control.Scale" -
lib/OpenLayers/Format.js
old new 68 68 * Depends on the subclass 69 69 */ 70 70 read: function(data) { 71 alert( "Read not implemented.");71 alert(OpenLayers.String.translate("readNotImplemented")); 72 72 }, 73 73 74 74 /** … … 82 82 * {String} A string representation of the object. 83 83 */ 84 84 write: function(object) { 85 alert( "Write not implemented.");85 alert(OpenLayers.String.translate("writeNotImplemented")); 86 86 }, 87 87 88 88 CLASS_NAME: "OpenLayers.Format" -
lib/OpenLayers/Format/GML.js
old new 154 154 this.internalProjection); 155 155 } 156 156 } else { 157 OpenLayers.Console.error( "Unsupported geometry type: " +158 type);157 OpenLayers.Console.error(OpenLayers.String.translate( 158 "unsupportedGeometryType", {'geomType':type})); 159 159 } 160 160 // stop looking for different geometry types 161 161 break; -
lib/OpenLayers/Format/KML.js
old new 580 580 this.internalProjection); 581 581 } 582 582 } else { 583 OpenLayers.Console.error( "Unsupported geometry type: " +584 type);583 OpenLayers.Console.error(OpenLayers.String.translate( 584 "unsupportedGeometryType", {'geomType':type})); 585 585 } 586 586 // stop looking for different geometry types 587 587 break; -
lib/OpenLayers/Format/WFS.js
old new 129 129 * feature - {<OpenLayers.Feature.Vector>} 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.String.translate("noFID")); } 133 133 var updateNode = this.createElementNS(this.wfsns, 'wfs:Update'); 134 134 updateNode.setAttribute("typeName", this.layerName); 135 135 … … 186 186 */ 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.String.translate("noFID")); 190 190 return false; 191 191 } 192 192 var deleteNode = this.createElementNS(this.featureNS, 'wfs:Delete'); -
lib/OpenLayers/Lang/fr.js
old new 1 OpenLayers.Lang.fr = { 2 'test1': 'ceci est un test', 3 'test2': 'et une autre avec des accents: Ú.ééééé^çà ', 4 'test3': 'arg un: ${testArg1} arg deux: ${testArg2} ', 5 'overlays': "<u>Couches de superposition</u>", 6 'end': '' 7 }; -
lib/OpenLayers/Lang/en.js
old new 1 OpenLayers.Lang.en = { 2 'test1': 'this is a test', 3 'test2': 'and another test', 4 'test3': 'arg one: ${testArg1} arg two: ${testArg2}', 5 'unhandledRequest': "Unhandled request return ${statusText}", 6 'permalink': "Permalink", 7 'overlays': "Overlays", 8 'baseLayer': "Base Layer", 9 'sameProjection': "The overview map only works when it is in the same projection as the main map", 10 'readNotImplemented': "Read not implemented.", 11 'writeNotImplemented': "Write not implemented.", 12 'noFID': "Can't update a feature for which there is no FID.", 13 'errorLoadingGML': "Error in loading GML file ${url}", 14 'browserNotSupported': "Your browser does not support vector rendering. Currently supported renderers are:\n${renderers}", 15 'componentShouldBe': "addFeatures : component should be an ${geomType}", 16 'getFeatureError': "getFeatureFromEvent called on layer with no renderer. " + 17 "This usually means you destroyed a layer, but not some handler which is associated with it.", 18 'minZoomLevelError': "The minZoomLevel property is only intended for use " + 19 "with the FixedZoomLevels-descendent layers. That this " + 20 "wfs layer checks for minZoomLevel is a relic of the" + 21 "past. We cannot, however, remove it without possibly " + 22 "breaking OL based applications that may depend on it." + 23 " Therefore we are deprecating it -- the minZoomLevel " + 24 "check below will be removed at 3.0. Please instead " + 25 "use min/max resolution setting as described here: " + 26 "http://trac.openlayers.org/wiki/SettingZoomLevels", 27 'commitSuccess': "WFS Transaction: SUCCESS ${response}", 28 'commitFailed': "WFS Transaction: FAILED ${response}", 29 'googleWarning': "The Google Layer was unable to load correctly.<br><br>" + 30 "To get rid of this message, select a new BaseLayer " + 31 "in the layer switcher in the upper-right corner.<br><br>" + 32 "Most likely, this is because the Google Maps library " + 33 "script was either not included, or does not contain the " + 34 "correct API key for your site.<br><br>" + 35 "Developers: For help getting this working correctly, " + 36 "<a href='http://trac.openlayers.org/wiki/Google' " + 37 "target='_blank'>click here</a>", 38 'getLayerWarning': "The ${layerType} Layer was unable to load correctly.<br><br>" + 39 "To get rid of this message, select a new BaseLayer " + 40 "in the layer switcher in the upper-right corner.<br><br>" + 41 "Most likely, this is because the ${layerLib} library " + 42 "script was either not correctly included.<br><br>" + 43 "Developers: For help getting this working correctly, " + 44 "<a href='http://trac.openlayers.org/wiki/${layerLib}' " + 45 "target='_blank'>click here</a>", 46 'scale': "Scale = 1 : ${scaleDenom}", 47 'layerAlreadyAdded': "You tried to add the layer: ${layerName} to the map, but it has already been added", 48 'reprojectDeprecated': "You are using the 'reproject' option " + 49 "on the ${layerName} layer. This option is deprecated: " + 50 "its use was designed to support displaying data over commercial " + 51 "basemaps, but that functionality should now be achieved by using " + 52 "Spherical Mercator support. More information is available from " + 53 "http://trac.openlayers.org/wiki/SphericalMercator.", 54 'methodDeprecated': "This method has been deprecated and will be removed in 3.0. " + 55 "Please use ${newMethod} instead.", 56 'boundsAddError': "You must pass both x and y values to the add function.", 57 'lonlatAddError': "You must pass both lon and lat values to the add function.", 58 'pixelAddError': "You must pass both x and y values to the add function.", 59 'unsupportedGeometryType': "Unsupported geometry type: ${geomType}", 60 'clearArrayDeprecated': "OpenLayers.Util.clearArray() is Deprecated." + 61 " Please use 'array.length = 0' instead.", 62 'getArgsDeprecated': "The getArgs() function is deprecated and will be removed " + 63 "with the 3.0 version of OpenLayers. Please instead use " + 64 "OpenLayers.Util.getParameters().", 65 'pagePositionFailed': "OpenLayers.Util.pagePosition failed: element with id ${elemId} may be misplaced.", 66 67 'end': '' 68 }; -
lib/OpenLayers/Lang/en-CA.js
old new 1 OpenLayers.Lang['en-CA'] = { 2 'test1': 'this is a test, eh', 3 'test2': 'and another test, eh', 4 'test3': 'arg one: ${testArg1} arg two: ${testArg2}, eh', 5 'unhandledRequest': "Unhandled request return ${statusText}", 6 'permalink': "Permalink", 7 'overlays': "Overlays", 8 'baseLayer': "Base Layer", 9 'sameProjection': "The overview map only works when it is in the same projection as the main map", 10 'readNotImplemented': "Read not implemented.", 11 'writeNotImplemented': "Write not implemented.", 12 'noFID': "Can't update a feature for which there is no FID.", 13 'errorLoadingGML': "Error in loading GML file ${url}", 14 'browserNotSupported': "Your browser does not support vector rendering. Currently supported renderers are:\n${renderers}", 15 'componentShouldBe': "addFeatures : component should be an ${geomType}", 16 'getFeatureError': "getFeatureFromEvent called on layer with no renderer. " + 17 "This usually means you destroyed a layer, but not some handler which is associated with it.", 18 'minZoomLevelError': "The minZoomLevel property is only intended for use " + 19 "with the FixedZoomLevels-descendent layers. That this " + 20 "wfs layer checks for minZoomLevel is a relic of the" + 21 "past. We cannot, however, remove it without possibly " + 22 "breaking OL based applications that may depend on it." + 23 " Therefore we are deprecating it -- the minZoomLevel " + 24 "check below will be removed at 3.0. Please instead " + 25 "use min/max resolution setting as described here: " + 26 "http://trac.openlayers.org/wiki/SettingZoomLevels", 27 'commitSuccess': "WFS Transaction: SUCCESS ${response}", 28 'commitFailed': "WFS Transaction: FAILED ${response}", 29 'googleWarning': "The Google Layer was unable to load correctly.<br><br>" + 30 "To get rid of this message, select a new BaseLayer " + 31 "in the layer switcher in the upper-right corner.<br><br>" + 32 "Most likely, this is because the Google Maps library " + 33 "script was either not included, or does not contain the " + 34 "correct API key for your site.<br><br>" + 35 "Developers: For help getting this working correctly, " + 36 "<a href='http://trac.openlayers.org/wiki/Google' " + 37 "target='_blank'>click here</a>", 38 'getLayerWarning': "The ${layerType} Layer was unable to load correctly.<br><br>" + 39 "To get rid of this message, select a new BaseLayer " + 40 "in the layer switcher in the upper-right corner.<br><br>" + 41 "Most likely, this is because the ${layerLib} library " + 42 "script was either not correctly included.<br><br>" + 43 "Developers: For help getting this working correctly, " + 44 "<a href='http://trac.openlayers.org/wiki/${layerLib}' " + 45 "target='_blank'>click here</a>", 46 'scale': "Scale = 1 : ${scaleDenom}", 47 'layerAlreadyAdded': "You tried to add the layer: ${layerName} to the map, but it has already been added", 48 'reprojectDeprecated': "You are using the 'reproject' option " + 49 "on the ${layerName} layer. This option is deprecated: " + 50 "its use was designed to support displaying data over commercial " + 51 "basemaps, but that functionality should now be achieved by using " + 52 "Spherical Mercator support. More information is available from " + 53 "http://trac.openlayers.org/wiki/SphericalMercator.", 54 'methodDeprecated': "This method has been deprecated and will be removed in 3.0. " + 55 "Please use ${newMethod} instead.", 56 'boundsAddError': "You must pass both x and y values to the add function.", 57 'lonlatAddError': "You must pass both lon and lat values to the add function.", 58 'pixelAddError': "You must pass both x and y values to the add function.", 59 'unsupportedGeometryType': "Unsupported geometry type: ${geomType}", 60 'clearArrayDeprecated': "OpenLayers.Util.clearArray() is Deprecated." + 61 " Please use 'array.length = 0' instead.", 62 'getArgsDeprecated': "The getArgs() function is deprecated and will be removed " + 63 "with the 3.0 version of OpenLayers. Please instead use " + 64 "OpenLayers.Util.getParameters().", 65 'pagePositionFailed': "OpenLayers.Util.pagePosition failed: element with id ${elemId} may be misplaced.", 66 67 'end': '' 68 }; -
lib/OpenLayers/Lang/en-CA.js
old new 1 OpenLayers.Lang['en-CA'] = { 2 'test1': 'this is a test, eh', 3 'test2': 'and another test, eh', 4 'test3': 'arg one: ${testArg1} arg two: ${testArg2}, eh', 5 'unhandledRequest': "Unhandled request return ${statusText}", 6 'permalink': "Permalink", 7 'overlays': "Overlays", 8 'baseLayer': "Base Layer", 9 'sameProjection': "The overview map only works when it is in the same projection as the main map", 10 'readNotImplemented': "Read not implemented.", 11 'writeNotImplemented': "Write not implemented.", 12 'noFID': "Can't update a feature for which there is no FID.", 13 'errorLoadingGML': "Error in loading GML file ${url}", 14 'browserNotSupported': "Your browser does not support vector rendering. Currently supported renderers are:\n${renderers}", 15 'componentShouldBe': "addFeatures : component should be an ${geomType}", 16 'getFeatureError': "getFeatureFromEvent called on layer with no renderer. " + 17 "This usually means you destroyed a layer, but not some handler which is associated with it.", 18 'minZoomLevelError': "The minZoomLevel property is only intended for use " + 19 "with the FixedZoomLevels-descendent layers. That this " + 20 "wfs layer checks for minZoomLevel is a relic of the" + 21 "past. We cannot, however, remove it without possibly " + 22 "breaking OL based applications that may depend on it." + 23 " Therefore we are deprecating it -- the minZoomLevel " + 24 "check below will be removed at 3.0. Please instead " + 25 "use min/max resolution setting as described here: " + 26 "http://trac.openlayers.org/wiki/SettingZoomLevels", 27 'commitSuccess': "WFS Transaction: SUCCESS ${response}", 28 'commitFailed': "WFS Transaction: FAILED ${response}", 29 'googleWarning': "The Google Layer was unable to load correctly.<br><br>" + 30 "To get rid of this message, select a new BaseLayer " + 31 "in the layer switcher in the upper-right corner.<br><br>" + 32 "Most likely, this is because the Google Maps library " + 33 "script was either not included, or does not contain the " + 34 "correct API key for your site.<br><br>" + 35 "Developers: For help getting this working correctly, " + 36 "<a href='http://trac.openlayers.org/wiki/Google' " + 37 "target='_blank'>click here</a>", 38 'getLayerWarning': "The ${layerType} Layer was unable to load correctly.<br><br>" + 39 "To get rid of this message, select a new BaseLayer " + 40 "in the layer switcher in the upper-right corner.<br><br>" + 41 "Most likely, this is because the ${layerLib} library " + 42 "script was either not correctly included.<br><br>" + 43 "Developers: For help getting this working correctly, " + 44 "<a href='http://trac.openlayers.org/wiki/${layerLib}' " + 45 "target='_blank'>click here</a>", 46 'scale': "Scale = 1 : ${scaleDenom}", 47 'layerAlreadyAdded': "You tried to add the layer: ${layerName} to the map, but it has already been added", 48 'reprojectDeprecated': "You are using the 'reproject' option " + 49 "on the ${layerName} layer. This option is deprecated: " + 50 "its use was designed to support displaying data over commercial " + 51 "basemaps, but that functionality should now be achieved by using " + 52 "Spherical Mercator support. More information is available from " + 53 "http://trac.openlayers.org/wiki/SphericalMercator.", 54 'methodDeprecated': "This method has been deprecated and will be removed in 3.0. " + 55 "Please use ${newMethod} instead.", 56 'boundsAddError': "You must pass both x and y values to the add function.", 57 'lonlatAddError': "You must pass both lon and lat values to the add function.", 58 'pixelAddError': "You must pass both x and y values to the add function.", 59 'unsupportedGeometryType': "Unsupported geometry type: ${geomType}", 60 'clearArrayDeprecated': "OpenLayers.Util.clearArray() is Deprecated." + 61 " Please use 'array.length = 0' instead.", 62 'getArgsDeprecated': "The getArgs() function is deprecated and will be removed " + 63 "with the 3.0 version of OpenLayers. Please instead use " + 64 "OpenLayers.Util.getParameters().", 65 'pagePositionFailed': "OpenLayers.Util.pagePosition failed: element with id ${elemId} may be misplaced.", 66 67 'end': '' 68 }; -
lib/OpenLayers/Lang/en.js
old new 1 OpenLayers.Lang.en = { 2 'test1': 'this is a test', 3 'test2': 'and another test', 4 'test3': 'arg one: ${testArg1} arg two: ${testArg2}', 5 'unhandledRequest': "Unhandled request return ${statusText}", 6 'permalink': "Permalink", 7 'overlays': "Overlays", 8 'baseLayer': "Base Layer", 9 'sameProjection': "The overview map only works when it is in the same projection as the main map", 10 'readNotImplemented': "Read not implemented.", 11 'writeNotImplemented': "Write not implemented.", 12 'noFID': "Can't update a feature for which there is no FID.", 13 'errorLoadingGML': "Error in loading GML file ${url}", 14 'browserNotSupported': "Your browser does not support vector rendering. Currently supported renderers are:\n${renderers}", 15 'componentShouldBe': "addFeatures : component should be an ${geomType}", 16 'getFeatureError': "getFeatureFromEvent called on layer with no renderer. " + 17 "This usually means you destroyed a layer, but not some handler which is associated with it.", 18 'minZoomLevelError': "The minZoomLevel property is only intended for use " + 19 "with the FixedZoomLevels-descendent layers. That this " + 20 "wfs layer checks for minZoomLevel is a relic of the" + 21 "past. We cannot, however, remove it without possibly " + 22 "breaking OL based applications that may depend on it." + 23 " Therefore we are deprecating it -- the minZoomLevel " + 24 "check below will be removed at 3.0. Please instead " + 25 "use min/max resolution setting as described here: " + 26 "http://trac.openlayers.org/wiki/SettingZoomLevels", 27 'commitSuccess': "WFS Transaction: SUCCESS ${response}", 28 'commitFailed': "WFS Transaction: FAILED ${response}", 29 'googleWarning': "The Google Layer was unable to load correctly.<br><br>" + 30 "To get rid of this message, select a new BaseLayer " + 31 "in the layer switcher in the upper-right corner.<br><br>" + 32 "Most likely, this is because the Google Maps library " + 33 "script was either not included, or does not contain the " + 34 "correct API key for your site.<br><br>" + 35 "Developers: For help getting this working correctly, " + 36 "<a href='http://trac.openlayers.org/wiki/Google' " + 37 "target='_blank'>click here</a>", 38 'getLayerWarning': "The ${layerType} Layer was unable to load correctly.<br><br>" + 39 "To get rid of this message, select a new BaseLayer " + 40 "in the layer switcher in the upper-right corner.<br><br>" + 41 "Most likely, this is because the ${layerLib} library " + 42 "script was either not correctly included.<br><br>" + 43 "Developers: For help getting this working correctly, " + 44 "<a href='http://trac.openlayers.org/wiki/${layerLib}' " + 45 "target='_blank'>click here</a>", 46 'scale': "Scale = 1 : ${scaleDenom}", 47 'layerAlreadyAdded': "You tried to add the layer: ${layerName} to the map, but it has already been added", 48 'reprojectDeprecated': "You are using the 'reproject' option " + 49 "on the ${layerName} layer. This option is deprecated: " + 50 "its use was designed to support displaying data over commercial " + 51 "basemaps, but that functionality should now be achieved by using " + 52 "Spherical Mercator support. More information is available from " + 53 "http://trac.openlayers.org/wiki/SphericalMercator.", 54 'methodDeprecated': "This method has been deprecated and will be removed in 3.0. " + 55 "Please use ${newMethod} instead.", 56 'boundsAddError': "You must pass both x and y values to the add function.", 57 'lonlatAddError': "You must pass both lon and lat values to the add function.", 58 'pixelAddError': "You must pass both x and y values to the add function.", 59 'unsupportedGeometryType': "Unsupported geometry type: ${geomType}", 60 'clearArrayDeprecated': "OpenLayers.Util.clearArray() is Deprecated." + 61 " Please use 'array.length = 0' instead.", 62 'getArgsDeprecated': "The getArgs() function is deprecated and will be removed " + 63 "with the 3.0 version of OpenLayers. Please instead use " + 64 "OpenLayers.Util.getParameters().", 65 'pagePositionFailed': "OpenLayers.Util.pagePosition failed: element with id ${elemId} may be misplaced.", 66 67 'end': '' 68 }; -
lib/OpenLayers/Lang/fr.js
old new 1 OpenLayers.Lang.fr = { 2 'test1': 'ceci est un test', 3 'test2': 'et une autre avec des accents: Ú.ééééé^çà ', 4 'test3': 'arg un: ${testArg1} arg deux: ${testArg2} ', 5 'overlays': "<u>Couches de superposition</u>", 6 'end': '' 7 }; -
lib/OpenLayers/Layer/GML.js
old new 157 157 * request - {String} 158 158 */ 159 159 requestFailure: function(request) { 160 alert( "Error in loading GML file "+this.url);160 alert(OpenLayers.String.translate("errorLoadingGML", {'url':this.url})); 161 161 this.events.triggerEvent("loadend"); 162 162 }, 163 163 -
lib/OpenLayers/Layer/Google.js
old new 309 309 * it working. 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.String.translate("googleWarning"); 330 313 }, 331 314 332 315 -
lib/OpenLayers/Layer/MultiMap.js
old new 97 97 * it working. 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.String.translate("getLayerWarning", {'layerType':"MM", 'layerLib':"MultiMap"}); 117 101 }, 118 102 119 103 -
lib/OpenLayers/Layer/Vector.js
old new 214 214 */ 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.String.translate("browserNotSupported", 218 {'renderers':this.renderers.join("\n")})); 221 219 } 222 220 }, 223 221 … … 309 307 var feature = features[i]; 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 insta
