More translatable strings in the UI

This commit is contained in:
Bill Somerville 2020-05-19 12:15:58 +01:00
parent 75c4dca87c
commit e43cb59bd0
No known key found for this signature in database
GPG Key ID: D864B06D1E81618F
2 changed files with 22 additions and 23 deletions

View File

@ -201,7 +201,7 @@ int main(int argc, char *argv[])
auto language = parser.value (lang_option).replace ('-', '_');
if (translation_override_from_resources.load ("wsjtx_" + language , ":/Translations"))
{
qDebug () << QString {"loaded translation file :/Translations/wsjtx_%1.qm"}.arg (language);
qDebug () << QString {"loaded translation file from :/Translations based on language %1"}.arg (language);
a.installTranslator (&translation_override_from_resources);
}
}
@ -233,7 +233,7 @@ int main(int argc, char *argv[])
auto language = parser.value (lang_option).replace ('-', '_');
if (translation_override_from_files.load ("wsjtx_" + language))
{
qDebug () << QString {"loaded translation file $cwd/wsjtx_%1.qm"}.arg (language);
qDebug () << QString {"loaded translation file from $cwd based on language %1"}.arg (language);
a.installTranslator (&translation_override_from_files);
}
}

View File

@ -326,7 +326,7 @@ MainWindow::MainWindow(QDir const& temp_directory, bool multiple,
m_nsendingsh {0},
m_onAirFreq0 {0.0},
m_first_error {true},
tx_status_label {"Receiving"},
tx_status_label {tr ("Receiving")},
wsprNet {new WSPRNet {&m_network_manager, this}},
m_appDir {QApplication::applicationDirPath ()},
m_cqStr {""},
@ -820,7 +820,7 @@ MainWindow::MainWindow(QDir const& temp_directory, bool multiple,
ui->labAz->setStyleSheet("border: 0px;");
ui->labAz->setText("");
auto t = "UTC dB DT Freq Message";
auto t = "UTC dB DT Freq " + tr ("Message");
ui->decodedTextLabel->setText(t);
ui->decodedTextLabel2->setText(t);
readSettings(); //Restore user's setup parameters
@ -4110,12 +4110,11 @@ void MainWindow::guiUpdate()
} else if(m_monitoring) {
if (!m_tx_watchdog) {
tx_status_label.setStyleSheet("QLabel{background-color: #00ff00}");
QString t;
t="Receiving";
auto t = tr ("Receiving");
if(m_mode=="MSK144") {
int npct=int(100.0*m_fCPUmskrtd/0.298667);
if(npct>90) tx_status_label.setStyleSheet("QLabel{background-color: #ff0000}");
t = t.asprintf("Receiving %2d%%",npct);
t += QString {" %1%"}.arg (npct, 2);
}
tx_status_label.setText (t);
}
@ -5783,13 +5782,13 @@ void MainWindow::on_actionFT4_triggered()
// ui->cbAutoSeq->setChecked(false);
m_fastGraph->hide();
m_wideGraph->show();
ui->decodedTextLabel2->setText(" UTC dB DT Freq Message");
ui->decodedTextLabel2->setText(" UTC dB DT Freq " + tr ("Message"));
m_wideGraph->setPeriod(m_TRperiod,m_nsps);
m_modulator->setTRPeriod(m_TRperiod); // TODO - not thread safe
m_detector->setTRPeriod(m_TRperiod); // TODO - not thread safe
ui->label_7->setText(tr ("Rx Frequency"));
ui->label_6->setText(tr ("Band Activity"));
ui->decodedTextLabel->setText( " UTC dB DT Freq Message");
ui->decodedTextLabel->setText( " UTC dB DT Freq " + tr ("Message"));
displayWidgets(nWidgets("111010000100111000010000000110001"));
ui->txrb2->setEnabled(true);
ui->txrb4->setEnabled(true);
@ -5827,7 +5826,7 @@ void MainWindow::on_actionFT8_triggered()
m_TRperiod=15.0;
m_fastGraph->hide();
m_wideGraph->show();
ui->decodedTextLabel2->setText(" UTC dB DT Freq Message");
ui->decodedTextLabel2->setText(" UTC dB DT Freq " + tr ("Message"));
m_wideGraph->setPeriod(m_TRperiod,m_nsps);
m_modulator->setTRPeriod(m_TRperiod); // TODO - not thread safe
m_detector->setTRPeriod(m_TRperiod); // TODO - not thread safe
@ -5837,7 +5836,7 @@ void MainWindow::on_actionFT8_triggered()
ui->decodedTextLabel->setText( "Call Grid dB Freq Dist Age Continent");
} else {
ui->label_6->setText(tr ("Band Activity"));
ui->decodedTextLabel->setText( " UTC dB DT Freq Message");
ui->decodedTextLabel->setText( " UTC dB DT Freq " + tr ("Message"));
}
displayWidgets(nWidgets("111010000100111000010000100110001"));
ui->txrb2->setEnabled(true);
@ -5934,8 +5933,8 @@ void MainWindow::on_actionJT4_triggered()
ui->sbSubmode->setMaximum(6);
ui->label_6->setText(tr ("Single-Period Decodes"));
ui->label_7->setText(tr ("Average Decodes"));
ui->decodedTextLabel->setText("UTC dB DT Freq Message");
ui->decodedTextLabel2->setText("UTC dB DT Freq Message");
ui->decodedTextLabel->setText("UTC dB DT Freq " + tr ("Message"));
ui->decodedTextLabel2->setText("UTC dB DT Freq " + tr ("Message"));
if(bVHF) {
ui->sbSubmode->setValue(m_nSubMode);
} else {
@ -5983,13 +5982,13 @@ void MainWindow::on_actionJT9_triggered()
m_fastGraph->show();
ui->TxFreqSpinBox->setValue(700);
ui->RxFreqSpinBox->setValue(700);
ui->decodedTextLabel->setText("UTC dB T Freq Message");
ui->decodedTextLabel2->setText("UTC dB T Freq Message");
ui->decodedTextLabel->setText("UTC dB T Freq " + tr ("Message"));
ui->decodedTextLabel2->setText("UTC dB T Freq " + tr ("Message"));
} else {
ui->cbAutoSeq->setChecked(false);
m_TRperiod=60.0;
ui->decodedTextLabel->setText("UTC dB DT Freq Message");
ui->decodedTextLabel2->setText("UTC dB DT Freq Message");
ui->decodedTextLabel->setText("UTC dB DT Freq " + tr ("Message"));
ui->decodedTextLabel2->setText("UTC dB DT Freq " + tr ("Message"));
}
m_wideGraph->setPeriod(m_TRperiod,m_nsps);
m_modulator->setTRPeriod(m_TRperiod); // TODO - not thread safe
@ -6036,8 +6035,8 @@ void MainWindow::on_actionJT9_JT65_triggered()
ui->sbSubmode->setValue(0);
ui->label_6->setText(tr ("Band Activity"));
ui->label_7->setText(tr ("Rx Frequency"));
ui->decodedTextLabel->setText("UTC dB DT Freq Message");
ui->decodedTextLabel2->setText("UTC dB DT Freq Message");
ui->decodedTextLabel->setText("UTC dB DT Freq " + tr ("Message"));
ui->decodedTextLabel2->setText("UTC dB DT Freq " + tr ("Message"));
displayWidgets(nWidgets("111010000001111000010000000000001"));
fast_config(false);
statusChanged();
@ -6202,8 +6201,8 @@ void MainWindow::on_actionMSK144_triggered()
ui->RxFreqSpinBox->setMinimum(1400);
ui->RxFreqSpinBox->setMaximum(1600);
ui->RxFreqSpinBox->setSingleStep(10);
ui->decodedTextLabel->setText("UTC dB T Freq Message");
ui->decodedTextLabel2->setText("UTC dB T Freq Message");
ui->decodedTextLabel->setText("UTC dB T Freq " + tr ("Message"));
ui->decodedTextLabel2->setText("UTC dB T Freq " + tr ("Message"));
m_modulator->setTRPeriod(m_TRperiod); // TODO - not thread safe
m_detector->setTRPeriod(m_TRperiod); // TODO - not thread safe
m_fastGraph->setTRPeriod(m_TRperiod);
@ -6388,7 +6387,7 @@ void MainWindow::WSPR_config(bool b)
}
m_bSimplex = true;
} else {
ui->decodedTextLabel->setText("UTC dB DT Freq Message");
ui->decodedTextLabel->setText("UTC dB DT Freq " + tr ("Message"));
m_bSimplex = false;
}
enable_DXCC_entity (m_config.DXCC ()); // sets text window proportions and (re)inits the logbook
@ -7625,7 +7624,7 @@ void MainWindow::p1ReadFromStdout() //p1readFromStdout
if(!m_diskData) {
WSPR_history(m_dialFreqRxWSPR, m_nWSPRdecodes);
if(m_nWSPRdecodes==0 and ui->band_hopping_group_box->isChecked()) {
t = " Receiving " + m_mode + " ----------------------- " +
t = " " + tr ("Receiving") + " " + m_mode + " ----------------------- " +
m_config.bands ()->find (m_dialFreqRxWSPR);
t=WSPR_hhmm(-60) + ' ' + t.rightJustified (66, '-');
ui->decodedTextBrowser->appendText(t);