]> git.saurik.com Git - cydia.git/blame - MobileCydia.app/localize.js
Do not crash if Safari's Info.plist can't be read.
[cydia.git] / MobileCydia.app / localize.js
CommitLineData
f79a4512
JF
1document.addEventListener("DOMContentLoaded", function () {
2 var results = document.evaluate("//*[@localize]", document, null, XPathResult.ANY_TYPE, null);
3 var result, nodes = [];
4 while (result = results.iterateNext())
5 nodes.push(result);
6 for (var index in nodes) {
7 var node = nodes[index];
8 var key = node.getAttribute('localize');
9 var value = cydia.localize(key, node.innerHTML);
10 if (node.nodeName == 'TITLE')
11 document.title = value;
12 else
13 node.innerHTML = value;
14 }
15});