[Mapbender-commits] r6057 - trunk/mapbender/http/javascripts

svn_mapbender at osgeo.org svn_mapbender at osgeo.org
Mon May 3 06:20:59 EDT 2010


Author: christoph
Date: 2010-05-03 06:20:58 -0400 (Mon, 03 May 2010)
New Revision: 6057

Added:
   trunk/mapbender/http/javascripts/jq_validate.js
Log:
validation wrapper, with i18n

Added: trunk/mapbender/http/javascripts/jq_validate.js
===================================================================
--- trunk/mapbender/http/javascripts/jq_validate.js	                        (rev 0)
+++ trunk/mapbender/http/javascripts/jq_validate.js	2010-05-03 10:20:58 UTC (rev 6057)
@@ -0,0 +1,21 @@
+(function () {
+	var originalMessages = $.extend({}, jQuery.validator.messages);
+
+	Mapbender.events.localize.register(function () {
+
+		// use english as fallback
+		jQuery.extend(jQuery.validator.messages, originalMessages);
+
+		// overwrite existing message with localized
+		$.ajaxSetup.async = false;
+		var url = "../extensions/jquery-validate/localization/" + 
+			"messages_" + Mapbender.locale.substr(0, 2) + ".js";
+		$.get(url , function (js) {
+			if (js) {
+				eval(js);
+			}
+		});		
+		$.ajaxSetup.async = true;
+		
+	});
+})();



More information about the Mapbender_commits mailing list