diff options
author | Jay Freeman (saurik) <saurik@saurik.com> | 2010-10-28 02:25:18 -0700 |
---|---|---|
committer | Jay Freeman (saurik) <saurik@saurik.com> | 2010-11-01 22:56:25 -0700 |
commit | e17a8c4f2ae16f8daab460936a9b130d024173dd (patch) | |
tree | 1544816ffb283219f2de45b0a8e99d6f7ebe24f6 /MobileCydia.app/localize.js | |
parent | 6067f1b8116d8fb2502359f430b9d958e10807b9 (diff) |
Rename Cydia.* to MobileCydia.* and add Cydia.frappliance.
Diffstat (limited to 'MobileCydia.app/localize.js')
-rw-r--r-- | MobileCydia.app/localize.js | 15 |
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; + } +}); |