Добрый день.
У кого-нибудь отображается перевод строк в контекстном меню dolphin «Поделиться»?
Или это я неправильно собираю пакет purpose?
А то у меня что-то действия в этом меню без перевода.
Совсем непонятно назначение строки в
add_definitions(-DTRANSLATION_DOMAIN=\"purpose5\")
в файле /purpose/CMakeLists.txt
Нет ни файла локализации, ни Messages.sh с таким именем, а используются
add_definitions(-DTRANSLATION_DOMAIN=
для отдельных модулей.
Ещё в приложении полно файлов qml, и для них не работают строки
add_definitions(-DTRANSLATION_DOMAIN=
в файлах CMakeLists.txt для этих модулей.
Видимо правильнее использовать вызов i18nd.
Вообще в паре модулей как раз и используется i18nd, и в них перевод работает.
Например в файле /purpose/src/plugins/twitter/contents/config/config.qml
Если наложить приложенный патч, то будет отображаться перевод и в остальных модулях.
--
С Уважением,
С Уважением,
Виктор
diff -urN purpose-5.62.0/src/plugins/bluetooth/bluetoothplugin_config.qml purpose-5.62.0-patched/src/plugins/bluetooth/bluetoothplugin_config.qml
--- purpose-5.62.0/src/plugins/bluetooth/bluetoothplugin_config.qml 2019-09-26 04:44:34.000000000 +0300
+++ purpose-5.62.0-patched/src/plugins/bluetooth/bluetoothplugin_config.qml 2019-10-01 14:01:02.874308013 +0300
@@ -31,7 +31,7 @@
anchors.bottomMargin: Kirigami.Units.smallSpacing
Kirigami.Heading {
- text: i18n("Choose a device to send to:")
+ text: i18nd("purpose_bluetooth", "Choose a device to send to:")
visible: list.count !== 0
level: 1
}
@@ -65,7 +65,7 @@
verticalAlignment: Qt.AlignVCenter
horizontalAlignment: Qt.AlignHCenter
visible: list.count === 0
- text: i18n("No devices found")
+ text: i18nd("purpose_bluetooth", "No devices found")
}
}
}
diff -urN purpose-5.62.0/src/plugins/nextcloud/nextcloudplugin_config.qml purpose-5.62.0-patched/src/plugins/nextcloud/nextcloudplugin_config.qml
--- purpose-5.62.0/src/plugins/nextcloud/nextcloudplugin_config.qml 2019-09-26 04:44:34.000000000 +0300
+++ purpose-5.62.0-patched/src/plugins/nextcloud/nextcloudplugin_config.qml 2019-10-01 14:19:30.807617753 +0300
@@ -46,7 +46,7 @@
configuration.data = jobData;
}
- Label { text: i18n("Account:") }
+ Label { text: i18nd("purpose_nextcloud", "Account:") }
RowLayout {
Layout.fillWidth: true
ComboBox {
@@ -67,7 +67,7 @@
onClicked: KQCA.KCMShell.open("kcm_kaccounts");
}
}
- Label { text: i18n("Upload to folder:") }
+ Label { text: i18nd("purpose_nextcloud", "Upload to folder:") }
TextField {
id: folderField
Layout.fillWidth: true
diff -urN purpose-5.62.0/src/plugins/phabricator/phabricatorplugin_config.qml purpose-5.62.0-patched/src/plugins/phabricator/phabricatorplugin_config.qml
--- purpose-5.62.0/src/plugins/phabricator/phabricatorplugin_config.qml 2019-09-26 04:44:34.000000000 +0300
+++ purpose-5.62.0-patched/src/plugins/phabricator/phabricatorplugin_config.qml 2019-10-01 14:16:29.857621601 +0300
@@ -36,11 +36,11 @@
function labelText()
{
if (updateDRCombo.currentIndex>=0 && updateOld.checked) {
- return updateDR.length > 0 ? i18n("Update differential revision %1", updateDR) : i18n("Update differential revision")
+ return updateDR.length > 0 ? i18nd("purpose_phabricator", "Update differential revision %1", updateDR) : i18nd("purpose_phabricator", "Update differential revision")
} else if (createNew.checked) {
- return i18n("Create new \"differential diff\"")
+ return i18nd("purpose_phabricator", "Create new \"differential diff\"")
} else {
- return i18n("Create or update?")
+ return i18nd("purpose_phabricator", "Create or update?")
}
}
Label {
@@ -63,7 +63,7 @@
root.updateDR = ""
root.drTitle = ""
} else {
- root.updateDR = i18n("unknown")
+ root.updateDR = i18nd("purpose_phabricator", "unknown")
root.drTitle = ""
}
}
@@ -77,8 +77,8 @@
RadioButton {
id: createNew
exclusiveGroup: updateGroup
- text: i18n("New Diff")
- tooltip: i18n("tick this to create a new \"differential diff\" which can\nbe converted online to a new differential revision")
+ text: i18nd("purpose_phabricator", "New Diff")
+ tooltip: i18nd("purpose_phabricator", "tick this to create a new \"differential diff\" which can\nbe converted online to a new differential revision")
onCheckedChanged: {
root.refreshUpdateDR();
}
@@ -86,8 +86,8 @@
RadioButton {
id: updateOld
exclusiveGroup: updateGroup
- text: i18n("Update Diff")
- tooltip: i18n("tick this to update an existing revision,\nselect one from the list below.")
+ text: i18nd("purpose_phabricator", "Update Diff")
+ tooltip: i18nd("purpose_phabricator", "tick this to update an existing revision,\nselect one from the list below.")
onCheckedChanged: {
root.refreshUpdateDR();
}
@@ -115,14 +115,14 @@
CheckBox {
id: doBrowseCheck
anchors.centerIn: parent
- text: i18n("Open Diff in browser")
+ text: i18nd("purpose_phabricator", "Open Diff in browser")
enabled: updateOld.checked
}
}
Label {
- // use i18n().arg() to avoid showing the "%1" when inactive
- text: updateDR != "unknown" && updateDR.length > 0 ? i18n("Summary of the update to %1:", updateDR) : i18n("Summary of the update")
+ // use i18nd("purpose_phabricator", ).arg() to avoid showing the "%1" when inactive
+ text: updateDR != "unknown" && updateDR.length > 0 ? i18nd("purpose_phabricator", "Summary of the update to %1:", updateDR) : i18nd("purpose_phabricator", "Summary of the update")
enabled: updateOld.checked
}
@@ -130,7 +130,7 @@
id: updateCommentField
Layout.fillWidth: true
Layout.fillHeight: true
- text: i18n("patch updated through %1 and the Purpose/Phabricator plugin", Qt.application.name)
+ text: i18nd("purpose_phabricator", "patch updated through %1 and the Purpose/Phabricator plugin", Qt.application.name)
enabled: updateOld.checked
tabChangesFocus: false
}
diff -urN purpose-5.62.0/src/plugins/reviewboard/reviewboardplugin_config.qml purpose-5.62.0-patched/src/plugins/reviewboard/reviewboardplugin_config.qml
--- purpose-5.62.0/src/plugins/reviewboard/reviewboardplugin_config.qml 2019-09-26 04:44:34.000000000 +0300
+++ purpose-5.62.0-patched/src/plugins/reviewboard/reviewboardplugin_config.qml 2019-10-01 14:14:43.617623866 +0300
@@ -40,25 +40,25 @@
path: root.localBaseDir + "/.reviewboardrc"
}
- Label { text: i18n("Server:") }
+ Label { text: i18nd("purpose_reviewboard", "Server:") }
TextField {
id: serverField
Layout.fillWidth: true
text: rcfile.server
}
- Label { text: i18n("Username:") }
+ Label { text: i18nd("purpose_reviewboard", "Username:") }
TextField {
id: usernameField
Layout.fillWidth: true
}
- Label { text: i18n("Password:") }
+ Label { text: i18nd("purpose_reviewboard", "Password:") }
TextField {
id: passwordField
echoMode: TextInput.Password
Layout.fillWidth: true
}
- Label { text: i18n("Repository:") }
+ Label { text: i18nd("purpose_reviewboard", "Repository:") }
ComboBox {
id: repositoriesCombo
Layout.fillWidth: true
@@ -83,7 +83,7 @@
CheckBox {
anchors.centerIn: parent
id: update
- text: i18n("Update Review:")
+ text: i18nd("purpose_reviewboard", "Update Review:")
enabled: updateRRCombo.count > 0
onCheckedChanged: {
root.refreshUpdateRR();
diff -urN purpose-5.62.0/src/plugins/youtube/youtubeplugin_config.qml purpose-5.62.0-patched/src/plugins/youtube/youtubeplugin_config.qml
--- purpose-5.62.0/src/plugins/youtube/youtubeplugin_config.qml 2019-09-26 04:44:34.000000000 +0300
+++ purpose-5.62.0-patched/src/plugins/youtube/youtubeplugin_config.qml 2019-10-01 14:05:46.907635281 +0300
@@ -38,7 +38,7 @@
accountId = valid ? serviceModel.get(accountsCombo.currentIndex, "accountId") : null
}
- Label { text: i18n("Account:") }
+ Label { text: i18nd("purpose_youtube", "Account:") }
RowLayout {
Layout.fillWidth: true
ComboBox {
@@ -60,21 +60,21 @@
}
}
- Label { text: i18n("Title:") }
+ Label { text: i18nd("purpose_youtube", "Title:") }
TextField {
id: title
Layout.fillWidth: true
- placeholderText: i18n("Enter a title for the video...")
+ placeholderText: i18nd("purpose_youtube", "Enter a title for the video...")
}
- Label { text: i18n("Tags:") }
+ Label { text: i18nd("purpose_youtube", "Tags:") }
TextField {
id: tags
Layout.fillWidth: true
- placeholderText: i18n("KDE, Kamoso")
+ placeholderText: i18nd("purpose_youtube", "KDE, Kamoso")
}
- Label { text: i18n("Description:") }
+ Label { text: i18nd("purpose_youtube", "Description:") }
TextArea {
id: description
Layout.fillWidth: true
diff -urN purpose-5.62.0/src/quick/AlternativesView.qml purpose-5.62.0-patched/src/quick/AlternativesView.qml
--- purpose-5.62.0/src/quick/AlternativesView.qml 2019-09-26 04:44:34.000000000 +0300
+++ purpose-5.62.0-patched/src/quick/AlternativesView.qml 2019-10-01 14:28:16.987606561 +0300
@@ -39,7 +39,7 @@
elide: Text.ElideRight
}
Button {
- text: i18n("Use")
+ text: i18nd("libpurpose_quick", "Use")
onClicked: createJob(index);
}
Keys.onReturnPressed: createJob(index)
@@ -122,7 +122,7 @@
}
RowLayout {
Button {
- text: i18n("Run")
+ text: i18nd("libpurpose_quick", "Run")
enabled: wiz.configuration && wiz.configuration.isReady
onClicked: {
stack.pop();
@@ -130,7 +130,7 @@
}
}
Button {
- text: i18n("Back")
+ text: i18nd("libpurpose_quick", "Back")
onClicked: {
stack.pop();
wiz.cancel()
diff -urN purpose-5.62.0/src/widgets/JobDialog.qml purpose-5.62.0-patched/src/widgets/JobDialog.qml
--- purpose-5.62.0/src/widgets/JobDialog.qml 2019-09-26 04:44:34.000000000 +0300
+++ purpose-5.62.0-patched/src/widgets/JobDialog.qml 2019-10-01 14:27:20.624274421 +0300
@@ -40,7 +40,7 @@
minimumWidth: view.Layout.minimumWidth
onClosing: {
- q.finished(null, 1 /* KIO::ERR_USER_CANCELED */, i18n("Configuration cancelled"));
+ q.finished(null, 1 /* KIO::ERR_USER_CANCELED */, i18nd("libpurpose_widgets", "Configuration cancelled"));
}
function adoptJob() {
@@ -85,7 +85,7 @@
Layout.fillWidth: true
}
Button {
- text: i18n("Send")
+ text: i18nd("libpurpose_widgets", "Send")
icon.name: "document-send"
enabled: window.configuration && window.configuration.isReady
onClicked: {
@@ -94,10 +94,10 @@
}
}
Button {
- text: i18n("Cancel")
+ text: i18nd("libpurpose_widgets", "Cancel")
icon.name: "dialog-cancel"
onClicked: {
- window.q.finished(null, 1 /* KIO::ERR_USER_CANCELED */, i18n("Configuration cancelled"));
+ window.q.finished(null, 1 /* KIO::ERR_USER_CANCELED */, i18nd("libpurpose_widgets", "Configuration cancelled"));
window.visible = false;
}
}
_______________________________________________ kde-russian mailing list [email protected] https://lists.kde.ru/mailman/listinfo/kde-russian
