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:
+12
-11
@@ -100,9 +100,11 @@ OpenLayers.Util.removeItem = function(array, item) {
|
||||
* array - {Array}
|
||||
*/
|
||||
OpenLayers.Util.clearArray = function(array) {
|
||||
var msg = "OpenLayers.Util.clearArray() is Deprecated." +
|
||||
" Please use 'array.length = 0' instead.";
|
||||
OpenLayers.Console.warn(msg);
|
||||
OpenLayers.Console.warn(
|
||||
OpenLayers.i18n(
|
||||
"methodDeprecated", {'newMethod': 'array = []'}
|
||||
)
|
||||
);
|
||||
array.length = 0;
|
||||
};
|
||||
|
||||
@@ -866,10 +868,11 @@ OpenLayers.Util.getParameters = function(url) {
|
||||
* {Object} An object of key/value pairs from the query string.
|
||||
*/
|
||||
OpenLayers.Util.getArgs = function(url) {
|
||||
var err = "The getArgs() function is deprecated and will be removed " +
|
||||
"with the 3.0 version of OpenLayers. Please instead use " +
|
||||
"OpenLayers.Util.getParameters().";
|
||||
OpenLayers.Console.warn(err);
|
||||
OpenLayers.Console.warn(
|
||||
OpenLayers.i18n(
|
||||
"methodDeprecated", {'newMethod': 'OpenLayers.Util.getParameters'}
|
||||
)
|
||||
);
|
||||
return OpenLayers.Util.getParameters(url);
|
||||
};
|
||||
|
||||
@@ -1042,10 +1045,8 @@ OpenLayers.Util.pagePosition = function(forElement) {
|
||||
// wrapping this in a try/catch because IE chokes on the offsetParent
|
||||
element = element.offsetParent;
|
||||
} catch(e) {
|
||||
OpenLayers.Console.error(
|
||||
"OpenLayers.Util.pagePosition failed: element with id " +
|
||||
element.id + " may be misplaced."
|
||||
);
|
||||
OpenLayers.Console.error(OpenLayers.i18n(
|
||||
"pagePositionFailed",{'elemId':element.id}));
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user