From b76fe488b9d032f1f9676bf2eda1cd9f525e65e6 Mon Sep 17 00:00:00 2001 From: Simon Redman Date: Mon, 23 Jan 2023 04:42:59 +0000 Subject: [PATCH] [SMS App] Add i18n application domain for messaging app ## Summary Add KLocalizedString::setApplicationDomain for kdeconnect-sms Per the programmer guide, this must be done, otherwise translations will not happen. https://api.kde.org/frameworks/ki18n/html/prg_guide.html ## Test Plan ### Before: kdeconnect-sms would spew errors like `kf.i18n: KLocalizedString: Using an empty domain, fix the code. msgid: "%1" msgid_plural: "" msgctxt: ""` (Translations still seem to work, though) ### After: No more ki18n errors, translation works. --- smsapp/main.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/smsapp/main.cpp b/smsapp/main.cpp index 1c3e3abc4..d8c3c8a3b 100644 --- a/smsapp/main.cpp +++ b/smsapp/main.cpp @@ -45,6 +45,7 @@ int main(int argc, char *argv[]) QGuiApplication::setAttribute(Qt::AA_UseHighDpiPixmaps); QGuiApplication::setAttribute(Qt::AA_EnableHighDpiScaling); QApplication app(argc, argv); + KLocalizedString::setApplicationDomain("kdeconnect-sms"); app.setWindowIcon(QIcon::fromTheme(QStringLiteral("kdeconnect"))); KAboutData aboutData(QStringLiteral("kdeconnect.sms"), i18n("KDE Connect SMS"),