Skip to content

Commit

Permalink
i18n: Prop-modes are translated
Browse files Browse the repository at this point in the history
  • Loading branch information
foldynl committed Feb 27, 2024
1 parent df6d08b commit e553053
Show file tree
Hide file tree
Showing 7 changed files with 616 additions and 290 deletions.
3 changes: 2 additions & 1 deletion QLog.pro
Original file line number Diff line number Diff line change
Expand Up @@ -290,7 +290,8 @@ HEADERS += \
ui/WebEnginePage.h \
ui/WsjtxFilterDialog.h \
ui/WsjtxWidget.h \
i18n/dbstrings.tri
i18n/dbstrings.tri \
i18n/datastrings.tri

FORMS += \
ui/AlertRuleDetail.ui \
Expand Down
15 changes: 8 additions & 7 deletions data/Data.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -568,21 +568,22 @@ void Data::loadContests() {
}
}

void Data::loadPropagationModes() {
void Data::loadPropagationModes()
{
FCT_IDENTIFICATION;

QFile file(":/res/data/propagation_modes.json");
file.open(QIODevice::ReadOnly | QIODevice::Text);
QByteArray data = file.readAll();

auto objects = QJsonDocument::fromJson(data).toVariant().toList();
for (auto &object : qAsConst(objects))
{
QVariantMap propagationModeData = object.toMap();
const QList<QVariant> objects = QJsonDocument::fromJson(data).toVariant().toList();

QString id = propagationModeData.value("id").toString();
QString name = propagationModeData.value("name").toString();
for ( const QVariant &object : objects )
{
const QVariantMap &propagationModeData = object.toMap();

const QString &id = propagationModeData.value("id").toString();
const QString &name = tr(propagationModeData.value("name").toString().toUtf8().constData());
propagationModes.insert(id, name);
}
}
Expand Down
20 changes: 20 additions & 0 deletions i18n/datastrings.tri
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
QT_TRANSLATE_NOOP("Data", "Aircraft Scatte");
QT_TRANSLATE_NOOP("Data", "Aurora-E");
QT_TRANSLATE_NOOP("Data", "Aurora");
QT_TRANSLATE_NOOP("Data", "Back scatter");
QT_TRANSLATE_NOOP("Data", "EchoLink");
QT_TRANSLATE_NOOP("Data", "Earth-Moon-Earth");
QT_TRANSLATE_NOOP("Data", "Sporadic E");
QT_TRANSLATE_NOOP("Data", "F2 Reflection");
QT_TRANSLATE_NOOP("Data", "Field Aligned Irregularities");
QT_TRANSLATE_NOOP("Data", "Ground Wave");
QT_TRANSLATE_NOOP("Data", "Internet-assisted");
QT_TRANSLATE_NOOP("Data", "Ionoscatter");
QT_TRANSLATE_NOOP("Data", "IRLP");
QT_TRANSLATE_NOOP("Data", "Line of Sight");
QT_TRANSLATE_NOOP("Data", "Meteor scatter");
QT_TRANSLATE_NOOP("Data", "Terrestrial or atmospheric repeater or transponder");
QT_TRANSLATE_NOOP("Data", "Rain scatter");
QT_TRANSLATE_NOOP("Data", "Satellite");
QT_TRANSLATE_NOOP("Data", "Trans-equatorial");
QT_TRANSLATE_NOOP("Data", "Tropospheric ducting");
1 change: 1 addition & 0 deletions i18n/i18n.qrc
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,6 @@
<file>qlog_de.qm</file>
<file>qlog_cs.qm</file>
<file>qlog_zh_CN.qm</file>
<file>datastrings.tri</file>
</qresource>
</RCC>
Loading

0 comments on commit e553053

Please sign in to comment.