summaryrefslogtreecommitdiff
path: root/MobileCydia.app/localize.js
diff options
context:
space:
mode:
Diffstat (limited to 'MobileCydia.app/localize.js')
-rw-r--r--MobileCydia.app/localize.js15
1 files changed, 15 insertions, 0 deletions
diff --git a/MobileCydia.app/localize.js b/MobileCydia.app/localize.js
new file mode 100644
index 0000000..9be82d0
--- /dev/null
+++ b/MobileCydia.app/localize.js
@@ -0,0 +1,15 @@
+document.addEventListener("DOMContentLoaded", function () {
+ var results = document.evaluate("//*[@localize]", document, null, XPathResult.ANY_TYPE, null);
+ var result, nodes = [];
+ while (result = results.iterateNext())
+ nodes.push(result);
+ for (var index in nodes) {
+ var node = nodes[index];
+ var key = node.getAttribute('localize');
+ var value = cydia.localize(key, node.innerHTML);
+ if (node.nodeName == 'TITLE')
+ document.title = value;
+ else
+ node.innerHTML = value;
+ }
+});