[plasma/bluedevil/Plasma/6.7] src: i18n: Fix dialog translation for Forget Device
Luigi Toscano <[email protected]>
| Newsgroups | gmane.comp.kde.cvs |
|---|---|
| Message-ID | <[email protected]> |
Git commit a86c4be3f4acfd0e99f07a3b5f8fecef7f06b8bb by Luigi Toscano, on behalf of Ismael Asensio.
Committed on 18/08/2026 at 20:44.
Pushed by ngraham into branch 'Plasma/6.7'.
i18n: Fix dialog translation for Forget Device
The 'Forget Device' dialog has been moved into a qml component, which
also means a different translation domain (`bluedevil.pot` insetad of
`kcm_bluetooth.pot`).
Fix the dialog translation by:
- extracting the qml messages into the catalog
- explicitly reference the catalog (`i18nd()`)
- avoid duplicating messages on several catalogs
(cherry picked from commit ab73c5a472f9856d93ac3aa94a9c39855dc1ed8e)
M +1 -1 src/Messages.sh
M +0 -2 src/components/CMakeLists.txt
M +4 -4 src/components/ForgetDeviceDialog.qml
https://invent.kde.org/plasma/bluedevil/-/commit/a86c4be3f4acfd0e99f07a3b5f8fecef7f06b8bb
diff --git a/src/Messages.sh b/src/Messages.sh
index f3ab8ff1..5d1e5641 100755
--- a/src/Messages.sh
+++ b/src/Messages.sh
@@ -1,4 +1,4 @@
#!/usr/bin/env bash
$EXTRACTRC `find . -name \*.ui -o -name \*.rc -o -name \*.kcfg` >> rc.cpp
-$XGETTEXT `find . -name \*.cpp` -o $podir/bluedevil.pot
+$XGETTEXT `find . \( -name \*.cpp -o -name \*.qml \) ! -path "*applet*" ! -path "*kcm*"` -o $podir/bluedevil.pot
diff --git a/src/components/CMakeLists.txt b/src/components/CMakeLists.txt
index 08c7b1b5..9ba8d2d9 100644
--- a/src/components/CMakeLists.txt
+++ b/src/components/CMakeLists.txt
@@ -3,8 +3,6 @@
ecm_add_qml_module(bluedevilcomponents URI org.kde.bluedevil.components GENERATE_PLUGIN_SOURCE)
-target_compile_definitions(bluedevilcomponents PRIVATE TRANSLATION_DOMAIN="bluedevil")
-
ecm_target_qml_sources(bluedevilcomponents SOURCES
ForgetDeviceDialog.qml
)
diff --git a/src/components/ForgetDeviceDialog.qml b/src/components/ForgetDeviceDialog.qml
index 71e2e7f1..773f23db 100644
--- a/src/components/ForgetDeviceDialog.qml
+++ b/src/components/ForgetDeviceDialog.qml
@@ -34,8 +34,8 @@ QtObject {
required property BluezQt.Device device
- title: i18n("Forget this Device?")
- subtitle: i18n("Are you sure you want to forget \"%1\"?", device.name)
+ title: i18nd("bluedevil", "Forget this Device?")
+ subtitle: i18nd("bluedevil", "Are you sure you want to forget \"%1\"?", device.name)
parent: root.parent
showCloseButton: false
@@ -47,7 +47,7 @@ QtObject {
standardButtons: Kirigami.Dialog.NoButton
customFooterActions: [
Kirigami.Action {
- text: i18nc("@action:button", "Forget Device")
+ text: i18ndc("bluedevil", "@action:button", "Forget Device")
icon.name: "edit-delete-remove-symbolic"
onTriggered: {
dialog.accept();
@@ -55,7 +55,7 @@ QtObject {
},
Kirigami.Action {
id: cancelAction
- text: i18nc("@action:button", "Cancel")
+ text: i18ndc("bluedevil", "@action:button", "Cancel")
icon.name: "dialog-cancel-symbolic"
onTriggered: {
dialog.reject();