-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathil8n.js
19 lines (16 loc) · 817 Bytes
/
il8n.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
document.addEventListener('DOMContentLoaded', function () {
//translates tooptips of the 3 top buttons
document.getElementById('topbtn1').title = chrome.i18n.getMessage("html_topbtn_tooltip1");
document.getElementById('topbtn2').title = chrome.i18n.getMessage("html_topbtn_tooltip2");
document.getElementById('topbtn3').title = chrome.i18n.getMessage("html_topbtn_tooltip3");
document.getElementById('blogbtn').title = chrome.i18n.getMessage("opt_blogbtn_tooltip");
// auto-translate all elements with i18n attributes
// this part is from the HTTPS-Everywhere extension
var all = document.getElementsByTagName("*");
for(var i=0, max=all.length; i < max; i++) {
var label = all[i].getAttribute('i18n');
if(label) {
all[i].innerHTML = chrome.i18n.getMessage(label);
}
}
});