Support multiple sysops and bulletin comments; complete UI translations
Allow native SYSOP accounts to sign in independently, with an optional sysopUsers allow-list and isolated browser sessions. Keep station services on the configured service account. Add public bulletin comments that preserve category and distribution, alongside private replies to the author. Complete APRS and dynamic status translations and handle decorated button labels correctly. Document configuration and reply behavior. Add authentication, installer, bulletin reply and translation regression coverage.
This commit is contained in:
1 parent
33f1294405
commit
2ef3c25eb3
16 files changed
+298
-23
No files matched your search
+79
-4
@@ -4,6 +4,9 @@
|
||||
const entries=`
|
||||
Dal|Since
|
||||
Dettagli del registro|Log details
|
||||
Commenta|Comment
|
||||
Pubblica un commento come bollettino|Post a comment as a bulletin
|
||||
Rispondi all’autore con un messaggio personale|Reply privately to the author
|
||||
Seleziona un messaggio|Select a message
|
||||
Mappa delle stazioni|Station map
|
||||
Seleziona un collegamento|Select a connection
|
||||
@@ -707,7 +710,63 @@ Configurazione APRS applicata|APRS configuration applied
|
||||
Configurato · lascia vuoto per mantenerlo|Configured · leave blank to keep it
|
||||
Non configurato|Not configured
|
||||
Stazione / APRS|Station / APRS`;
|
||||
const dictionary=new Map((entries+'\n'+uploadCopy+'\n'+sizeCopy+'\n'+deleteCopy+'\n'+portCopy+'\n'+aprsCopy).split(/\r?\n/).map(line=>line.split('|')).filter(([source,target])=>source?.trim()&&typeof target==='string'&&target.trim()));
|
||||
const liveCopy=`Attività|Activity
|
||||
Configurazione|Configuration
|
||||
Viste APRS|APRS views
|
||||
Origine APRS|APRS source
|
||||
Direzione APRS|APRS direction
|
||||
Cerca APRS|Search APRS
|
||||
Mappa stazioni APRS|APRS station map
|
||||
Pausa vista|Pause display
|
||||
Riprendi vista|Resume display
|
||||
Vista in pausa|Display paused
|
||||
APRS in tempo reale|Live APRS
|
||||
Stazioni ricevute|Heard stations
|
||||
Centra stazioni|Fit stations
|
||||
La tua stazione|Your station
|
||||
Ultime ricezioni|Recently heard
|
||||
Traffico APRS|APRS traffic
|
||||
Da → A|From → To
|
||||
Tipo / pacchetto|Type / packet
|
||||
Senza posizione|No position
|
||||
senza posizione|without position
|
||||
sulla mappa|on map
|
||||
Nessuna stazione ricevuta con questi filtri.|No stations match these filters.
|
||||
In attesa di pacchetti APRS ricevuti o inviati.|Waiting for received or transmitted APRS packets.
|
||||
Posizione|Position
|
||||
Oggetto APRS|APRS object
|
||||
Meteo|Weather
|
||||
Telemetria|Telemetry
|
||||
Messaggio inoltrato|Forwarded message
|
||||
Richiesta|Request
|
||||
pacchetti nel registro|packets in the log
|
||||
Ultimi 2000 pacchetti · TX radio = richieste registrate da BPQ.|Last 2000 packets · Radio TX = requests logged by BPQ.
|
||||
Log Internet non disponibile|Internet log unavailable
|
||||
Aggiornato|Updated
|
||||
Salva|Save
|
||||
BBS & messaggi|BBS & messages
|
||||
messaggi|messages
|
||||
messaggio ricevuto|message received
|
||||
messaggi ricevuti|messages received
|
||||
destinazioni|destinations
|
||||
stazioni|stations
|
||||
stazione locale|local station
|
||||
in ascolto|listening
|
||||
— messaggi|— messages
|
||||
— presenti|— online
|
||||
Scrivi un messaggio…|Write a message…
|
||||
BBS / STAZIONE|BBS / STATION
|
||||
Il messaggio sarà salvato nella BBS come STAZIONE. L’inoltro segue le rotte configurate in BPQ.|The message will be saved in the station BBS. BPQ handles forwarding using its configured routes.
|
||||
Chiamata radio verso il nodo remoto avviata|Radio call to the remote node started
|
||||
il nodo remoto si è collegato alla nostra BBS|the remote node connected to our BBS
|
||||
Ricevuto e salvato un nuovo bollettino|New bulletin received and saved
|
||||
Servizio|Service
|
||||
Connessione UTC|Connection UTC
|
||||
Messaggi TX|Messages TX
|
||||
Messaggi RX|Messages RX
|
||||
CRC verificati|CRCs verified
|
||||
Sync automatico gestito dalla console.|Automatic sync managed by the console.`;
|
||||
const dictionary=new Map((entries+'\n'+uploadCopy+'\n'+sizeCopy+'\n'+deleteCopy+'\n'+portCopy+'\n'+aprsCopy+'\n'+liveCopy).split(/\r?\n/).map(line=>line.split('|')).filter(([source,target])=>source?.trim()&&typeof target==='string'&&target.trim()));
|
||||
function resolveLanguage(preference=null,languages=[]){
|
||||
if(preference==='it'||preference==='en')return preference;
|
||||
// The first browser language is the user's preferred UI language; English is the fallback.
|
||||
@@ -732,8 +791,23 @@ Stazione / APRS|Station / APRS`;
|
||||
[/^Attiva · intervallo (.+)$/,m=>'Enabled · interval '+m[1]],
|
||||
[/^Porta (\d+)$/,m=>'Port '+m[1]],
|
||||
[/^Posizioni dai locator · orari (.+)$/,m=>'Positions from locators · times '+m[1]],
|
||||
[/^Posizioni dai locator · (.+)$/,m=>'Positions from locators · '+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+) sulla mappa · (\d+) senza posizione$/,m=>m[1]+' on map · '+m[2]+' without position'],
|
||||
[/^(\d+) pacchetti nel registro$/,m=>m[1]+' packets in the log'],
|
||||
[/^Dal (.+)$/,m=>'Since '+m[1]],
|
||||
[/^Frequenza APRS Port (\d+)$/,m=>'APRS frequency port '+m[1]],
|
||||
[/^Frequenza FM: (.+)$/,m=>'FM frequency: '+m[1]],
|
||||
[/^(.+) · ultimo collegamento (.+)$/,m=>m[1]+' · last connection '+m[2]],
|
||||
[/^Sync automatico gestito dalla console\. (.+)$/,m=>'Automatic sync managed by the console. '+translate(m[1])],
|
||||
[/^Stessa coda e stesse regole del partner (\S+)\. Sync automatico gestito dalla console\. (.+)$/,m=>'Same queue and rules as partner '+m[1]+'. Automatic sync managed by the console. '+translate(m[2])],
|
||||
[/^(\d+) parti ricostruite$/,m=>m[1]+' reconstructed parts'],
|
||||
[/^Ricostruito da (\d+) parti$/,m=>'Rebuilt from '+m[1]+' parts'],
|
||||
[/^Ricostruzione completa · (\d+)\/(\d+) parti verificate\. Anteprima e download disponibili negli allegati\.$/,m=>'Reconstruction complete · '+m[1]+'/'+m[2]+' verified parts. Preview and download available in attachments.'],
|
||||
[/^Ricevute (\d+)\/(\d+) parti\. Mancano: ([\d, ]+)\.(?: Parti danneggiate: ([\d, ]+)\.)?$/,m=>'Received '+m[1]+'/'+m[2]+' parts. Missing: '+m[3]+'.'+(m[4]?' Damaged parts: '+m[4]+'.':'')],
|
||||
[/^Ricostruzione sospesa: dati incompleti o CRC non validi nelle parti ([\d, ]+)\.$/,m=>'Reconstruction suspended: incomplete data or invalid CRCs in parts '+m[1]+'.'],
|
||||
[/^Parte (\d+)\/(\d+)\. Nessun blocco 7plus riconoscibile nel messaggio\.$/,m=>'Part '+m[1]+'/'+m[2]+'. No recognisable 7plus block in the message.'],
|
||||
[/^(\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'],
|
||||
@@ -752,8 +826,9 @@ Stazione / APRS|Station / APRS`;
|
||||
}
|
||||
function t(value){
|
||||
const text=String(value??'');if(language!=='en')return text;
|
||||
const whole=text.match(/^(\s*)(.*?)(\s*)$/s);if(whole&&dictionary.has(whole[2]))return whole[1]+dictionary.get(whole[2])+whole[3];
|
||||
// Preserve indentation and decorative icons, which often live in the same text node.
|
||||
const match=text.match(/^(\s*[●◇◎+↻↩⇄◉↓↑]*\s*)(.*?)(\s*[→↗↓↵]*\s*)$/s);
|
||||
const match=text.match(/^(\s*(?:(?:▸_|[\p{S}\uFE0E\uFE0F])\s*)*)(.*?)(\s*(?:[\p{S}\uFE0E\uFE0F]\s*)*)$/su);
|
||||
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'};
|
||||
@@ -764,8 +839,8 @@ Stazione / APRS|Station / APRS`;
|
||||
language=resolveLanguage(preference||globalThis.BPQ_DEFAULT_LANGUAGE,browserLanguages());preference=language;try{localStorage.setItem('bpq-language',language);}catch{}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);}
|
||||
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,.aprs-packet-preview,.aprs-received-station p,.aprs-map-popup p,.aprs-map-popup b,.aprs-map-popup small';
|
||||
function excluded(el){if(!el)return true;if(el.matches('.routing-trace>summary,.sevenplus-original>summary'))return false;return !!el.closest(protectedContent);}
|
||||
function textNode(node){
|
||||
if(excluded(node.parentElement))return;
|
||||
let entry=originals.get(node);
|
||||
|
||||
Reference in new issue
Block a user