we can display the units directly to support gettext here

This commit is contained in:
HB9HIL
2024-07-05 22:13:49 +02:00
parent f437bcf052
commit 285cf73efe
3 changed files with 4 additions and 11 deletions

View File

@@ -20,7 +20,6 @@ class Band extends CI_Controller {
$this->load->model('bands');
$data['bands'] = $this->bands->get_all_bands_for_user();
$data['units'] = $this->frequency->QRG_UNITS;
// Render Page
$data['page_title'] = __("Bands");

View File

@@ -1,13 +1,6 @@
<?php if (!defined('BASEPATH')) exit('No direct script access allowed');
class Frequency {
public $QRG_UNITS = [
'Hz',
'kHz',
'MHz',
'GHz'
];
public $defaultFrequencies = array(
'160m' => array(
'SSB' => "1900000",

View File

@@ -95,9 +95,10 @@ $wwff = 0;
<td style="text-align: center; vertical-align: middle;" ><?php echo $band->cw;?></td>
<td style="text-align: center; vertical-align: middle;" class='band_<?php echo $band->id ?>'>
<select class="form-select unitselect" name="unit_<?php echo $band->id; ?>">
<?php foreach($units as $unit): ?>
<option value="<?php echo $unit; ?>" <?php if ($this->frequency->qrg_unit($band->band) == $unit) { echo 'selected';} ?>><?php echo $unit; ?></option>
<?php endforeach; ?>
<option value="Hz" <?php if ($this->frequency->qrg_unit($band->band) == 'Hz') { echo 'selected';} ?>><?= __("Hz"); ?></option>
<option value="kHz" <?php if ($this->frequency->qrg_unit($band->band) == 'kHz') { echo 'selected';} ?>><?= __("kHz"); ?></option>
<option value="MHz" <?php if ($this->frequency->qrg_unit($band->band) == 'MHz') { echo 'selected';} ?>><?= __("MHz"); ?></option>
<option value="GHz" <?php if ($this->frequency->qrg_unit($band->band) == 'GHz') { echo 'selected';} ?>><?= __("GHz"); ?></option>
</select>
</td>
<?php if($this->session->userdata('user_type') == '99') { ?>