From 9877ff330e51a552fb462e14ed6383d40b3f275a Mon Sep 17 00:00:00 2001 From: Chocobo1 Date: Sat, 27 Aug 2022 14:48:33 +0800 Subject: [PATCH 1/2] Make strings translatable --- src/webui/www/private/download.html | 4 ++-- src/webui/www/private/upload.html | 4 ++-- src/webui/www/private/views/preferences.html | 3 ++- src/webui/www/private/views/search.html | 4 +++- 4 files changed, 9 insertions(+), 6 deletions(-) diff --git a/src/webui/www/private/download.html b/src/webui/www/private/download.html index d02b868e4..a101a9a9f 100644 --- a/src/webui/www/private/download.html +++ b/src/webui/www/private/download.html @@ -28,8 +28,8 @@ diff --git a/src/webui/www/private/upload.html b/src/webui/www/private/upload.html index 4fb58fa68..a656d07df 100644 --- a/src/webui/www/private/upload.html +++ b/src/webui/www/private/upload.html @@ -24,8 +24,8 @@ diff --git a/src/webui/www/private/views/preferences.html b/src/webui/www/private/views/preferences.html index 1d7a23a93..fe35cbbe3 100644 --- a/src/webui/www/private/views/preferences.html +++ b/src/webui/www/private/views/preferences.html @@ -413,7 +413,8 @@
QBT_TR(From:)QBT_TR[CONTEXT=OptionsDialog] - : QBT_TR(To:)QBT_TR[CONTEXT=OptionsDialog] + : + QBT_TR(To:)QBT_TR[CONTEXT=OptionsDialog] :
diff --git a/src/webui/www/private/views/search.html b/src/webui/www/private/views/search.html index d38d7be37..cefb4654c 100644 --- a/src/webui/www/private/views/search.html +++ b/src/webui/www/private/views/search.html @@ -92,7 +92,9 @@ - There aren't any search plugins installed.
Click the "Search plugins..." button at the bottom right of the window to install some. + QBT_TR(There aren't any search plugins installed.)QBT_TR[CONTEXT=SearchEngineWidget] +
+ QBT_TR(Click the "Search plugins..." button at the bottom right of the window to install some.)QBT_TR[CONTEXT=SearchEngineWidget] From fb37b0c147c069d4dbc4246f994841c1dba353d9 Mon Sep 17 00:00:00 2001 From: Chocobo1 Date: Sat, 3 Sep 2022 15:22:55 +0800 Subject: [PATCH 2/2] Suppress warning Seems `lupdate` tool cannot correctly recognize the class/context of `tr()` here, so specify the class/context manually. --- src/app/application.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/app/application.cpp b/src/app/application.cpp index acd650f5a..4e69fd236 100644 --- a/src/app/application.cpp +++ b/src/app/application.cpp @@ -842,7 +842,7 @@ catch (const RuntimeError &err) #else QMessageBox msgBox; msgBox.setIcon(QMessageBox::Critical); - msgBox.setText(tr("Application failed to start.")); + msgBox.setText(QCoreApplication::translate("Application", "Application failed to start.")); msgBox.setInformativeText(err.message()); msgBox.show(); // Need to be shown or to moveToCenter does not work msgBox.move(Utils::Gui::screenCenter(&msgBox));