]> scripts.mit.edu Git - autoinstalls/wordpress.git/blobdiff - wp-includes/js/l10n.dev.js
Wordpress 3.1
[autoinstalls/wordpress.git] / wp-includes / js / l10n.dev.js
diff --git a/wp-includes/js/l10n.dev.js b/wp-includes/js/l10n.dev.js
new file mode 100644 (file)
index 0000000..96fca67
--- /dev/null
@@ -0,0 +1,23 @@
+//Used to ensure that Entities used in L10N strings are correct
+function convertEntities(o) {
+       var c, v;
+       c = function(s) {
+               if (/&[^;]+;/.test(s)) {
+                       var e = document.createElement("div");
+                       e.innerHTML = s;
+                       return !e.firstChild ? s : e.firstChild.nodeValue;
+               }
+               return s;
+       }
+
+       if ( typeof o === 'string' ) {
+               return c(o);
+       } else if ( typeof o === 'object' ) {
+               for (v in o) {
+                       if ( typeof o[v] === 'string' ) {
+                               o[v] = c(o[v]);
+                       }
+               }
+       }
+       return o;
+}
\ No newline at end of file