X7ROOT File Manager
Current Path:
/home/okeydcqc/.trash/Chameleon.1/Chameleon/cn/files/js
home
/
okeydcqc
/
.trash
/
Chameleon.1
/
Chameleon
/
cn
/
files
/
js
/
ðŸ“
..
📄
index.js
(788 B)
📄
translate.js
(845 B)
Editing: translate.js
function Translate() { //initialization this.init = function(attribute, lng){ this.attribute = attribute; this.lng = lng; } //translate this.process = function(){ _self = this; var xrhFile = new XMLHttpRequest(); //load content data xrhFile.open("GET", "lng/"+this.lng+".json", false); xrhFile.onreadystatechange = function () { if(xrhFile.readyState === 4) { if(xrhFile.status === 200 || xrhFile.status == 0) { var LngObject = JSON.parse(xrhFile.responseText); var allDom = document.getElementsByTagName("*"); for(var i =0; i < allDom.length; i++){ var elem = allDom[i]; var key = elem.getAttribute(_self.attribute); if(key != null) { elem.innerHTML = LngObject[key] ; } } } } } xrhFile.send(); } }
Upload File
Create Folder