diff --git a/README.md b/README.md index dffe41b..dcf811a 100644 --- a/README.md +++ b/README.md @@ -2,6 +2,12 @@ A local web dashboard for BPQ32: node status, BBS, Winlink, forwarding, chat, traffic monitor, contact journal, station map and an amber Telnet terminal. Callsigns, aliases, locator and ports come from your station configuration. Node.js backend with no external npm dependencies; HTML/CSS/JavaScript frontend. +## Interface language + +Choose **Auto · System**, **Italiano** or **English** in the login screen or dashboard header. Auto follows the first preferred browser language (normally inherited from the PC): Italian for `it` / `it-*`, English otherwise. The choice is saved in that browser and applies immediately, without signing out or interrupting a radio session. Dates and numbers follow the selected language; the local timezone is unchanged. Mail, bulletin subjects and bodies, chat messages, attachment contents, terminal output and radio traffic remain original. No online translation service is used. + +Interface copy is maintained in `public/i18n.js`; add new UI phrases and parameterised status patterns there. Mark custom data widgets with `data-no-i18n` so their content is preserved. + ## Requirements - Windows and Windows PowerShell 5.1 or later. diff --git a/i18n.test.mjs b/i18n.test.mjs new file mode 100644 index 0000000..7d42b79 --- /dev/null +++ b/i18n.test.mjs @@ -0,0 +1,34 @@ +import test from 'node:test'; +import assert from 'node:assert/strict'; +import vm from 'node:vm'; +import {readFileSync} from 'node:fs'; +const source=readFileSync(new URL('./public/i18n.js',import.meta.url),'utf8'); +function client(languages=['it-IT'],saved=null){ + const storage=new Map(saved?[['bpq-language',saved]]:[]),events=[]; + const context=vm.createContext({navigator:{languages},localStorage:{getItem:k=>storage.get(k),setItem:(k,v)=>storage.set(k,v)},document:{documentElement:{lang:''},readyState:'loading',body:null,addEventListener(){},querySelectorAll:()=>[],dispatchEvent:e=>events.push(e)},addEventListener(){},CustomEvent:class{constructor(type,options){Object.assign(this,{type,...options});}}}); + vm.runInContext(source,context);return {api:context.BPQI18n,document:context.document,storage,events}; +} +test('automatic UI language follows the first browser language, with English fallback',()=>{ + for(const [languages,expected]of [[['it-IT','en-US'],'it'],[['en-US','it'],'en'],[['de-DE'],'en'],[[],'en']]){ + const {api,document}=client(languages);assert.equal(api.language,expected);assert.equal(document.documentElement.lang,expected); + } +}); +test('explicit language overrides automatic detection and is saved per browser',()=>{ + const {api,storage,document}=client(['en-US'],'it');assert.equal(api.t('Connetti'),'Connetti'); + api.setLanguage('en');assert.equal(api.t('Connetti'),'Connect');assert.equal(storage.get('bpq-language'),'en');assert.equal(document.documentElement.lang,'en');assert.equal(api.locale(),'en-GB'); + api.setLanguage('it');assert.equal(api.t('Connetti'),'Connetti');assert.equal(api.locale(),'it-IT'); + api.setLanguage('auto');assert.equal(api.language,'en');assert.equal(api.preference,'auto'); + api.setLanguage('invalid');assert.equal(api.preference,'auto'); +}); +test('UI translations handle counters, statuses, decorative icons and dynamic values',()=>{ + const {api}=client(['en']); + assert.equal(api.t('↻ Sincronizza ora'),'↻ Sync now'); + assert.equal(api.t('Salva e metti in coda →'),'Save and queue →'); + assert.equal(api.t('12 bollettini · 3 personali'),'12 bulletins · 3 personal'); + assert.equal(api.t('● Connesso · N0TEST'),'● Connected · N0TEST'); + assert.equal(api.t('Stazione / Panoramica'),'Station / Overview'); + assert.equal(api.t('Aggiornato 13:10 · UTC+02:00'),'Updated 13:10 · UTC+02:00'); + assert.equal(api.t('2 nuovi messaggi ↓'),'2 new messages ↓'); + assert.equal(api.t('HB9ON-2'),'HB9ON-2'); + assert.equal(api.t('Custom unknown text'),'Custom unknown text'); +}); diff --git a/public/app.js b/public/app.js index 26f32e3..1abcc25 100644 --- a/public/app.js +++ b/public/app.js @@ -6,8 +6,8 @@ async function api(url,options={}){const r=await fetch('/api'+url,{...options,he function toast(text){$('#toast').textContent=text;$('#toast').hidden=false;clearTimeout(toast.timer);toast.timer=setTimeout(()=>$('#toast').hidden=true,6500);} function showLogin(){document.title='BPQ Console';$('#shell').hidden=true;$('#login').hidden=false;csrf='';} function showShell(user){station=user.config;applyStation(user);csrf=user.csrf;$('#login').hidden=true;$('#shell').hidden=false;loadDashboard();if(station.features.bbs)loadMessages();document.dispatchEvent(new Event('station-ready'));} -function logTime(value){if(!value)return '—';const m=value.match(/^(\d{2})(\d{2})(\d{2}) (\d{2}:\d{2}:\d{2})$/);if(!m)return value;return new Date(`20${m[1]}-${m[2]}-${m[3]}T${m[4]}Z`).toLocaleTimeString('it-IT',{hour:'2-digit',minute:'2-digit'});} -function categoryLabel(m){return m.type==='P'?'PERSONALE':m.to||'BOLLETTINO'} +function logTime(value){if(!value)return '—';const m=value.match(/^(\d{2})(\d{2})(\d{2}) (\d{2}:\d{2}:\d{2})$/);if(!m)return value;return new Date(`20${m[1]}-${m[2]}-${m[3]}T${m[4]}Z`).toLocaleTimeString(BPQI18n.locale(),{hour:'2-digit',minute:'2-digit'});} +function categoryLabel(m){return m.type==='P'?BPQI18n.t('PERSONALE'):m.to||BPQI18n.t('BOLLETTINO')} function friendlyActivity(text){if(/Failure with/.test(text))return 'il nodo remoto non ha risposto alla chiamata';if(/Connecting to BBS/.test(text))return 'Chiamata radio verso il nodo remoto avviata';if(/Incoming Connect/.test(text))return 'il nodo remoto si è collegato alla nostra BBS';if(/Uncompressing Message/.test(text))return 'Ricevuto e salvato un nuovo bollettino';if(/Disconnected/.test(text))return 'Sessione con il nodo remoto terminata';return text;} function readableBody(text){const m=text.match(/^((?:R:[^\n]*\n)+)/);if(!m)return esc(text);return `
Percorso del messaggio nella rete
${esc(m[1])}
${esc(text.slice(m[1].length).replace(/^\n+/,''))}`;} function size(n){return n>1024?(n/1024).toFixed(1)+' KB':n+' B'} @@ -15,20 +15,20 @@ function navigate(next){page=next;$$('.page').forEach(p=>p.hidden=p.id!==next);$ $$('[data-page]').forEach(b=>b.addEventListener('click',()=>navigate(b.dataset.page))); $('#login-form').addEventListener('submit',async e=>{e.preventDefault();const b=e.target.querySelector('button');b.disabled=true;$('#login-error').textContent='';try{const user=await api('/login',{method:'POST',body:JSON.stringify(Object.fromEntries(new FormData(e.target)))});e.target.password.value='';showShell(user);}catch(err){$('#login-error').textContent=err.message}finally{b.disabled=false}}); $('#logout').onclick=async()=>{try{await api('/logout',{method:'POST',body:'{}'})}finally{showLogin()}}; -async function loadDashboard(){try{const d=await api('/dashboard');dashboardData=d;$('#connection').textContent=d.errors.length?'● Dati parziali':'● BPQ connesso';$('#notice').hidden=!d.errors.length;$('#notice').textContent=d.errors.join(' · ');$('#k-messages').textContent=d.counts.messages;$('#nav-count').textContent=d.counts.messages;$('#k-message-detail').textContent=`${d.counts.bulletins} bollettini · ${d.counts.personal} personali`;$('#k-nodes').textContent=d.nodes.length;$('#k-routes').textContent=d.routes.filter(r=>r.active).length;$('#k-sync').textContent=logTime(d.sync?.at);$('#k-sync-detail').textContent=d.sync?`${d.sync.received} ${d.sync.received===1?'messaggio ricevuto':'messaggi ricevuti'} · ${mailTimezone()}`:'Nessuno rilevato oggi';const r=d.radio;$('#radio-freq').textContent=r?.frequency||'—';$('#radio-status').textContent=r?.connected?'MODEM ONLINE':'NON DISPONIBILE';$('#radio-modem').textContent=r?.connected?(station.radio?.driver||'Modem')+' '+r.mode:'Non collegato';$('#radio-channel').textContent=r?(r.busy?'Occupato':'Libero'):'—';$('#radio-snr').textContent=r?r.snr+' dB':'—';$('#radio-scan').textContent=r?.scanning?'● Scansione attiva':r?.state&&r.state!=='Free'?'● '+r.state:'Scansione non rilevata';$('#updated').textContent='Aggiornato '+new Date(d.updatedAt).toLocaleTimeString('it-IT',{hour:'2-digit',minute:'2-digit'});$('#routes').innerHTML=d.routes.map(r=>`${esc(r.call)}${r.active?'ATTIVO':'INATTIVO'}${esc(r.port)}${r.quality}${r.nodes}${r.frames}${r.retries}`).join('')||'Nessuna rotta disponibile';$('#nodes').innerHTML=d.nodes.map(n=>{const [alias,call]=n.split(':');return `
${esc(alias)}${esc(call)}
`}).join('');$('#node-total').textContent=d.nodes.length+' destinazioni';}catch(err){$('#connection').textContent='● Connessione assente';$('#notice').hidden=false;$('#notice').textContent=err.message;}} +async function loadDashboard(){try{const d=await api('/dashboard');dashboardData=d;$('#connection').textContent=d.errors.length?'● Dati parziali':'● BPQ connesso';$('#notice').hidden=!d.errors.length;$('#notice').textContent=d.errors.join(' · ');$('#k-messages').textContent=d.counts.messages;$('#nav-count').textContent=d.counts.messages;$('#k-message-detail').textContent=`${d.counts.bulletins} bollettini · ${d.counts.personal} personali`;$('#k-nodes').textContent=d.nodes.length;$('#k-routes').textContent=d.routes.filter(r=>r.active).length;$('#k-sync').textContent=logTime(d.sync?.at);$('#k-sync-detail').textContent=d.sync?`${d.sync.received} ${d.sync.received===1?'messaggio ricevuto':'messaggi ricevuti'} · ${mailTimezone()}`:'Nessuno rilevato oggi';const r=d.radio;$('#radio-freq').textContent=r?.frequency||'—';$('#radio-status').textContent=r?.connected?'MODEM ONLINE':'NON DISPONIBILE';$('#radio-modem').textContent=r?.connected?(station.radio?.driver||'Modem')+' '+r.mode:'Non collegato';$('#radio-channel').textContent=r?(r.busy?'Occupato':'Libero'):'—';$('#radio-snr').textContent=r?r.snr+' dB':'—';$('#radio-scan').textContent=r?.scanning?'● Scansione attiva':r?.state&&r.state!=='Free'?'● '+r.state:'Scansione non rilevata';$('#updated').textContent='Aggiornato '+new Date(d.updatedAt).toLocaleTimeString(BPQI18n.locale(),{hour:'2-digit',minute:'2-digit'});$('#routes').innerHTML=d.routes.map(r=>`${esc(r.call)}${r.active?'ATTIVO':'INATTIVO'}${esc(r.port)}${r.quality}${r.nodes}${r.frames}${r.retries}`).join('')||'Nessuna rotta disponibile';$('#nodes').innerHTML=d.nodes.map(n=>{const [alias,call]=n.split(':');return `
${esc(alias)}${esc(call)}
`}).join('');$('#node-total').textContent=d.nodes.length+' destinazioni';}catch(err){$('#connection').textContent='● Connessione assente';$('#notice').hidden=false;$('#notice').textContent=err.message;}} async function loadMessages(){if(!station.features.bbs)return;try{allMessages=await api('/messages');const current=$('#category').value;const categories=[...new Set(allMessages.filter(m=>m.type==='B').map(m=>m.to))].sort();$('#category').innerHTML=''+categories.map(c=>``).join('');$('#category').value=current;renderMessages();}catch(err){toast(err.message)}} -function mailDate(m,kind='received'){const value=kind==='sent'?m.createdAt:(m.receivedAt||m.createdAt);if(!value)return m.date||'—';return new Date(value).toLocaleString('it-IT',{day:'2-digit',month:'2-digit',hour:'2-digit',minute:'2-digit'});} +function mailDate(m,kind='received'){const value=kind==='sent'?m.createdAt:(m.receivedAt||m.createdAt);if(!value)return m.date||'—';return new Date(value).toLocaleString(BPQI18n.locale(),{day:'2-digit',month:'2-digit',hour:'2-digit',minute:'2-digit'});} function mailTimezone(){const minutes=-new Date().getTimezoneOffset();return 'UTC'+(minutes>=0?'+':'-')+String(Math.floor(Math.abs(minutes)/60)).padStart(2,'0')+':'+String(Math.abs(minutes)%60).padStart(2,'0');} -function mailTimeMeta(m){const zone=mailTimezone();const stamp=kind=>{const value=kind==='sent'?m.createdAt:m.receivedAt;return value?new Date(value).toLocaleString('it-IT',{day:'2-digit',month:'2-digit',year:'numeric',hour:'2-digit',minute:'2-digit'}):null;};return [stamp('sent')?'Inviato '+esc(stamp('sent'))+'':'',stamp('received')?'Ricevuto '+esc(stamp('received'))+'':'','Timezone: '+esc(zone)].filter(Boolean).map(x=>''+x+'').join('');} +function mailTimeMeta(m){const zone=mailTimezone();const stamp=kind=>{const value=kind==='sent'?m.createdAt:m.receivedAt;return value?new Date(value).toLocaleString(BPQI18n.locale(),{day:'2-digit',month:'2-digit',year:'numeric',hour:'2-digit',minute:'2-digit'}):null;};return [stamp('sent')?'Inviato '+esc(stamp('sent'))+'':'',stamp('received')?'Ricevuto '+esc(stamp('received'))+'':'','Timezone: '+esc(zone)].filter(Boolean).map(x=>''+x+'').join('');} function mailRow(m,selection,attribute,options={}){const unread=m.status==='N',current=selection===m.id;return ``;} function renderMessages(){const q=$('#search').value.toLowerCase(),cat=$('#category').value;const list=allMessages.filter(m=>(filter==='all'||m.type===filter||filter==='sent'&&m.from.replace(/-\d+$/,'')===station.call.replace(/-\d+$/,''))&&(!cat||m.to===cat)&&(!q||`${m.subject} ${m.from} ${m.to} ${m.id}`.toLowerCase().includes(q)));$('#list-count').textContent=list.length+' messaggi';$('#message-list').innerHTML=list.map(m=>mailRow(m,selected,'data-id',{category:categoryLabel(m),status:m.status==='F'?'Inoltrato':m.status==='N'?'Nuovo':m.status==='Y'?'Letto':m.status==='H'?'Trattenuto':m.status})).join('')||'

Nessun messaggio corrisponde ai filtri.

';$$('#message-list [data-id]').forEach(b=>b.onclick=()=>readMessage(Number(b.dataset.id)));} async function readMessage(id){const generation=++loadGeneration;selected=id;renderMessages();$('#reader').innerHTML='

Caricamento messaggio…

';try{const m=await api('/messages/'+id);if(generation!==loadGeneration)return;$('#reader').innerHTML=`
${m.type==='B'?'BOLLETTINO':'MESSAGGIO PERSONALE'} · #${id}

${esc(m.subject)}

Da ${esc(m.from)}A ${esc(m.to)}${mailTimeMeta(m)}
${readableBody(m.text)}
`;$('#reply').onclick=()=>openCompose({to:m.from,subject:(/^Re:/i.test(m.subject)?m.subject:'Re: '+m.subject).slice(0,80),text:'\n\n--- '+m.from+' ---\n'+m.text.split('\n').map(l=>'> '+l).join('\n')});}catch(err){$('#reader').innerHTML=`

Messaggio non disponibile

${esc(err.message)}

`}} $$('[data-filter]').forEach(b=>b.onclick=()=>{filter=b.dataset.filter;$$('[data-filter]').forEach(x=>x.classList.toggle('active',x===b));renderMessages()});$('#search').oninput=renderMessages;$('#category').onchange=renderMessages; function openCompose(data={}){const f=$('#compose-form');f.reset();for(const [key,value]of Object.entries(data))f.elements[key].value=value;$('#compose-error').textContent='';$('#compose').showModal();f.elements.to.focus()} -$$('.compose-button').forEach(b=>b.onclick=()=>openCompose());$$('.close-compose').forEach(b=>b.onclick=()=>{const f=$('#compose-form');if((f.elements.text.value||f.elements.subject.value)&&!confirm('Chiudere e scartare questa bozza?'))return;$('#compose').close()}); +$$('.compose-button').forEach(b=>b.onclick=()=>openCompose());$$('.close-compose').forEach(b=>b.onclick=()=>{const f=$('#compose-form');if((f.elements.text.value||f.elements.subject.value)&&!bpqConfirm('Chiudere e scartare questa bozza?'))return;$('#compose').close()}); $('#compose-form').addEventListener('submit',async e=>{e.preventDefault();const winlinkMode=typeof wlCompose!=='undefined'&&wlCompose;const b=$('#send-button');b.disabled=true;b.textContent='Salvataggio in BPQ…';$('#compose-error').textContent='';try{const data=Object.fromEntries(new FormData(e.target));const created=await api('/messages',{method:'POST',body:JSON.stringify(data)});$('#compose').close();toast('Messaggio #'+created.id+' salvato nella BBS. L’inoltro sarà gestito da BPQ.');if(winlinkMode){navigate('winlink');wlFolder='queue';await wlLoad();wlRender();wlRead(created.id);}else{navigate('bbs');await loadMessages();readMessage(created.id);}loadDashboard();}catch(err){$('#compose-error').textContent=err.message}finally{b.disabled=false;b.textContent='Salva e metti in coda →'}}); $('#refresh').onclick=async()=>{const b=$('#refresh');b.disabled=true;await Promise.all([loadDashboard(),loadMessages()]);b.disabled=false}; -setInterval(()=>{if(csrf&&!document.hidden)loadDashboard()},20000);setInterval(()=>{$('#clock').textContent=new Date().toLocaleTimeString('it-IT',{hour:'2-digit',minute:'2-digit'})+' · '+mailTimezone()},1000); +setInterval(()=>{if(csrf&&!document.hidden)loadDashboard()},20000);setInterval(()=>{$('#clock').textContent=new Date().toLocaleTimeString(BPQI18n.locale(),{hour:'2-digit',minute:'2-digit'})+' · '+mailTimezone()},1000); function restoreSession(){api('/session').then(showShell).catch(()=>showLogin());} if(document.readyState==='loading')document.addEventListener('DOMContentLoaded',restoreSession,{once:true});else restoreSession(); @@ -59,3 +59,5 @@ function applyStation(user){ if(!station.features.bbs){$('#nav-count').hidden=true;$$('.compose-button').forEach(b=>b.disabled=true);} if(!station.features[page]&&['bbs','chat','winlink','monitor'].includes(page))navigate('home'); } + +document.addEventListener('bpq-languagechange',()=>{if(csrf){renderMessages();if(typeof wlRender==='function')wlRender();}}); diff --git a/public/enhancements.js b/public/enhancements.js index 0b22d2b..36f2fea 100644 --- a/public/enhancements.js +++ b/public/enhancements.js @@ -39,7 +39,7 @@ function renderChat(data){ const events=data.events.filter(e=>e.id>chatLastId),initial=chatLastId===0; if(events.length){if(chatArea.querySelector('.chat-empty'))chatArea.replaceChildren();const fragment=document.createDocumentFragment();let added=0; for(const event of events){chatLastId=Math.max(chatLastId,event.id);if(event.type==='system'&&/^[A-Z0-9]{3,6}(?:\s+[A-Z0-9]{3,6})*$/.test(event.text))continue; - const element=document.createElement('div');if(event.type==='message'&&!/\*\*\* (?:Joined|Left)/i.test(event.text)){element.className='chat-event '+(event.sender===station.call?'own':'')+(event.to?' private':'');element.innerHTML=`
${esc(event.sender?.slice(0,2)||'?')}
${esc(event.sender)}${event.to?` → ${esc(event.to)} · privato`:''}

${esc(event.text)}

`;added++;}else{element.className='chat-system';element.textContent=(event.sender?event.sender+' · ':'')+event.text;}fragment.append(element);} + const element=document.createElement('div');if(event.type==='message'&&!/\*\*\* (?:Joined|Left)/i.test(event.text)){element.className='chat-event '+(event.sender===station.call?'own':'')+(event.to?' private':'');element.innerHTML=`
${esc(event.sender?.slice(0,2)||'?')}
${esc(event.sender)}${event.to?` → ${esc(event.to)} · privato`:''}

${esc(event.text)}

`;added++;}else{element.className='chat-system';element.textContent=(event.sender?event.sender+' · ':'')+event.text;}fragment.append(element);} chatArea.append(fragment);while(chatArea.children.length>300)chatArea.firstChild.remove(); if(initial||chatFollowing||events.some(e=>e.sender===station.call&&e.type==='message')){chatFollowing=true;if(page==='chat')chatToBottom();}else{chatUnread+=added;updateChatJump();} } diff --git a/public/forwarding.js b/public/forwarding.js index 8902499..d97a404 100644 --- a/public/forwarding.js +++ b/public/forwarding.js @@ -3,7 +3,7 @@ let data=null,loading=false,pending=new Map(),expanded=null; const nav=document.createElement('button');nav.dataset.page='forwarding';nav.innerHTML='⇄ Forwarding';nav.onclick=()=>navigate('forwarding');$('nav [data-page="network"]').before(nav); const panel=document.createElement('section');panel.id='forwarding';panel.className='page';panel.hidden=true;panel.innerHTML='

Forwarding

Partner e scambi della BBS

Caricamento profili BPQ…

Le fasce mostrano il fuso configurato in BPQ. Il prossimo tentativo è una stima: timer, disponibilità del modem e condizioni di connessione sono gestiti da BPQ. Le regole si modificano nella configurazione BPQ.

';$('main').append(panel); const prevNavigate=navigate;navigate=function(next){prevNavigate(next);if(next==='forwarding'){$('#breadcrumb').textContent='Stazione / Forwarding';load();}}; -const time=t=>t?new Date(t).toLocaleString('it-IT',{day:'2-digit',month:'2-digit',hour:'2-digit',minute:'2-digit',second:'2-digit'}):'Non rilevato'; +const time=t=>t?new Date(t).toLocaleString(BPQI18n.locale(),{day:'2-digit',month:'2-digit',hour:'2-digit',minute:'2-digit',second:'2-digit'}):'Non rilevato'; const interval=n=>!n?'Non impostato':n%3600===0?n/3600+' h':n%60===0?n/60+' min':n+' s'; const state=s=>({complete:'Completato',calling:'Chiamata in corso',connected:'Collegato',failed:'Non riuscito',incomplete:'Sessione interrotta',unknown:'Esito non registrato'}[s]||'In attesa'); const rules=(values,kind)=>!values.length?'Nessuna regola esplicita':values.includes('WW')?(kind==='bulletins'?'Tutte le aree geografiche':'Destinazioni geografiche tramite questo partner'):values.join(', '); @@ -24,6 +24,7 @@ $('#forward-refresh').onclick=load; $('#forward-restore').onclick=async()=>{try{await api('/forwarding/manual/restore',{method:'POST',body:'{}'});toast('Percorso originale ripristinato');await load();}catch(e){toast(e.message);}}; panel.addEventListener('keydown',e=>{if(e.target.matches('[data-forward-row]')&&['Enter',' '].includes(e.key)){e.preventDefault();e.target.click();}}); panel.addEventListener('click',async e=>{const b=e.target.closest('[data-forward-start]');if(!b){const row=e.target.closest('[data-forward-row]');if(row){expanded=expanded===row.dataset.forwardRow?null:row.dataset.forwardRow;render();}return;}if(b.disabled)return;const peer=b.dataset.forwardStart;b.disabled=true;b.textContent='Richiesta…';try{await window.bpqSync.start({kind:'forwarding',peer});pending.set(peer,Date.now());await load();}catch(err){toast(err.message);const feedback=[...panel.querySelectorAll('[data-feedback]')].find(n=>n.dataset.feedback===peer);if(feedback)feedback.textContent=err.message;b.disabled=false;b.textContent='↻ Sincronizza ora';}}); +document.addEventListener('bpq-languagechange',()=>{if(data)render();}); document.addEventListener('station-ready',()=>{data=null;pending.clear();expanded=null;nav.hidden=!station.features.bbs;if(page==='forwarding'){if(station.features.bbs)load();else navigate('home');}}); document.addEventListener('DOMContentLoaded',()=>{if(location.hash==='#forwarding')navigate('forwarding');}); setInterval(()=>{if(csrf&&!document.hidden&&page==='forwarding')load();},6000); diff --git a/public/i18n.css b/public/i18n.css new file mode 100644 index 0000000..6fe0ab6 --- /dev/null +++ b/public/i18n.css @@ -0,0 +1,6 @@ +.language-picker{display:inline-flex;align-items:center;gap:7px;color:#a5b8ba;flex:none;font-size:13px} +.language-picker select{font:inherit;color:#dce8e5;background:#111c22;border:1px solid #34454c;border-radius:7px;padding:6px 25px 6px 9px;max-width:145px;cursor:pointer;min-height:32px} +.language-picker select:focus-visible{outline:2px solid #91c7b5;outline-offset:2px} +.language-login{justify-content:center;margin-top:16px;width:100%} +.language-toolbar{margin-right:8px} +@media(max-width:700px){.language-toolbar{margin-right:0;gap:3px}.language-toolbar>span{display:none}.language-toolbar select{max-width:113px;padding-left:6px;font-size:12px}.topbar>div{gap:6px}} diff --git a/public/i18n.js b/public/i18n.js new file mode 100644 index 0000000..8010ecc --- /dev/null +++ b/public/i18n.js @@ -0,0 +1,721 @@ +/* UI translations only. Message bodies, subjects, terminal and radio traffic stay original. */ +(() => { + 'use strict'; + const entries=` +La tua stazione, in un unico pannello.|Your station, in one dashboard. +Benvenuto in stazione.|Welcome to your station. +Accedi con l’utente e la password Telnet del tuo BPQ.|Sign in with your BPQ Telnet username and password. +Utente|Username +Il tuo utente BPQ|Your BPQ username +Entra nel pannello|Open dashboard +Created by IU2EUG · PC e rete locale|Created by IU2EUG · PC and local network +LA TUA STAZIONE|YOUR STATION +Panoramica|Overview +Rete & nodi|Network & nodes +Rete|Network +Stazione BPQ|BPQ station +STAZIONE BPQ|BPQ STATION +STAZIONE|STATION +Stazione|Station +Esci|Sign out +Esci dal pannello|Sign out of dashboard +Collegamento…|Connecting… +Aggiorna dati|Refresh data +IL TUO PUNTO SULLA RETE|YOUR PLACE ON THE NETWORK +Radio, messaggi e collegamenti. Tutto nello stesso posto.|Radio, messages and connections. All in one place. +Nuovo messaggio|New message +Messaggi nella BBS|BBS messages +In attesa di BPQ|Waiting for BPQ +Nodi conosciuti|Known nodes +Destinazioni NET/ROM|NET/ROM destinations +Collegamenti attivi|Active links +Vicini sulla rete BPQ|Neighbours on the BPQ network +Ultimo sync BBS|Last BBS sync +Nessuno rilevato oggi|None detected today +PORTA RADIO|RADIO PORT +Canale|Channel +S/N ultima sessione|Last session S/N +Stato BPQ|BPQ status +Servizi della stazione|Station services +BBS & bollettini|BBS & bulletins +Leggi, scrivi e condividi via radio|Read, write and share over radio +Chat di rete|Network chat +Accesso dal nodo con CHAT|Access from the node using CHAT +Posta radio verso il CMS|Radio mail to the CMS +Nodo interattivo|Interactive node +Servizi configurati nel nodo|Services configured on the node +NODO|NODE +Bollettini dalla rete e messaggi personali, finalmente leggibili.|Network bulletins and personal messages, clearly presented. +Tutti|All +Tutte|All +Bollettini|Bulletins +Personali|Personal +Inviati|Sent +Inviate|Sent +Cerca oggetto, nominativo o categoria…|Search subject, callsign or category… +Cerca messaggi|Search messages +Categoria|Category +Tutte le categorie|All categories +Più recenti prima|Newest first +Da|From +A|To +Da / A|From / To +Oggetto|Subject +Ricevuto · data e ora|Received · date and time +Dimensione|Size +Stato|Status +Una finestra sulla rete.|A window onto the network. +Scegli un messaggio per leggerlo qui.|Select a message to read it here. +Collegamenti Internet e destinazioni annunciate al tuo nodo.|Internet links and destinations advertised to your node. +Rotte verso i vicini|Routes to neighbours +DATI BPQ|BPQ DATA +Nodo|Node +Porta|Port +Qualità|Quality +Destinazioni|Destinations +Destinazioni conosciute|Known destinations +Rotte e destinazioni rilevate da BPQ.|Routes and destinations reported by BPQ. +Chiudi|Close +Destinatario|Recipient +Tipo|Type +Nominativo oppure indirizzo email|Callsign or email address +Messaggio personale|Personal message +Bollettino|Bulletin +Di cosa vuoi parlare?|What is your message about? +Messaggio|Message +Scrivi il tuo messaggio…|Write your message… +Il messaggio sarà salvato nella BBS. L’inoltro segue i profili BPQ.|The message will be saved in the BBS. Forwarding follows the BPQ profiles. +Annulla|Cancel +Salva e metti in coda|Save and queue +Richiesta fallita|Request failed +Percorso del messaggio nella rete|Message route through the network +PERSONALE|PERSONAL +BOLLETTINO|BULLETIN +MESSAGGIO PERSONALE|PERSONAL MESSAGE +Dati parziali|Partial data +BPQ connesso|BPQ connected +NON DISPONIBILE|UNAVAILABLE +Non disponibile|Unavailable +Non collegato|Disconnected +Occupato|Busy +Libero|Free +Scansione attiva|Scanning +Scansione non rilevata|Scan not detected +ATTIVO|ACTIVE +INATTIVO|INACTIVE +Nessuna rotta disponibile|No routes available +Connessione assente|No connection +Inviato|Sent +Ricevuto|Received +Non letto|Unread +Letto|Read +(Senza oggetto)|(No subject) +Inoltrato|Forwarded +Nuovo|New +Trattenuto|Held +Nessun messaggio corrisponde ai filtri.|No messages match the filters. +Caricamento messaggio…|Loading message… +Rispondi|Reply +Messaggio non disponibile|Message unavailable +Chiudere e scartare questa bozza?|Close and discard this draft? +Salvataggio in BPQ…|Saving to BPQ… +Nessuna porta modem|No modem port +Non configurato|Not configured +Attiva o disattiva suoni|Toggle sounds +Suono attivo|Sound enabled +Attiva suono notifiche|Enable notification sound +Clicca per attivare l’audio|Click to enable audio +Prova notifica e suono|Test notification and sound +Notifica di prova|Test notification +Audio attivato · avviso per nuova posta o bollettini|Audio enabled · new mail or bulletin alert +Audio non attivato dal browser: verifica i permessi audio del sito.|Audio was not enabled by the browser: check the site's audio permissions. +Chiudi notifica|Dismiss notification +Nuovo bollettino scaricato|New bulletin downloaded +Nuova mail ricevuta|New mail received +Disponibili nella BBS|Available in the BBS +Disponibili nella posta personale|Available in personal mail +Disconnesso|Disconnected +Connetti|Connect +STANZE|ROOMS +Crea stanza|Create room +COLLEGAMENTI|LINKS +PRESENTI|ONLINE +Connettiti con il tuo account per partecipare alla chat.|Connect with your account to join the chat. +Tutta la stanza|Everyone in the room +Messaggio chat|Chat message +Invia|Send +Non connesso|Not connected +Crea o apri una stanza|Create or join a room +Nome stanza|Room name +Entra|Join +Conversazione chat|Chat conversation +Vai agli ultimi messaggi|Jump to latest messages +Ultimi messaggi|Latest messages +Connessione…|Connecting… +Connessione interrotta|Connection interrupted +Scrivi alla stanza…|Write to the room… +Connettiti per scrivere…|Connect to write… +Inattivo|Inactive +Attivo|Active +Nessun utente rilevato|No users detected +Connettiti per vedere chi è presente.|Connect to see who is online. +Privato|Private +privato|private +In attesa|Idle +Connessione fallita|Connection failed +Chiuso|Closed +Utenti|Users +Posta della stazione|Station mail +Aggiorna mail|Refresh mail +Nuova email|New email +Ricevute|Inbox +In coda|Queued +Cerca email|Search email +Cerca email…|Search email… +Data e ora|Date and time +Seleziona una email|Select an email +Consegnata al CMS|Delivered to CMS +Trattenuta|Held +Nuova|New +Ricevuta|Received +Nessuna email in questa cartella.|No email in this folder. +Caricamento…|Loading… +Email non disponibile|Email unavailable +Elimina|Delete +Elimina messaggio|Delete message +Elimina email|Delete email +Eliminazione…|Deleting… +Scrivi una email|Write an email +Indirizzo email oppure nominativo Winlink|Email address or Winlink callsign +Invia email|Send email +STAZIONE IN ASCOLTO|STATION LISTENING +NODO LOCALE|LOCAL NODE +Porta radio BPQ|BPQ radio port +TRAFFICO BPQ|BPQ TRAFFIC +Velocità del modem|Modem speed +Campioni durante le connessioni|Samples during connections +Processo modem · ogni 5 s|Modem process · every 5 s +CPU SISTEMA|SYSTEM CPU +Carico totale del PC|Total PC load +SNR ultima sessione|Last session SNR +Nessun campione disponibile|No samples available +TX SOSPESO|TX SUSPENDED +LINK ATTIVO|LINK ACTIVE +IN ASCOLTO|LISTENING +PORTE RADIO IN PAUSA|RADIO PORTS PAUSED +CHIAMATA IN CORSO|CALLING +CONNESSIONE RADIO|RADIO CONNECTION +CHIAMANTE|CALLER +CHIAMATO|CALLED +Attendo risposta|Waiting for response +Chiamata in uscita|Outgoing call +Chiamata in ingresso|Incoming call +Nessuna porta modem configurata|No modem port configured +Frequenza bloccata|Frequency locked +Canale occupato|Channel busy +Canale libero|Channel clear +Modem non disponibile|Modem unavailable +SNR esposto da BPQ|SNR reported by BPQ +In attesa della prossima connessione|Waiting for the next connection +Schermo intero|Full screen +Schermo intero non disponibile in questo browser. Prova F11.|Full screen is unavailable in this browser. Try F11. +Torna alla finestra|Exit full screen +Allegato|Attachment +Chiudi anteprima|Close preview +Scarica file|Download file +Anteprima pagina PDF|PDF page preview +Caricamento anteprima…|Loading preview… +Anteprima non disponibile. Puoi scaricare il file.|Preview unavailable. You can download the file. +Anteprima PDF non disponibile. Puoi scaricare il file.|PDF preview unavailable. You can download the file. +Anteprima non disponibile per questo formato. Puoi scaricare il file.|Preview unavailable for this format. You can download the file. +Anteprima limitata ai primi 128 KB. Il download contiene il file completo.|Preview limited to the first 128 KB. The download contains the complete file. +Controllo allegati…|Checking attachments… +Anteprima|Preview +Scarica|Download +Mostra messaggio originale e dati 7plus|Show original message and 7plus data +Scarica testo originale della parte|Download original part text +Avvia monitor|Start monitor +Ferma|Stop +Direzione|Direction +Tutte le porte|All ports +Cerca nominativo o testo…|Search callsign or text… +Cerca nel traffico|Search traffic +Pausa|Pause +Riprendi|Resume +Pulisci|Clear +Scarica registro|Download log +Traffico BPQ|BPQ traffic +Avvia il monitor per seguire il traffico BPQ.|Start the monitor to follow BPQ traffic. +Monitor BPQ · sola lettura · orari originali BPQ|BPQ monitor · read only · original BPQ timestamps +Scorrimento automatico|Auto scroll +In ascolto. Nessun traffico corrispondente ai filtri.|Listening. No traffic matches the filters. +In ascolto|Listening +Nessun frame da scaricare|No frames to download +Diario|Logbook +Mappa|Map +Diario dei collegamenti|Connection logbook +Esporta CSV|Export CSV +Cerca nominativo, servizio, frequenza…|Search callsign, service or frequency… +Cerca nel diario|Search logbook +Periodo diario|Logbook period +Servizio diario|Logbook service +Direzione diario|Logbook direction +Esito diario|Logbook result +Tutti i servizi|All services +Tutte le direzioni|All directions +In ingresso|Incoming +In uscita|Outgoing +Non rilevata|Not detected +Tutti gli esiti|All results +Scambio concluso|Exchange completed +Collegato|Connected +Non riuscito|Failed +Esito non registrato|Result not recorded +Sessioni|Sessions +Stazione / servizio|Station / service +Collegamento|Connection +Durata|Duration +Messaggi|Messages +Esito|Result +Ogni collegamento ha una storia.|Every connection has a story. +Seleziona una sessione per vedere traffico, servizio e sequenza degli eventi.|Select a session to see traffic, service and event history. +La rete, sulla mappa.|The network, on a map. +Mostra collegamenti|Show links +Servizio mappa|Map service +Periodo mappa|Map period +24 ore|24 hours +7 giorni|7 days +30 giorni|30 days +Ingrandisci mappa|Zoom in +Riduci mappa|Zoom out +Inquadra rete|Fit network +Mappa interattiva delle stazioni collegate|Interactive map of connected stations +Internet / rete|Internet / network +Mezzo non archiviato|Transport not recorded +Stazione locale|Local station +Natural Earth · pubblico dominio|Natural Earth · public domain +Stazioni nel periodo|Stations in this period +Collegamenti stabiliti|Connections established +Traffico registrato|Recorded traffic +Sono mostrate le 5000 sessioni più recenti.|Showing the 5,000 most recent sessions. +Nessuna sessione corrisponde ai filtri.|No sessions match the filters. +Inizio|Start +Connessione|Connection +Fine|End +Durata collegamento|Connection duration +Trasporto|Transport +Non registrato|Not recorded +Non registrata|Not recorded +Porta BPQ|BPQ port +Frequenza|Frequency +SNR medio|Average SNR +Tentativi|Attempts +Picco TX / RX|Peak TX / RX +Messaggi inviati / ricevuti|Messages sent / received +Contatori di traffico non presenti nel log.|Traffic counters are not available in the log. +Le statistiche disponibili dipendono dal servizio e dal modem; i trattini indicano dati non registrati.|Available statistics depend on the service and modem; dashes indicate unrecorded data. +Mostra stazione sulla mappa|Show station on map +Sequenza degli eventi|Event history +Messaggi trasferiti|Transferred messages +Aggiungi locator|Add locator +Nessun collegamento stabilito nel periodo selezionato.|No connections established in the selected period. +Scegli una stazione.|Choose a station. +Clicca un punto, una traccia o un nominativo nell’elenco.|Click a point, a track or a callsign in the list. +Il LOCATOR della stazione locale non è presente in BPQ: le tracce non possono essere disegnate.|The local station's LOCATOR is missing in BPQ: tracks cannot be drawn. +Stazioni nello stesso punto|Stations at the same point +Il locator individua un’area: le posizioni effettive possono essere diverse.|A locator identifies an area: actual positions may differ. +STAZIONE COLLEGATA|CONNECTED STATION +Distanza non disponibile|Distance unavailable +Stesso locator del nodo|Same locator as the node +Posizione non disponibile|Position unavailable +Ultimo collegamento nel periodo|Last connection in this period +Salva posizione|Save position +Inserisci il locator comunicato dalla stazione.|Enter the locator provided by the station. +Es. IO91AA|e.g. IO91AA +Aggiorna|Refresh +Partner e scambi della BBS|BBS partners and exchanges +Ripristina percorso originale|Restore original route +Caricamento profili BPQ…|Loading BPQ profiles… +Le fasce mostrano il fuso configurato in BPQ. Il prossimo tentativo è una stima: timer, disponibilità del modem e condizioni di connessione sono gestiti da BPQ. Le regole si modificano nella configurazione BPQ.|Time windows use the timezone configured in BPQ. The next attempt is an estimate: BPQ manages timers, modem availability and connection conditions. Edit rules in the BPQ configuration. +Non rilevato|Not detected +Non impostato|Not set +Completato|Completed +Chiamata in corso|Calling +Sessione interrotta|Session interrupted +Nessuna regola esplicita|No explicit rules +Tutte le aree geografiche|All geographical areas +Destinazioni geografiche tramite questo partner|Geographical destinations via this partner +Percorsi|Routes +Automatici|Automatic +Messaggi in coda|Queued messages +Sessioni attive|Active sessions +Partner / percorso|Partner / route +Coda|Queue +Ultimo scambio|Last exchange +Programmazione|Schedule +Prossimo · stima|Next · estimate +Azioni|Actions +Riservato al percorso VHF|Reserved for the VHF route +Preparazione radio|Preparing radio +Richiesta inviata|Request sent +Solo manuale|Manual only +Automatico|Automatic +Disattivato|Disabled +Attende fine percorso VHF|Waiting for the VHF route to finish +Sessione in corso|Session in progress +Solo su richiesta|On request only +Automatico disattivo|Automatic disabled +Script assente|Script missing +In attesa di messaggi|Waiting for messages +Timer non disponibile|Timer unavailable +Nessuna sessione recente|No recent sessions +locale BPQ|BPQ local time +In corso|In progress +Richiesta inviata…|Request sent… +Avvia manualmente|Start manually +Sincronizza ora|Sync now +Modem impegnato|Modem busy +Nessun partner di forwarding configurato in BPQ.|No forwarding partners configured in BPQ. +Regole di inoltro|Forwarding rules +Esclusi: solo posta personale|Excluded: personal mail only +Posta personale e bollettini diretti|Personal mail and direct bulletins +Destinatari espliciti · TO|Explicit recipients · TO +Distribuzioni esplicite · AT|Explicit distributions · AT +Nessuno|None +Nessuna|None +Richiesta messaggi al partner|Request messages from partner +Disattiva|Disabled +Invio immediato nuovi messaggi|Send new messages immediately +Disattivo|Disabled +Le regole geografiche dipendono dagli indirizzi gerarchici e dalle altre rotte BPQ. I messaggi locali e quelli già ricevuti dal partner seguono le regole di esclusione di BPQ.|Geographical rules depend on hierarchical addresses and other BPQ routes. Local messages and those already received from the partner follow BPQ's exclusion rules. +Percorso di connessione|Connection route +Nessuno script configurato|No script configured +Indirizzo gerarchico|Hierarchical address +Ultimi scambi|Recent exchanges +Ingresso|Incoming +Uscita|Outgoing +Nessuno scambio nei sette file di log più recenti.|No exchanges in the seven most recent log files. +TX / RX: messaggi registrati nei log della sessione, non byte.|TX / RX: messages recorded in the session logs, not bytes. +Percorso originale ripristinato|Original route restored +Richiesta…|Requesting… +FREQUENZE DI ASCOLTO|LISTENING FREQUENCIES +Sospendi TX|Suspend TX +Caricamento frequenze…|Loading frequencies… +Nessuna scansione configurata|No scan configured +Riprendi radio|Resume radio +Controllo remoto non disponibile|Remote control unavailable +Applicazione richiesta in corso…|Applying request… +TX sospeso · porte e connessioni radio ferme|TX suspended · radio ports and connections stopped +La pausa TX chiude le connessioni radio; Internet resta disponibile.|Pausing TX closes radio connections; Internet remains available. +Mantieni almeno una frequenza di ascolto|Keep at least one listening frequency +Scegli un gateway|Choose a gateway +Directory ufficiale · canali PUBLIC|Official directory · PUBLIC channels +Aggiorna elenco|Refresh list +Cerca gateway Winlink|Search Winlink gateways +Nominativo, locator o località…|Callsign, locator or location… +Banda gateway|Gateway band +40 e 20 metri|40 and 20 metres +40 metri|40 metres +20 metri|20 metres +VHF · 2 metri|VHF · 2 metres +UHF · 70 centimetri|UHF · 70 centimetres +VHF e UHF|VHF and UHF +Tutte le bande HF|All HF bands +HF, VHF e UHF|HF, VHF and UHF +In orario e report recente|Within hours and recently reported +Ordina gateway|Sort gateways +Distanza crescente|Nearest first +Nominativo|Callsign +Frequenze sul display · USB / FM · orari UTC|Dial frequencies · USB / FM · UTC hours +Frequenza / modo|Frequency / mode +Modo / banda|Mode / band +Locator / distanza|Locator / distance +Orari UTC|UTC hours +Ultimo report|Last report +Nessun gateway selezionato|No gateway selected +Seleziona un canale nell’elenco.|Select a channel from the list. +Connetti e sincronizza|Connect and sync +La distanza non indica la qualità del collegamento. Il report conferma la pubblicazione del gateway, non che il canale radio sia libero. La frequenza centrale è disponibile nel dettaglio del canale selezionato.|Distance does not indicate link quality. A report confirms the gateway is listed, not that the radio channel is clear. The centre frequency is available in the selected channel's details. +Verifica configurazione radio…|Checking radio configuration… +Sync radio non configurato: verifica modem e controllo CAT.|Radio sync not configured: check modem and CAT control. +Sync radio non configurato: serve un modem supportato e il controllo CAT abilitato.|Radio sync not configured: a supported modem and CAT control are required. +Elenco non aggiornato: aggiorna prima di collegarti.|The list is out of date: refresh before connecting. +Non dichiarati|Not specified +In orario|Within operating hours +Fuori orario|Outside operating hours +Orari non riconosciuti|Unrecognised operating hours +Recente|Recent +Report scaduto / assente|Report expired / missing +Nessun canale corrisponde ai filtri.|No channels match the filters. +Sessione in corso…|Session in progress… +Elenco non disponibile|List unavailable +Preparazione modem packet e frequenza|Preparing packet modem and frequency +Richiesta inviata a BPQ|Request sent to BPQ +Chiamata radio in corso|Radio call in progress +Collegato · scambio posta|Connected · exchanging mail +Sync radio completato|Radio sync completed +Profilo Internet ripristinato|Internet profile restored +Collegamento non riuscito|Connection failed +Errore nella richiesta|Request error +Ripristino da verificare|Recovery needs checking +Ripristina profilo Internet|Restore Internet profile +Terminale|Terminal +Salva testo|Save text +Collega|Connect +Disconnetti|Disconnect +Terminale Telnet BPQ|BPQ Telnet terminal +Comando Telnet|Telnet command +Collega il terminale per iniziare|Connect the terminal to begin +Invia comando|Send command +INVIO|ENTER +TELNET · BPQ LOCALE|TELNET · LOCAL BPQ +↑ ↓ cronologia · Invio per inviare|↑ ↓ history · Enter to send +Torna al fondo|Jump to bottom +COLLEGAMENTO…|CONNECTING… +ERRORE|ERROR +Scrivi un comando…|Type a command… +Il terminale è vuoto|The terminal is empty +SESSIONE BPQ|BPQ SESSION +Sincronizzazione|Synchronisation +Riduci finestra|Minimise window +Preparazione…|Preparing… +Preparazione|Preparation +Chiamata|Calling +Scambio messaggi|Exchanging messages +Ripristino|Restoring +Interruzione in corso|Cancelling +Interrotto|Cancelled +Scambio|Exchange +Conclusione|Completion +Messaggi inviati|Messages sent +Messaggi ricevuti|Messages received +Avanzamento della sessione|Session progress +Aggiornamento automatico|Automatic refresh +Interrompi sync|Cancel sync +Mostra avanzamento sincronizzazione|Show sync progress +Richiesta di sincronizzazione|Synchronisation request +Interruzione…|Cancelling… +Riprova interruzione|Retry cancellation +Aggiornamento ogni 1,5 secondi|Updates every 1.5 seconds +Sessione terminata|Session ended +Invio della richiesta a BPQ|Sending request to BPQ +Sessione del pannello non più attiva. Stato BPQ ricaricato.|Dashboard session no longer active. BPQ status reloaded. +Eliminare il messaggio?|Delete this message? +Verrà rimosso dalla BBS locale di BPQ. Una email già inviata non può essere richiamata.|It will be removed from the local BPQ BBS. An email that has already been sent cannot be recalled. +Messaggio eliminato|Message deleted +Email eliminata|Email deleted +Nominativo Winlink oppure nome@example.com|Winlink callsign or name@example.com +Inserisci un nominativo Winlink o un indirizzo email valido|Enter a valid Winlink callsign or email address +Sincronizzazione richiesta…|Synchronisation requested… +Nessuna sessione rilevata oggi|No sessions detected today +Sincronizzazione completata|Synchronisation completed +Errore nella sessione CMS|CMS session error +Sessione CMS conclusa|CMS session ended +Sincronizzazione in corso|Synchronisation in progress +Una sincronizzazione è già in corso|A synchronisation is already in progress +Verifica della sessione CMS e della coda|Checking the CMS session and queue +Verifica radio e preparazione del percorso|Checking radio and preparing the route +Richiesta accettata da BPQ · attendo il collegamento|Request accepted by BPQ · waiting for connection +Sincronizzazione non trovata|Synchronisation not found +Ripristino del percorso e della scansione|Restoring route and scanning +Collegamento terminato senza completare lo scambio|Connection ended before the exchange completed +Collegamento stabilito · scambio messaggi|Connection established · exchanging messages +Chiamata in corso · attendo la risposta del nodo|Calling · waiting for the node's response +BPQ non ha registrato l’avvio della sessione|BPQ did not record the session starting +Interruzione richiesta · attendo la conferma di BPQ|Cancellation requested · waiting for BPQ confirmation +Comando di disconnessione BPQ non disponibile|BPQ disconnect command unavailable +BPQ non ha ancora confermato la disconnessione: riprova|BPQ has not confirmed disconnection yet: retry +Sincronizzazione interrotta · percorso ripristinato|Synchronisation cancelled · route restored +Locale / Telnet|Local / Telnet +Nodo BPQ|BPQ node +Porta non archiviata|Port not recorded +Lettura dei log BPQ…|Reading BPQ logs… +Cerca nominativo, servizio o frequenza…|Search callsign, service or frequency… +Ultime 24 ore|Last 24 hours +Ultimi 7 giorni|Last 7 days +Ultimi 30 giorni|Last 30 days +Le tracce uniscono le posizioni delle stazioni: non rappresentano il percorso fisico del segnale. Il punto è il centro del locator, non una posizione GPS esatta. Stazioni con lo stesso centro del locator condividono il punto: selezionale dal riquadro dettagli o dall’elenco. I nominativi senza locator restano nel diario e nell’elenco.|Tracks connect station positions: they do not represent the physical signal path. Each point is the locator centre, not an exact GPS position. Stations sharing a locator centre share a point: select them in the details panel or list. Callsigns without a locator remain in the logbook and list. +Operazioni radio|Radio operations +Diario di stazione|Station logbook +Stazioni collegate|Connected stations +in ascolto|listening +profilo Internet sospeso|Internet profile suspended +dati BPQ|BPQ data +CPU sistema|System CPU +traffico BPQ TX RX|BPQ TX RX traffic +cronologia|history +Invio per inviare|Enter to send +Auto · Sistema|Auto · System +Account sysop configurato non trovato|Configured sysop account not found +Timeout BPQ|BPQ timeout +WebMail BPQ non disponibile|BPQ WebMail unavailable +Lista messaggi BPQ non disponibile|BPQ message list unavailable +Messaggio troppo grande|Message too large +BBS non configurata|BBS not configured +Metadati BBS non disponibili|BBS metadata unavailable +Metadati BBS non ancora disponibili|BBS metadata not available yet +Messaggio non presente|Message not found +BPQ non ha confermato la cancellazione|BPQ did not confirm deletion +Messaggio troppo grande per il download web (32 MB)|Message too large for web download (32 MB) +Controlla destinatario, oggetto (max 80 caratteri) e testo (max 32 KB)|Check recipient, subject (max 80 characters) and text (max 32 KB) +BPQ non ha confermato il salvataggio. Controlla la lista prima di riprovare.|BPQ did not confirm saving. Check the list before trying again. +Host non autorizzato|Host not authorised +Origine non autorizzata|Origin not authorised +Troppi tentativi. Riprova tra 15 minuti.|Too many attempts. Try again in 15 minutes. +Credenziali BPQ non valide per il pannello sysop|Invalid BPQ credentials for the sysop dashboard +Accedi con le credenziali BPQ|Sign in with your BPQ credentials +Servizio non configurato in BPQ|Service not configured in BPQ +Sessione non valida. Ricarica la pagina.|Invalid session. Reload the page. +Porta Telnet BPQ non configurata|BPQ Telnet port not configured +Cursore non valido|Invalid cursor +Cursore monitor non valido|Invalid monitor cursor +Percorso di forwarding non configurato|Forwarding route not configured +Tipo di sincronizzazione non disponibile|Synchronisation type unavailable +Allegato non disponibile|Attachment unavailable +Questo file non ha anteprima testuale|This file has no text preview +Sincronizzazione già richiesta. Attendi qualche secondo.|Synchronisation already requested. Wait a few seconds. +Operazione non disponibile|Operation unavailable +Metodo non disponibile|Method unavailable +Pagina non trovata|Page not found +Seleziona almeno una frequenza configurata|Select at least one configured frequency +Controller radio non disponibile|Radio controller unavailable +Stato TX non valido|Invalid TX state +Profilo RMS non presente in BPQ|RMS profile missing in BPQ +Stato sessioni BBS non verificabile|BBS session status cannot be verified +Canale radio non valido|Invalid radio channel +Attendi la fine della sessione BBS prima di ripristinare Internet|Wait for the BBS session to end before restoring Internet +Una sessione Winlink radio è già in corso o in ripristino|A Winlink radio session is already running or being restored +Controllo frequenza CAT per Winlink radio non configurato|CAT frequency control for Winlink radio not configured +Modem impegnato: attendi la fine della connessione|Modem busy: wait for the connection to end +Telemetria radio non disponibile: impossibile verificare il modem|Radio telemetry unavailable: cannot check the modem +Sync Winlink già richiesto: attendi|Winlink sync already requested: please wait +Una sessione BBS è attiva: riprova al termine|A BBS session is active: retry when it ends +Il profilo RMS non è impostato per Internet: verifica la configurazione prima del cambio|The RMS profile is not set to Internet: check configuration before switching +Una sessione BBS è iniziata: riprova al termine|A BBS session has started: retry when it ends +Percorso manuale di forwarding non valido|Invalid manual forwarding route +Percorsi del controllo radio non validi|Invalid radio control paths +Percorso manuale non configurato|Manual route not configured +Un inoltro per questo partner è già in corso|Forwarding to this partner is already in progress +Partner BBS non configurato|BBS partner not configured +Radio non disponibile o impegnata|Radio unavailable or busy +Attendi la fine delle sessioni BBS|Wait for BBS sessions to end +Timeout di accesso chat|Chat sign-in timeout +Connettiti alla chat prima di scrivere|Connect to chat before writing +Scrivi un messaggio su una sola riga, massimo 500 caratteri|Write a single-line message, up to 500 characters +Nominativo non valido|Invalid callsign +Chat non connessa|Chat not connected +Nome stanza non valido|Invalid room name +Credenziali Telnet BPQ non disponibili|BPQ Telnet credentials unavailable +Accesso Telnet non confermato|Telnet sign-in not confirmed +Accesso rifiutato|Access denied +Collega prima il terminale|Connect the terminal first +Invia un solo comando, massimo 1000 caratteri|Send one command, up to 1000 characters +`; + const dictionary=new Map(entries.trim().split('\n').map(line=>line.split('|'))); + function resolveLanguage(preference='auto',languages=[]){ + if(preference==='it'||preference==='en')return preference; + // The first browser language is the user's preferred UI language; English is the fallback. + return /^it(?:-|$)/i.test(languages[0]||'')?'it':'en'; + } + let preference='auto',language='it'; + const patterns=[ + [/^Stazione \/ (.+)$/,m=>'Station / '+translate(m[1])], + [/^(\d+) bollettini · (\d+) personali$/,m=>m[1]+' bulletins · '+m[2]+' personal'], + [/^(\d+) (messaggi|messaggio ricevuto|messaggi ricevuti|destinazioni|sessioni|stazioni|nuovo messaggio|nuovi messaggi|nuovi bollettini scaricati|nuove mail ricevute|nella stanza|presenti|collegamenti nel periodo)$/,m=>m[1]+' '+({'messaggi':'messages','messaggio ricevuto':'message received','messaggi ricevuti':'messages received','destinazioni':'destinations','sessioni':'sessions','stazioni':'stations','nuovo messaggio':'new message','nuovi messaggi':'new messages','nuovi bollettini scaricati':'new bulletins downloaded','nuove mail ricevute':'new mail messages received','nella stanza':'in the room','presenti':'online','collegamenti nel periodo':'connections in this period'})[m[2]]], + [/^Aggiornato (.+)$/,m=>'Updated '+m[1]], + [/^(.+) · aggiornato (.+)$/,m=>m[1]+' · updated '+m[2]], + [/^Connettiti come (\S+) per partecipare alla chat\.$/,m=>'Connect as '+m[1]+' to join the chat.'], + [/^Connesso alla chat come (\S+)$/,m=>'Connected to chat as '+m[1]], + [/^Disconnesso dalla chat$/,()=> 'Disconnected from chat'], + [/^Connesso · (\S+)$/,m=>'Connected · '+m[1]], + [/^Messaggio privato a (.+)$/,m=>'Private message to '+m[1]], + [/^Privato · (.+)$/,m=>'Private · '+m[1]], + [/^(Dettagli|Dettagli stazione|Seleziona|Grafico) (.+)$/,m=>({'Dettagli':'Details','Dettagli stazione':'Station details','Seleziona':'Select','Grafico':'Chart'})[m[1]]+' '+m[2]], + [/^(Allegati) · (\d+)$/,m=>'Attachments · '+m[2]], + [/^Percorso di connessione · porta (\d+)$/,m=>'Connection route · port '+m[1]], + [/^Attiva · intervallo (.+)$/,m=>'Enabled · interval '+m[1]], + [/^Porta (\d+)$/,m=>'Port '+m[1]], + [/^Posizioni dai locator · orari (.+)$/,m=>'Positions from locators · times '+m[1]], + [/^Log disponibili dal (.+) · massimo 30 giorni · (.+)$/,m=>'Logs available since '+m[1]+' · up to 30 days · '+m[2]], + [/^(\d+) sulla mappa · (\d+) senza locator$/,m=>m[1]+' on map · '+m[2]+' without locator'], + [/^(\d+) km dal nodo$/,m=>m[1]+' km from node'], + [/^Locator salvato per (\S+)$/,m=>'Locator saved for '+m[1]], + [/^(\d+) canali? · (\d+) gateway$/,m=>m[1]+' '+(m[1]==='1'?'channel':'channels')+' · '+m[2]+' gateways'], + [/^(\d+) frame · (\d+) in memoria( · visualizzazione in pausa)?$/,m=>m[1]+' frames · '+m[2]+' in memory'+(m[3]?' · display paused':'')], + [/^Messaggio #(\d+) salvato nella BBS\. L’inoltro sarà gestito da BPQ\.$/,m=>'Message #'+m[1]+' saved in the BBS. BPQ will handle forwarding.'], + [/^Messaggio #(\d+) eliminato da BPQ$/,m=>'Message #'+m[1]+' deleted from BPQ'], + [/^(Aggiornamento BPQ in attesa|Ripristino del percorso dopo errore|Diario non disponibile): (.+)$/,m=>({'Aggiornamento BPQ in attesa':'BPQ update pending','Ripristino del percorso dopo errore':'Restoring route after error','Diario non disponibile':'Logbook unavailable'})[m[1]]+': '+translate(m[2])], + [/^Stessa coda e stesse regole del partner (\S+)\. Nessun timer automatico per questo percorso\. (.+)$/,m=>'Same queue and rules as partner '+m[1]+'. No automatic timer for this route. '+translate(m[2])], + ]; + function translate(text){ + if(dictionary.has(text))return dictionary.get(text); + for(const [pattern,render]of patterns){const match=text.match(pattern);if(match)return render(match);} + if(text.includes(' · '))return text.split(' · ').map(translate).join(' · '); + return text; + } + function t(value){ + const text=String(value??'');if(language!=='en')return text; + // Preserve indentation and decorative icons, which often live in the same text node. + const match=text.match(/^(\s*[●◇◎+↻↩⇄◉↓↑]*\s*)(.*?)(\s*[→↗↓↵]*\s*)$/s); + return match?match[1]+translate(match[2])+match[3]:translate(text); + } + const api={t,resolveLanguage,get language(){return language},get preference(){return preference},locale:()=>language==='it'?'it-IT':'en-GB'}; + globalThis.BPQI18n=api; + if(typeof document==='undefined')return; + try{const saved=localStorage.getItem('bpq-language');if(['it','en','auto'].includes(saved))preference=saved;}catch{} + const browserLanguages=()=>navigator.languages?.length?navigator.languages:[navigator.language]; + language=resolveLanguage(preference,browserLanguages());document.documentElement.lang=language; + const originals=new WeakMap(),attributes=new WeakMap(); + // These are user/protocol data, never interface copy. Do not translate their labels or contents. + const protectedContent='script,style,textarea,pre,code,[contenteditable],[data-no-i18n],.reader-body,.mail-subject,.mail-from,.mail-category,.reader-header h2,.reader-meta b,.chat-message-content p,.chat-message-meta strong,.chat-user-name,.chat-user b,.chat-user small,.room-button,#chat-room-name,.attachment-row b,#attachment-title,#delete-subject,.arrival-toast small,.side-station,.profile>div,.mission-heading h1,.mission-location,.modem-brand,#caller-call,#called-call,.service-call,#nodes,.wl-account,#wl-gateway-rows td:nth-child(2),#category option:not([value]),#terminal-output,.monitor-frame'; + function excluded(el){return !el||!!el.closest(protectedContent);} + function textNode(node){ + if(excluded(node.parentElement))return; + let entry=originals.get(node); + if(!entry||node.nodeValue!==entry.rendered)entry={source:node.nodeValue,rendered:null}; + const rendered=t(entry.source);entry.rendered=rendered;originals.set(node,entry); + if(node.nodeValue!==rendered)node.nodeValue=rendered; + } + function element(el){ + if(excluded(el))return; + for(const name of ['title','placeholder','aria-label']){ + if(name==='title'&&el.matches('.mail-row,.chat-user'))continue; + if(!el.hasAttribute(name))continue; + const stored=attributes.get(el)||{};let entry=stored[name],value=el.getAttribute(name); + if(!entry||value!==entry.rendered)entry={source:value,rendered:null}; + const rendered=t(entry.source);entry.rendered=rendered;stored[name]=entry;attributes.set(el,stored); + if(value!==rendered)el.setAttribute(name,rendered); + } + } + function apply(root=document.body){ + if(!root)return; + if(root.nodeType===3){textNode(root);return;} + if(root.nodeType!==1)return; + element(root);const walker=document.createTreeWalker(root,NodeFilter.SHOW_ELEMENT|NodeFilter.SHOW_TEXT); + let node;while((node=walker.nextNode())){if(node.nodeType===3)textNode(node);else element(node);} + } + let observer; + function observe(){observer.observe(document.body,{subtree:true,childList:true,characterData:true,attributes:true,attributeFilter:['title','placeholder','aria-label']});} + function syncControls(){document.querySelectorAll('[data-language-select]').forEach(select=>{select.value=preference;});} + api.setLanguage=value=>{ + if(!['auto','it','en'].includes(value))return; + preference=value;try{localStorage.setItem('bpq-language',value);}catch{} + language=resolveLanguage(value,browserLanguages());document.documentElement.lang=language; + observer?.disconnect();apply();syncControls();if(observer)observe(); + document.dispatchEvent(new CustomEvent('bpq-languagechange',{detail:{language,preference}})); + }; + globalThis.bpqConfirm=message=>globalThis.confirm(t(message)); + globalThis.bpqPrompt=(message,defaultValue='')=>globalThis.prompt(t(message),defaultValue); + function mount(){ + const picker=place=>{const label=document.createElement('label');label.className='language-picker '+place;label.innerHTML='';label.querySelector('select').onchange=e=>api.setLanguage(e.target.value);return label;}; + document.querySelector('.login-card')?.append(picker('language-login')); + document.querySelector('.topbar > div')?.prepend(picker('language-toolbar')); + syncControls();apply();observer=new MutationObserver(records=>{ + observer.disconnect();const roots=new Set(); + for(const r of records){if(r.type==='childList')for(const child of r.addedNodes)roots.add(child);else roots.add(r.target);} + for(const root of roots)if(root.isConnected)apply(root);observe(); + });observe(); + } + if(document.readyState==='loading')document.addEventListener('DOMContentLoaded',mount,{once:true});else mount(); + globalThis.addEventListener('languagechange',()=>{if(preference==='auto')api.setLanguage('auto');}); +})(); diff --git a/public/index.html b/public/index.html index 8bbc4a6..3b01178 100644 --- a/public/index.html +++ b/public/index.html @@ -1,5 +1,5 @@ -BPQ Console +BPQ Console

BPQ Console

La tua stazione, in un unico pannello.

BPQ Console

Benvenuto in stazione.

Accedi con l’utente e la password Telnet del tuo BPQ.

Created by IU2EUG · PC e rete locale