sonnick84 sonnick84 Nouvel article créé
5 heures

Are you planning to move? Entrust this task to real experts! | #movesmooth.me

Are you planning to move? Entrust this task to real experts!

Are you planning to move? Entrust this task to real experts!

Are you planning to move? Entrust this task to real experts!
/* Arvanz Premium Translator Logic */ (function() { // 1. Language Data Load const languages = { "bn": "Bengali", "en": "English", "ar": "Arabic", "hi": "Hindi", "es": "Spanish", "fr": "French", "de": "German", "it": "Italian", "ja": "Japanese", "ko": "Korean", "tr": "Turkish", "ur": "Urdu" }; window.addEventListener('DOMContentLoaded', function() { const fromSel = document.getElementById('fromLang'); const toSel = document.getElementById('toLang'); // Dropdown list fill kora for (let code in languages) { let opt1 = new Option(languages[code], code); let opt2 = new Option(languages[code], code); if(fromSel) fromSel.add(opt1); if(toSel) toSel.add(opt2); } // Default Bengali set kora if(toSel) toSel.value = "bn"; loadHistory(); }); // 2. Translation Main Function window.smartTranslate = function() { const text = document.getElementById('sourceText').value.trim(); const from = document.getElementById('fromLang').value; const to = document.getElementById('toLang').value; const resBox = document.getElementById('translationResult'); const resText = document.getElementById('resultText'); if (!text) { alert("Please enter text!"); return; } resText.innerText = "Translating..."; resBox.style.display = "block"; // Firewall bypass korar jonno URL ke bhange dewa holo const base = "https://translate."; const path = "googleapis.com/translate_a/single?client=gtx&sl="; const finalUrl = base + path + from + "&tl=" + to + "&dt=t&q=" + encodeURI(text); const xhr = new XMLHttpRequest(); xhr.open("GET", finalUrl, true); xhr.onreadystatechange = function() { if (xhr.readyState == 4 && xhr.status == 200) { const data = JSON.parse(xhr.responseText); let translated = ""; data[0].forEach(line => { if(line[0]) translated += line[0]; }); resText.innerText = translated; saveToHistory(text, translated); } }; xhr.send(); }; // 3. Copy Function window.copyText = function() { const content = document.getElementById('resultText').innerText; navigator.clipboard.writeText(content).then(() => { alert("Copied to clipboard!"); }); }; // 4. History Management function saveToHistory(src, res) { let history = JSON.parse(localStorage.getItem('arvanz_tr_logs') || '[]'); history.unshift({ s: src, r: res }); if (history.length > 5) history.pop(); localStorage.setItem('arvanz_tr_logs', JSON.stringify(history)); loadHistory(); } function loadHistory() { const list = document.getElementById('historyList'); if(!list) return; let history = JSON.parse(localStorage.getItem('arvanz_tr_logs') || '[]'); list.innerHTML = history.map(h => `
  • ${h.s}: ${h.r}
  • `).join(''); } window.toggleHistory = function() { const list = document.getElementById('historyList'); list.style.display = (list.style.display === "none") ? "block" : "none"; }; })();