← Back to tarjemy.com
تTarjemy · Imam Dashboard
Not live

Live Translation

Tap the mic to start. Speak in Arabic — your congregation reads along in their language instantly.

Tap to start broadcasting
Chrome or Edge required · Make sure mic is allowed
Live Arabic transcript
📖 Qur'an verse detected
Live translations
English
Urdu
Bengali
French
Somali
0
Phrases translated
0
Qur'an ayahs detected
0:00
Session duration

Congregation QR Code

Display at the entrance — worshippers scan to follow live

Generating...
0
people following live
(simulated · real count needs backend)
How to use on Friday
  1. 1 Type your masjid name above and print the QR poster
  2. 2 Post the QR at the masjid entrance before Jumu'ah
  3. 3 Open this page on your phone or laptop during the khutbah
  4. 4 Tap the mic — translations go live instantly ✓
Tarjemy QR — ${name}
${name}
ترجمة فورية لكل مصلٍّ
Scan to follow today's khutbah in your language — no app needed
${sessionUrl}
🌍 English · اردو · বাংলা · Français · Español · Türkçe · Somali · and 30+ more

1. Open your phone camera
2. Point it at the QR code
3. Tap the link that appears
4. Choose your language and follow live

`); w.document.close();w.print(); } // ── MIC & TRANSLATION ── let rec=null, isLive=false, phraseCount=0, quranCount=0, sessionStart=null, timerInterval=null; function toggleMic(){ if(isLive) stopLive(); else startLive(); } function startLive(){ const SR=window.SpeechRecognition||window.webkitSpeechRecognition; if(!SR){ alert('Live mic requires Chrome or Edge browser on desktop. Safari is not supported.'); return; } if(!rec){ rec=new SR(); rec.lang=document.getElementById('micLang').value||'ar-SA'; rec.continuous=true;rec.interimResults=true; rec.onresult=async e=>{ let fi='',interim=''; for(let i=e.resultIndex;i{ if(ev.error==='not-allowed'){ alert('Microphone access was blocked.\n\nFix: Click the lock icon 🔒 in your browser address bar → Allow microphone.'); } stopLive(); }; rec.onend=()=>{if(isLive){try{rec.start();}catch(e){}}}; } try{ rec.lang=document.getElementById('micLang').value||'ar-SA'; rec.start(); isLive=true; sessionStart=Date.now(); timerInterval=setInterval(updateTimer,1000); // Update UI document.getElementById('micRing').className='mic-ring live'; document.getElementById('micBig').className='mic-btn-big live'; document.getElementById('micInstruction').textContent='● Broadcasting live — speak Arabic'; document.getElementById('micInstruction').className='mic-instruction live'; document.getElementById('micSub').textContent='Tap again to stop'; document.getElementById('statusBadge').className='status-badge live'; document.getElementById('statusText').textContent='LIVE'; // Simulate growing listener count simulateListeners(); }catch(e){ alert('Could not start mic. Please refresh and try again.'); } } function stopLive(){ isLive=false; if(rec){try{rec.stop();}catch(e){}} clearInterval(timerInterval); document.getElementById('micRing').className='mic-ring idle'; document.getElementById('micBig').className='mic-btn-big idle'; document.getElementById('micInstruction').textContent='Session ended — tap to start again'; document.getElementById('micInstruction').className='mic-instruction'; document.getElementById('micSub').textContent='Chrome or Edge required · Make sure mic is allowed'; document.getElementById('statusBadge').className='status-badge idle'; document.getElementById('statusText').textContent='Not live'; } function updateTimer(){ const elapsed=Math.floor((Date.now()-sessionStart)/1000); const m=Math.floor(elapsed/60); const s=String(elapsed%60).padStart(2,'0'); document.getElementById('statMins').textContent=m+':'+s; } let listenerSim=0; function simulateListeners(){ // Simulate listeners joining over time const grow=setInterval(()=>{ if(!isLive){clearInterval(grow);return;} listenerSim=Math.min(listenerSim+Math.floor(Math.random()*3),99); document.getElementById('listenerCount').textContent=listenerSim; },3000); } async function translateAll(arabicText){ const n=normAr(arabicText); const qAlert=document.getElementById('quranChip'); const qRef=document.getElementById('quranRef'); // Check Quran dict let isQuran=false; for(const[k,v] of Object.entries(QD)){ if(n.includes(normAr(k))||normAr(k).includes(n)){ // Fill all lang rows from dict DISPLAY_LANGS.forEach(lang=>{ const el=document.getElementById('tr-'+lang); if(el) el.textContent=v[lang]||v.en; }); if(v.c){ qAlert.classList.add('show'); qRef.textContent=v.c; quranCount++; document.getElementById('statQuran').textContent=quranCount; isQuran=true; } return; } } qAlert.classList.remove('show'); // Use Gemini for all languages in parallel DISPLAY_LANGS.forEach(lang=>{ const el=document.getElementById('tr-'+lang); if(el) el.textContent='...'; }); const promises=DISPLAY_LANGS.map(lang=>geminiTranslate(arabicText,lang)); const results=await Promise.all(promises); DISPLAY_LANGS.forEach((lang,i)=>{ const el=document.getElementById('tr-'+lang); if(el) el.textContent=results[i]||'—'; }); } async function geminiTranslate(text, targetLang){ try{ const langName=LANG_NAMES[targetLang]||'English'; const res=await fetch(`https://generativelanguage.googleapis.com/v1beta/models/gemini-1.5-flash:generateContent?key=${window.GEMINI_KEY}`,{ method:'POST', headers:{'Content-Type':'application/json'}, body:JSON.stringify({ contents:[{parts:[{text:`Translate this Arabic text to ${langName}. Return ONLY the translation:\n\n${text}`}]}], generationConfig:{maxOutputTokens:150,temperature:0.1} }) }); const d=await res.json(); return d.candidates?.[0]?.content?.parts?.[0]?.text?.trim()||'—'; }catch(e){return '—';} }