diff options
author | Jay Freeman (saurik) <saurik@saurik.com> | 2009-04-15 20:36:10 +0000 |
---|---|---|
committer | Jay Freeman (saurik) <saurik@saurik.com> | 2010-09-30 07:13:11 +0000 |
commit | f79a451249afae7da9887ff92f0d9d1d70c92dd4 (patch) | |
tree | 0ae29ed116fae713bb5be33f69f1238c60a084aa /Cydia.app/localize.js | |
parent | 55bd124e13c658480b9e008802c45c4e86d1549b (diff) |
This is getting nuts, I need an internal branch.
Diffstat (limited to 'Cydia.app/localize.js')
-rw-r--r-- | Cydia.app/localize.js | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/Cydia.app/localize.js b/Cydia.app/localize.js new file mode 100644 index 0000000..9be82d0 --- /dev/null +++ b/Cydia.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; + } +}); |