summaryrefslogtreecommitdiff
path: root/MobileCydia.app/localize.js
blob: 9be82d0abe6b192c99fe3397cd41d98362b2a88b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
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;
    }
});