From 61066fa4694a9452d1e12e26065b8466af1f229e Mon Sep 17 00:00:00 2001 From: HB9HIL Date: Wed, 19 Nov 2025 14:08:56 +0100 Subject: [PATCH 1/3] [fix] use html instead text to properly show html encoded translations --- application/views/bandmap/list.php | 2 +- assets/js/sections/bandmap_list.js | 46 +++++++++++++++--------------- 2 files changed, 24 insertions(+), 24 deletions(-) diff --git a/application/views/bandmap/list.php b/application/views/bandmap/list.php index 689554314..7175949a2 100644 --- a/application/views/bandmap/list.php +++ b/application/views/bandmap/list.php @@ -246,7 +246,7 @@ document.addEventListener('DOMContentLoaded', function() { var isMac = navigator.platform.toUpperCase().indexOf('MAC') >= 0; var modKey = isMac ? 'Cmd' : 'Ctrl'; - document.getElementById('filterTipText').textContent = ' ' + modKey + ' '; + document.getElementById('filterTipText').innerHTML = ' ' + modKey + ' '; });
diff --git a/assets/js/sections/bandmap_list.js b/assets/js/sections/bandmap_list.js index 853bda384..5cf9e4b6f 100644 --- a/assets/js/sections/bandmap_list.js +++ b/assets/js/sections/bandmap_list.js @@ -369,14 +369,14 @@ $(function() { let originalText = $option.data('original-text'); if (!originalText) { - originalText = $option.text(); + originalText = $option.html(); $option.data('original-text', originalText); } if ($option.is(':selected')) { - $option.text('☑ ' + originalText); + $option.html('☑ ' + originalText); } else { - $option.text('☐ ' + originalText); + $option.html('☐ ' + originalText); } }); } @@ -461,7 +461,7 @@ $(function() { retrieve: true, language: { url: getDataTablesLanguageUrl(), - "emptyTable": " Loading spots...", + "emptyTable": " " + lang_bandmap_loading_spots, "zeroRecords": lang_bandmap_no_spots_found }, 'columnDefs': [ @@ -535,13 +535,13 @@ $(function() { let callsignHtml = rowData[5]; // Callsign is column 6 (0-indexed = 5) let tempDiv = $('
').html(callsignHtml); - let call = tempDiv.find('a').text().trim(); + let call = tempDiv.find('a').html().trim(); if (!call) return; let qrg = parseFloat(rowData[2]) * 1000000; // Frequency in MHz, convert to Hz let modeHtml = rowData[3]; // Mode is column 4 (0-indexed = 3) let modeDiv = $('
').html(modeHtml); - let mode = modeDiv.text().trim(); // Extract clean mode text from HTML + let mode = modeDiv.html().trim(); // Extract clean mode text from HTML // Ctrl+click: Only tune radio, don't prepare logging form if (e.ctrlKey || e.metaKey) { @@ -657,17 +657,17 @@ $(function() { loadingMessage += '...'; } - $('#statusMessage').text(loadingMessage).attr('title', ''); + $('#statusMessage').html(loadingMessage).attr('title', ''); $('#statusFilterInfo').remove(); $('#refreshIcon').removeClass('fa-hourglass-half').addClass('fa-spinner fa-spin'); - $('#refreshTimer').text(''); + $('#refreshTimer').html(''); return; } if (lastFetchParams.timestamp === null) { - $('#statusMessage').text(''); + $('#statusMessage').html(''); $('#statusFilterInfo').remove(); - $('#refreshTimer').text(''); + $('#refreshTimer').html(''); return; } @@ -709,7 +709,7 @@ $(function() { fetchTooltipLines.push(`${lang_bandmap_fetched_at}: ${h}:${m}:${s}Z`); } - $('#statusMessage').text(statusMessage).attr('title', fetchTooltipLines.join('\n')); + $('#statusMessage').html(statusMessage).attr('title', fetchTooltipLines.join('\n')); // Add info icon if filters are active (with separate tooltip for active filters) $('#statusFilterInfo').remove(); @@ -720,10 +720,10 @@ $(function() { if (isFetching) { $('#refreshIcon').removeClass('fa-hourglass-half').addClass('fa-spinner fa-spin'); - $('#refreshTimer').text(lang_bandmap_fetching); + $('#refreshTimer').html(lang_bandmap_fetching); } else { $('#refreshIcon').removeClass('fa-spinner fa-spin').addClass('fa-hourglass-half'); - $('#refreshTimer').text(lang_bandmap_next_update + ' ' + refreshCountdown + 's'); + $('#refreshTimer').html(lang_bandmap_next_update + ' ' + refreshCountdown + 's'); } } function getDisplayedSpotCount() { var table = get_dtable(); @@ -758,7 +758,7 @@ $(function() { } else { if (!isFetchInProgress && lastFetchParams.timestamp !== null) { $('#refreshIcon').removeClass('fa-spinner fa-spin').addClass('fa-hourglass-half'); - $('#refreshTimer').text(lang_bandmap_next_update + ' ' + refreshCountdown + 's'); + $('#refreshTimer').html(lang_bandmap_next_update + ' ' + refreshCountdown + 's'); } } }, 1000); @@ -1304,7 +1304,7 @@ $(function() { let actualDisplayedCount = table.rows({search: 'applied'}).count(); updateStatusBar(cachedSpotData.length, actualDisplayedCount, getServerFilterText(), getClientFilterText(), false, false); $('#refreshIcon').removeClass('fa-spinner fa-spin').addClass('fa-hourglass-half'); - $('#refreshTimer').text(lang_bandmap_next_update + ' ' + refreshCountdown + 's'); + $('#refreshTimer').html(lang_bandmap_next_update + ' ' + refreshCountdown + 's'); } // Update DX Map only if visible (don't waste resources) @@ -1331,9 +1331,9 @@ $(function() { // Clear all badges when no data if (fetchedBand) { // Set all to "-" when in single band fetch mode but no data - $('.band-count-badge, .mode-count-badge').text('-'); + $('.band-count-badge, .mode-count-badge').html('-'); } else { - $('.band-count-badge, .mode-count-badge').text('0'); + $('.band-count-badge, .mode-count-badge').html('0'); } return; } @@ -1496,7 +1496,7 @@ $(function() { $('#toggle' + band + 'Filter').append(' ' + displayText + ''); domCache.badges[selector] = $('#toggle' + band + 'Filter .band-count-badge'); } else { - $badge.text(displayText); + $badge.html(displayText); } }); @@ -1510,7 +1510,7 @@ $(function() { $('#toggle' + group + 'Filter').append(' ' + displayText + ''); domCache.badges[selector] = $('#toggle' + group + 'Filter .band-count-badge'); } else { - $badge.text(displayText); + $badge.html(displayText); } }); // Update mode button badges ['Cw', 'Digi', 'Phone'].forEach(mode => { @@ -1521,7 +1521,7 @@ $(function() { $('#toggle' + mode + 'Filter').append(' ' + count + ''); domCache.badges[selector] = $('#toggle' + mode + 'Filter .mode-count-badge'); } else { - $badge.text(count); + $badge.html(count); } }); @@ -1596,7 +1596,7 @@ $(function() { $('#' + filter.id).append(' ' + filter.count + ''); } else { // Update existing badge - $badge.text(filter.count); + $badge.html(filter.count); } }); } @@ -3485,7 +3485,7 @@ $(function() { const spotTime = parseInt($(this).attr('data-spot-time')); if (spotTime) { const ageMinutes = Math.floor((now - spotTime) / 60000); - $(this).text(ageMinutes); + $(this).html(ageMinutes); } }); } @@ -3776,7 +3776,7 @@ $(function() { // Find row with matching callsign const row = table.rows().nodes().toArray().find(node => { - const callsignCell = $(node).find('td:eq(4)').text(); + const callsignCell = $(node).find('td:eq(4)').html(); return callsignCell.includes(callsign); }); From d84c2d9b948da39803fa8a0bc43f0ea8ea810d4f Mon Sep 17 00:00:00 2001 From: HB9HIL Date: Wed, 19 Nov 2025 14:21:17 +0100 Subject: [PATCH 2/3] fixed missing translation in html --- assets/js/sections/bandmap_list.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/assets/js/sections/bandmap_list.js b/assets/js/sections/bandmap_list.js index 5cf9e4b6f..59cd2422f 100644 --- a/assets/js/sections/bandmap_list.js +++ b/assets/js/sections/bandmap_list.js @@ -1087,7 +1087,7 @@ $(function() { // Submode column: show submode if available let submode = (single.submode && single.submode !== '') ? single.submode : ''; data[0].push(submode); // Callsign column: wrap in QRZ link with color coding - let qrzLink = '' + single.spotted + ''; + let qrzLink = '' + single.spotted + ''; wked_info = ((wked_info != '' ? '' : '') + qrzLink + (wked_info != '' ? '' : '')); var spotted = wked_info; data[0].push(spotted); From 6f320c6161bdebe94a0fda8a9851e9ff92e3b7f7 Mon Sep 17 00:00:00 2001 From: phl0 Date: Wed, 19 Nov 2025 14:33:39 +0100 Subject: [PATCH 3/3] Fix HTML encoded translations in users section --- application/views/user/modals/more_actions_modal.php | 8 ++++---- assets/js/sections/user.js | 6 +++--- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/application/views/user/modals/more_actions_modal.php b/application/views/user/modals/more_actions_modal.php index da5c44181..9bf172cee 100644 --- a/application/views/user/modals/more_actions_modal.php +++ b/application/views/user/modals/more_actions_modal.php @@ -85,8 +85,8 @@
- \ No newline at end of file + diff --git a/assets/js/sections/user.js b/assets/js/sections/user.js index c74de4105..1669affa9 100644 --- a/assets/js/sections/user.js +++ b/assets/js/sections/user.js @@ -83,17 +83,17 @@ function convert_user(user_id, convert_to) { }, success: function(result) { if (result) { - $('#user_converted_message').show().text(lang_account_conversion_processed).addClass('alert-success'); + $('#user_converted_message').show().html(lang_account_conversion_processed).addClass('alert-success'); $('#convert_user_btn').removeClass('running btn-danger').addClass('btn-secondary'); $('#user_converted').show().addClass('fa-check text-success'); } else { - $('#user_converted_message').show().text(lang_account_conversion_failed).addClass('alert-danger'); + $('#user_converted_message').show().html(lang_account_conversion_failed).addClass('alert-danger'); $('#convert_user_btn').prop('disabled', false).removeClass('running'); $('#user_converted').show().addClass('fa-times text-danger'); } }, error: function() { - $('#user_converted_message').show().text(lang_account_conversion_failed).addClass('alert-danger'); + $('#user_converted_message').show().html(lang_account_conversion_failed).addClass('alert-danger'); $('#convert_user_btn').prop('disabled', false).removeClass('running'); $('#user_converted').show().addClass('fa-times text-danger'); }