Adding framework for internationalization support. The new OpenLayers.Lang.translate method takes a key and looks for a value in a dictionary based on the current language setting. Set a new language code with OpenLayers.Lang.setCode. Get the current code with OpenLayers.Lang.getCode. Thanks to Mike Adair for the lead on this one. r=ahocevar,me (closes #109)

git-svn-id: http://svn.openlayers.org/trunk/openlayers@6313 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
This commit is contained in:
Tim Schaub
2008-02-15 21:15:48 +00:00
parent bafc8b758b
commit fa55f54e32
30 changed files with 479 additions and 162 deletions

View File

@@ -504,7 +504,7 @@ OpenLayers.Control.LayerSwitcher =
this.baseLbl = document.createElement("div");
this.baseLbl.innerHTML = "<u>Base Layer</u>";
this.baseLbl.innerHTML = OpenLayers.i18n("baseLayer");
this.baseLbl.style.marginTop = "3px";
this.baseLbl.style.marginLeft = "3px";
this.baseLbl.style.marginBottom = "3px";
@@ -517,7 +517,7 @@ OpenLayers.Control.LayerSwitcher =
this.dataLbl = document.createElement("div");
this.dataLbl.innerHTML = "<u>Overlays</u>";
this.dataLbl.innerHTML = OpenLayers.i18n("overlays");
this.dataLbl.style.marginTop = "3px";
this.dataLbl.style.marginLeft = "3px";
this.dataLbl.style.marginBottom = "3px";

View File

@@ -498,7 +498,7 @@ OpenLayers.Control.OverviewMap = OpenLayers.Class(OpenLayers.Control, {
// as the base layer for the main map. This should be made more robust.
if(this.map.units != 'degrees') {
if(this.ovmap.getProjection() && (this.map.getProjection() != this.ovmap.getProjection())) {
alert('The overview map only works when it is in the same projection as the main map');
alert(OpenLayers.i18n("sameProjection"));
}
}
var pxBounds = this.getRectBoundsFromMapBounds(this.map.getExtent());

View File

@@ -111,7 +111,7 @@ OpenLayers.Control.Permalink = OpenLayers.Class(OpenLayers.Control, {
if (!this.element) {
this.div.className = this.displayClass;
this.element = document.createElement("a");
this.element.innerHTML = "Permalink";
this.element.innerHTML = OpenLayers.i18n("permalink");
this.element.href="";
this.div.appendChild(this.element);
}

View File

@@ -68,7 +68,7 @@ OpenLayers.Control.Scale = OpenLayers.Class(OpenLayers.Control, {
scale = Math.round(scale);
}
this.element.innerHTML = "Scale = 1 : " + scale;
this.element.innerHTML = OpenLayers.i18n("scale", {'scaleDenom':scale});
},
CLASS_NAME: "OpenLayers.Control.Scale"