timeplotter multilanguage support

This commit is contained in:
HB9HIL
2024-02-14 01:22:03 +01:00
parent ea22c537e9
commit d1ddb2a829
2 changed files with 23 additions and 16 deletions

View File

@@ -1,23 +1,30 @@
<script>
var lang_statistics_timeplotter_contacts_plotted = '<?php echo lang('statistics_timeplotter_contacts_plotted'); ?>';
var lang_statistics_timeplotter_chart_header = '<?php echo lang('statistics_timeplotter_chart_header'); ?>';
var lang_statistics_timeplotter_number_of_qsos = '<?php echo lang('statistics_timeplotter_number_of_qsos'); ?>';
var lang_general_word_time = '<?php echo lang('general_word_time'); ?>';
var lang_statistics_timeplotter_callsigns_worked = '<?php echo lang('statistics_timeplotter_callsigns_worked'); ?>';
</script>
<div class="container">
<h2><?php echo $page_title; ?></h1>
<p>The Timeplotter is used to analyze your logbook and find out when you have worked a certain CQ zone or DXCC on a chosen band.</p>
<h2><?php echo lang('menu_timeplotter'); ?></h1>
<p><?php echo lang('statistics_timeplotter_description'); ?></p>
<form class="form">
<div class="mb-3 row">
<label class="col-md-1 control-label" for="band">Band</label>
<label class="col-md-1 control-label" for="band"><?php echo lang('gen_hamradio_band'); ?></label>
<div class="col-md-3">
<select id="band" name="band" class="form-select">
<option value="All">All</option>
<option value="All"><?php echo lang('general_word_all'); ?></option>
<?php foreach($worked_bands as $band) {
echo '<option value="' . $band . '">' . $band . '</option>'."\n";
} ?>
</select>
</div>
<label class="col-md-1 control-label" for="dxcc">DXCC</label>
<label class="col-md-1 control-label" for="dxcc"><?php echo lang('gen_hamradio_dxcc'); ?></label>
<div class="col-md-3">
<select id="dxcc" name="dxcc" class="form-select">
<option value = 'All'>All</option>
<option value = 'All'><?php echo lang('general_word_all'); ?></option>
<?php
if ($dxcc_list->num_rows() > 0) {
foreach ($dxcc_list->result() as $dxcc) {
@@ -34,10 +41,10 @@
</div>
<div class="mb-3 row">
<label class="col-md-1 control-label" for="cqzone">CQ Zone</label>
<label class="col-md-1 control-label" for="cqzone"><?php echo lang('gen_hamradio_cq_zone'); ?></label>
<div class="col-md-3">
<select id="cqzone" name="cqzone" class="form-select">
<option value = 'All'>All</option>
<option value = 'All'><?php echo lang('general_word_all'); ?></option>
<?php
for ($i = 1; $i<=40; $i++) {
echo '<option value='. $i . '>'. $i .'</option>';
@@ -49,7 +56,7 @@
<div class="mb-3 row">
<div class="col-md-3">
<button id="button1id" type="button" name="button1id" class="btn btn-primary ld-ext-right" onclick="timeplot(this.form);">Show<div class="ld ld-ring ld-spin"></div></button>
<button id="button1id" type="button" name="button1id" class="btn btn-primary ld-ext-right" onclick="timeplot(this.form);"><?php echo lang('general_word_show'); ?><div class="ld ld-ring ld-spin"></div></button>
</div>
</div>

View File

@@ -26,7 +26,7 @@ function timeplot(form) {
function plotTimeplotterChart(tmp) {
$("#container").remove();
$("#info").remove();
$("#timeplotter_div").append('<p id="info">' + tmp.qsocount + ' contacts were plotted.</p><div id="container" style="height: 600px;"></div>');
$("#timeplotter_div").append('<p id="info">' + tmp.qsocount + ' ' + lang_statistics_timeplotter_contacts_plotted + '</p><div id="container" style="height: 600px;"></div>');
var color = ifDarkModeThemeReturn('white', 'grey');
var options = {
chart: {
@@ -36,7 +36,7 @@ function plotTimeplotterChart(tmp) {
backgroundColor: getBodyBackground()
},
title: {
text: 'Time Distribution',
text: lang_statistics_timeplotter_chart_header,
style: {
color: color
}
@@ -55,7 +55,7 @@ function plotTimeplotterChart(tmp) {
},
yAxis: {
title: {
text: '# QSOs',
text: lang_statistics_timeplotter_number_of_qsos,
style: {
color: color
}
@@ -72,9 +72,9 @@ function plotTimeplotterChart(tmp) {
tooltip: {
formatter: function () {
if(this.point) {
return "Time: " + options.xAxis.categories[this.point.x] +
"<br />Callsign(s) worked (max 5): " + myComments[this.point.x] +
"<br />Number of QSOs: <strong>" + series.data[this.point.x] + "</strong>";
return lang_general_word_time + ": " + options.xAxis.categories[this.point.x] +
"<br />" + lang_statistics_timeplotter_callsigns_worked + ": " + myComments[this.point.x] +
"<br />" + lang_statistics_timeplotter_number_of_qsos + ": <strong>" + series.data[this.point.x] + "</strong>";
}
}
},
@@ -94,7 +94,7 @@ function plotTimeplotterChart(tmp) {
$.each(tmp.qsodata, function(){
myComments.push(this.calls);
options.xAxis.categories.push(this.time);
series.name = 'Number of QSOs';
series.name = lang_statistics_timeplotter_number_of_qsos;
series.data.push(this.count);
});