From 21ff97b8c93f63644345c77914ad12c8b178e8b8 Mon Sep 17 00:00:00 2001 From: eFini Date: Fri, 26 Nov 2021 14:30:07 +0800 Subject: [PATCH] UI: minor changes to make it translation friendly (#23032) --- selfdrive/ui/qt/home.cc | 2 +- selfdrive/ui/qt/offroad/onboarding.cc | 2 +- selfdrive/ui/qt/widgets/ssh_keys.cc | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/selfdrive/ui/qt/home.cc b/selfdrive/ui/qt/home.cc index 5484c5d743..1e89264952 100644 --- a/selfdrive/ui/qt/home.cc +++ b/selfdrive/ui/qt/home.cc @@ -178,6 +178,6 @@ void OffroadHome::refresh() { update_notif->setVisible(updateAvailable); alert_notif->setVisible(alerts); if (alerts) { - alert_notif->setText(QString::number(alerts) + " ALERT" + (alerts > 1 ? "S" : "")); + alert_notif->setText(QString::number(alerts) + (alerts > 1 ? " ALERTS" : " ALERT")); } } diff --git a/selfdrive/ui/qt/offroad/onboarding.cc b/selfdrive/ui/qt/offroad/onboarding.cc index aa03ac63db..e6593f7679 100644 --- a/selfdrive/ui/qt/offroad/onboarding.cc +++ b/selfdrive/ui/qt/offroad/onboarding.cc @@ -145,7 +145,7 @@ void DeclinePage::showEvent(QShowEvent *event) { QObject::connect(back_btn, &QPushButton::clicked, this, &DeclinePage::getBack); - QPushButton *uninstall_btn = new QPushButton("Decline, uninstall " + getBrand()); + QPushButton *uninstall_btn = new QPushButton(QString("Decline, uninstall %1").arg(getBrand())); uninstall_btn->setStyleSheet("background-color: #B73D3D"); buttons->addWidget(uninstall_btn); QObject::connect(uninstall_btn, &QPushButton::clicked, [=]() { diff --git a/selfdrive/ui/qt/widgets/ssh_keys.cc b/selfdrive/ui/qt/widgets/ssh_keys.cc index c6af2f5cd1..ca360a3054 100644 --- a/selfdrive/ui/qt/widgets/ssh_keys.cc +++ b/selfdrive/ui/qt/widgets/ssh_keys.cc @@ -46,13 +46,13 @@ void SshControl::getUserKeys(const QString &username) { params.put("GithubUsername", username.toStdString()); params.put("GithubSshKeys", resp.toStdString()); } else { - ConfirmationDialog::alert("Username '" + username + "' has no keys on GitHub", this); + ConfirmationDialog::alert(QString("Username '%1' has no keys on GitHub").arg(username), this); } refresh(); request->deleteLater(); }); QObject::connect(request, &HttpRequest::failedResponse, [=] { - ConfirmationDialog::alert("Username '" + username + "' doesn't exist on GitHub", this); + ConfirmationDialog::alert(QString("Username '%1' doesn't exist on GitHub").arg(username), this); refresh(); request->deleteLater(); });