Fix localization of app and smsapp. Patch mainly by Victor Ryzhykh.

This commit is contained in:
Yuri Chornoivan 2019-12-21 09:59:36 +02:00
parent bc3c7567a7
commit f84b3c8c11
14 changed files with 51 additions and 45 deletions

3
app/Messages.sh Normal file
View file

@ -0,0 +1,3 @@
#!/usr/bin/env bash
$XGETTEXT `find . -name '*.cpp' -o -name '*.qml'` -o $podir/kdeconnect-app.pot

View file

@ -64,11 +64,11 @@ Kirigami.Page
Kirigami.Action { Kirigami.Action {
iconName:"network-disconnect" iconName:"network-disconnect"
onTriggered: deviceView.currentDevice.unpair() onTriggered: deviceView.currentDevice.unpair()
text: i18n("Unpair") text: i18nd("kdeconnect-app", "Unpair")
}, },
Kirigami.Action { Kirigami.Action {
iconName:"hands-free" iconName:"hands-free"
text: i18n("Send Ping") text: i18nd("kdeconnect-app", "Send Ping")
onTriggered: { onTriggered: {
deviceView.currentDevice.pluginCall("ping", "sendPing"); deviceView.currentDevice.pluginCall("ping", "sendPing");
} }
@ -91,19 +91,19 @@ Kirigami.Page
property list<QtObject> plugins : [ property list<QtObject> plugins : [
PluginItem { PluginItem {
name: i18n("Multimedia control") name: i18nd("kdeconnect-app", "Multimedia control")
interfaceFactory: MprisDbusInterfaceFactory interfaceFactory: MprisDbusInterfaceFactory
component: "qrc:/qml/mpris.qml" component: "qrc:/qml/mpris.qml"
pluginName: "mprisremote" pluginName: "mprisremote"
}, },
PluginItem { PluginItem {
name: i18n("Remote input") name: i18nd("kdeconnect-app", "Remote input")
interfaceFactory: RemoteControlDbusInterfaceFactory interfaceFactory: RemoteControlDbusInterfaceFactory
component: "qrc:/qml/mousepad.qml" component: "qrc:/qml/mousepad.qml"
pluginName: "remotecontrol" pluginName: "remotecontrol"
}, },
PluginItem { PluginItem {
name: i18n("Presentation Remote") name: i18nd("kdeconnect-app", "Presentation Remote")
interfaceFactory: RemoteKeyboardDbusInterfaceFactory interfaceFactory: RemoteKeyboardDbusInterfaceFactory
component: "qrc:/qml/presentationRemote.qml" component: "qrc:/qml/presentationRemote.qml"
pluginName: "remotecontrol" pluginName: "remotecontrol"
@ -111,7 +111,7 @@ Kirigami.Page
PluginItem { PluginItem {
readonly property var lockIface: LockDeviceDbusInterfaceFactory.create(deviceView.currentDevice.id()) readonly property var lockIface: LockDeviceDbusInterfaceFactory.create(deviceView.currentDevice.id())
pluginName: "lockdevice" pluginName: "lockdevice"
name: lockIface.isLocked ? i18n("Unlock") : i18n("Lock") name: lockIface.isLocked ? i18nd("kdeconnect-app", "Unlock") : i18nd("kdeconnect-app", "Lock")
onClick: function() { onClick: function() {
lockIface.isLocked = !lockIface.isLocked; lockIface.isLocked = !lockIface.isLocked;
} }
@ -119,13 +119,13 @@ Kirigami.Page
PluginItem { PluginItem {
readonly property var findmyphoneIface: FindMyPhoneDbusInterfaceFactory.create(deviceView.currentDevice.id()) readonly property var findmyphoneIface: FindMyPhoneDbusInterfaceFactory.create(deviceView.currentDevice.id())
pluginName: "findmyphone" pluginName: "findmyphone"
name: i18n("Find Device") name: i18nd("kdeconnect-app", "Find Device")
onClick: function() { onClick: function() {
findmyphoneIface.ring() findmyphoneIface.ring()
} }
}, },
PluginItem { PluginItem {
name: i18n("Run command") name: i18nd("kdeconnect-app", "Run command")
interfaceFactory: RemoteCommandsDbusInterfaceFactory interfaceFactory: RemoteCommandsDbusInterfaceFactory
component: "qrc:/qml/runcommand.qml" component: "qrc:/qml/runcommand.qml"
pluginName: "remotecommands" pluginName: "remotecommands"
@ -133,14 +133,14 @@ Kirigami.Page
PluginItem { PluginItem {
readonly property var shareIface: ShareDbusInterfaceFactory.create(deviceView.currentDevice.id()) readonly property var shareIface: ShareDbusInterfaceFactory.create(deviceView.currentDevice.id())
pluginName: "share" pluginName: "share"
name: i18n("Share File") name: i18nd("kdeconnect-app", "Share File")
onClick: function() { onClick: function() {
fileDialog.open() fileDialog.open()
shareIface.shareUrl(fileDialog.fileUrl) shareIface.shareUrl(fileDialog.fileUrl)
} }
}, },
PluginItem { PluginItem {
name: i18n("Volume control") name: i18nd("kdeconnect-app", "Volume control")
interfaceFactory: RemoteSystemVolumeDbusInterfaceFactory interfaceFactory: RemoteSystemVolumeDbusInterfaceFactory
component: "qrc:/qml/volume.qml" component: "qrc:/qml/volume.qml"
pluginName: "remotesystemvolume" pluginName: "remotesystemvolume"
@ -154,7 +154,7 @@ Kirigami.Page
readonly property var actions: [] readonly property var actions: []
Button { Button {
anchors.centerIn: parent anchors.centerIn: parent
text: i18n("Pair") text: i18nd("kdeconnect-app", "Pair")
icon.name:"network-connect" icon.name:"network-connect"
onClicked: deviceView.currentDevice.requestPair() onClicked: deviceView.currentDevice.requestPair()
} }
@ -167,13 +167,13 @@ Kirigami.Page
RowLayout { RowLayout {
anchors.centerIn: parent anchors.centerIn: parent
Button { Button {
text: i18n("Accept") text: i18nd("kdeconnect-app", "Accept")
icon.name:"dialog-ok" icon.name:"dialog-ok"
onClicked: deviceView.currentDevice.acceptPairing() onClicked: deviceView.currentDevice.acceptPairing()
} }
Button { Button {
text: i18n("Reject") text: i18nd("kdeconnect-app", "Reject")
icon.name:"dialog-cancel" icon.name:"dialog-cancel"
onClicked: deviceView.currentDevice.rejectPairing() onClicked: deviceView.currentDevice.rejectPairing()
} }
@ -188,7 +188,7 @@ Kirigami.Page
Label { Label {
anchors.centerIn: parent anchors.centerIn: parent
text: i18n("This device is not reachable") text: i18nd("kdeconnect-app", "This device is not reachable")
} }
} }
} }
@ -196,7 +196,7 @@ Kirigami.Page
FileDialog { FileDialog {
id: fileDialog id: fileDialog
title: i18n("Please choose a file") title: i18nd("kdeconnect-app", "Please choose a file")
folder: shortcuts.home folder: shortcuts.home
} }
} }

View file

@ -32,10 +32,10 @@ Kirigami.ScrollablePage
} }
objectName: "FindDevices" objectName: "FindDevices"
title: i18n("Pair") title: i18nd("kdeconnect-app", "Pair")
Label { Label {
text: i18n("No devices found") text: i18nd("kdeconnect-app", "No devices found")
anchors.centerIn: parent anchors.centerIn: parent
visible: devices.count === 0 visible: devices.count === 0
} }
@ -50,11 +50,11 @@ Kirigami.ScrollablePage
text: switch (parseInt(section)) text: switch (parseInt(section))
{ {
case DevicesModel.Paired: case DevicesModel.Paired:
return i18n("Remembered") return i18nd("kdeconnect-app", "Remembered")
case DevicesModel.Reachable: case DevicesModel.Reachable:
return i18n("Available") return i18nd("kdeconnect-app", "Available")
case (DevicesModel.Reachable | DevicesModel.Paired): case (DevicesModel.Reachable | DevicesModel.Paired):
return i18n("Connected") return i18nd("kdeconnect-app", "Connected")
} }
} }

View file

@ -33,7 +33,7 @@ Kirigami.ApplicationWindow
Kirigami.Action { Kirigami.Action {
id: findDevicesAction id: findDevicesAction
text: i18n("Find devices...") text: i18nd("kdeconnect-app", "Find devices...")
iconName: "list-add" iconName: "list-add"
checked: pageStack.currentItem && pageStack.currentItem.objectName == "FindDevices" checked: pageStack.currentItem && pageStack.currentItem.objectName == "FindDevices"

View file

@ -27,7 +27,7 @@ import org.kde.kdeconnect 1.0
Kirigami.Page Kirigami.Page
{ {
id: mousepad id: mousepad
title: i18n("Remote Control") title: i18nd("kdeconnect-app", "Remote Control")
property QtObject pluginInterface property QtObject pluginInterface
property QtObject device property QtObject device

View file

@ -30,7 +30,7 @@ Kirigami.Page
property bool muted: false property bool muted: false
property int volumeUnmuted property int volumeUnmuted
property var volume: pluginInterface.volume property var volume: pluginInterface.volume
title: i18n("Multimedia Controls") title: i18nd("kdeconnect-app", "Multimedia Controls")
onVolumeChanged: { onVolumeChanged: {
if (muted && volume != 0) { if (muted && volume != 0) {
@ -73,7 +73,7 @@ Kirigami.Page
Label { Label {
id: noPlayersText id: noPlayersText
text: i18n("No players available") text: i18nd("kdeconnect-app", "No players available")
anchors.centerIn: parent anchors.centerIn: parent
visible: pluginInterface.playerList.length == 0 visible: pluginInterface.playerList.length == 0
} }
@ -121,7 +121,7 @@ Kirigami.Page
Label { Label {
id: artistAlbum id: artistAlbum
Layout.fillWidth: true Layout.fillWidth: true
text: i18n("%1 - %2", root.pluginInterface.artist, root.pluginInterface.album) text: i18nd("kdeconnect-app", "%1 - %2", root.pluginInterface.artist, root.pluginInterface.album)
visible: !nowPlaying.visible && root.pluginInterface.album.length > 0 && root.pluginInterface.artist.length > 0 visible: !nowPlaying.visible && root.pluginInterface.album.length > 0 && root.pluginInterface.artist.length > 0
wrapMode: Text.Wrap wrapMode: Text.Wrap
} }

View file

@ -26,12 +26,12 @@ import org.kde.kirigami 2.0 as Kirigami
Kirigami.Page Kirigami.Page
{ {
id: mousepad id: mousepad
title: i18n("Presentation Remote") title: i18nd("kdeconnect-app", "Presentation Remote")
property QtObject pluginInterface property QtObject pluginInterface
actions.main: Kirigami.Action { actions.main: Kirigami.Action {
icon.name: "view-fullscreen" icon.name: "view-fullscreen"
text: i18n("Enable Full-Screen") text: i18nd("kdeconnect-app", "Enable Full-Screen")
onTriggered: { onTriggered: {
mousepad.pluginInterface.sendKeyPress("", 25 /*XK_F5*/); mousepad.pluginInterface.sendKeyPress("", 25 /*XK_F5*/);
} }

View file

@ -27,15 +27,15 @@ import org.kde.kdeconnect 1.0
Kirigami.Page Kirigami.Page
{ {
id: root id: root
title: i18n("Run command") title: i18nd("kdeconnect-app", "Run command")
property QtObject pluginInterface property QtObject pluginInterface
actions.main: Kirigami.Action { actions.main: Kirigami.Action {
icon.name: "document-edit" icon.name: "document-edit"
text: i18n("Edit commands") text: i18nd("kdeconnect-app", "Edit commands")
onTriggered: { onTriggered: {
pluginInterface.editCommands(); pluginInterface.editCommands();
showPassiveNotification(i18n("You can edit commands on the connected device")); showPassiveNotification(i18nd("kdeconnect-app", "You can edit commands on the connected device"));
} }
} }
@ -55,7 +55,7 @@ Kirigami.Page
Label { Label {
visible: commandsList.count === 0 visible: commandsList.count === 0
text: i18n("No commands defined") text: i18nd("kdeconnect-app", "No commands defined")
anchors.centerIn: parent anchors.centerIn: parent
} }

View file

@ -27,7 +27,7 @@ import org.kde.kdeconnect 1.0
Kirigami.Page Kirigami.Page
{ {
id: root id: root
title: i18n("Volume control") title: i18nd("kdeconnect-app", "Volume control")
property QtObject pluginInterface property QtObject pluginInterface
ListView { ListView {

3
smsapp/Messages.sh Normal file
View file

@ -0,0 +1,3 @@
#!/usr/bin/env bash
$XGETTEXT `find . -name '*.cpp' -o -name '*.qml'` -o $podir/kdeconnect-sms.pot

View file

@ -119,7 +119,7 @@ RowLayout {
Controls.Menu { Controls.Menu {
id: contextMenu id: contextMenu
Controls.MenuItem { Controls.MenuItem {
text: i18n("Copy Message") text: i18nd("kdeconnect-sms", "Copy Message")
enabled: bodyLabel.visible enabled: bodyLabel.visible
onTriggered: { onTriggered: {
root.messageCopyRequested(messageBody) root.messageCopyRequested(messageBody)
@ -147,7 +147,7 @@ RowLayout {
} }
Controls.Label { Controls.Label {
id: dateLabeltest id: dateLabeltest
text: spoilerHint == "" ? qsTr("Spoiler") : spoilerHint text: spoilerHint == "" ? i18nd("kdeconnect-sms", "Spoiler") : spoilerHint
color: sentByMe ? Kirigami.Theme.textColor color: sentByMe ? Kirigami.Theme.textColor
: Kirigami.Theme.complementaryTextColor : Kirigami.Theme.complementaryTextColor
font.pixelSize: Kirigami.Units.gridUnit * 0.8 font.pixelSize: Kirigami.Units.gridUnit * 0.8
@ -187,7 +187,7 @@ RowLayout {
// mediaLocation === "" && // mediaLocation === "" &&
// mediaGetUrl !== "" // mediaGetUrl !== ""
} }
text: qsTr("Download") text: i18nd("kdeconnect-sms", "Download")
onClicked: { onClicked: {
print("Downloading " + mediaGetUrl + "...") print("Downloading " + mediaGetUrl + "...")
kaidan.downloadMedia(msgId, mediaGetUrl) kaidan.downloadMedia(msgId, mediaGetUrl)

View file

@ -196,7 +196,7 @@ Kirigami.ScrollablePage
TextArea { TextArea {
id: messageField id: messageField
Layout.fillWidth: true Layout.fillWidth: true
placeholderText: page.isMultitarget ? i18n("Replying to multitarget messages is not supported") : i18n("Compose message") placeholderText: page.isMultitarget ? i18nd("kdeconnect-sms", "Replying to multitarget messages is not supported") : i18nd("kdeconnect-sms", "Compose message")
wrapMode: TextArea.Wrap wrapMode: TextArea.Wrap
topPadding: Kirigami.Units.gridUnit * 0.5 topPadding: Kirigami.Units.gridUnit * 0.5
bottomPadding: topPadding bottomPadding: topPadding

View file

@ -35,7 +35,7 @@ Kirigami.ScrollablePage
id: noDevicesWarning id: noDevicesWarning
visible: !page.deviceConnected visible: !page.deviceConnected
timeout: -1 timeout: -1
text: "⚠️ " + i18n("No devices available") + " ⚠️" text: "⚠️ " + i18nd("kdeconnect-sms", "No devices available") + " ⚠️"
MouseArea { MouseArea {
// Detect mouseover and show another tooltip with more information // Detect mouseover and show another tooltip with more information
@ -45,13 +45,13 @@ Kirigami.ScrollablePage
ToolTip.visible: containsMouse ToolTip.visible: containsMouse
ToolTip.delay: Qt.styleHints.mousePressAndHoldInterval ToolTip.delay: Qt.styleHints.mousePressAndHoldInterval
// TODO: Wrap text if line is too long for the screen // TODO: Wrap text if line is too long for the screen
ToolTip.text: i18n("No new messages can be sent or received, but you can browse cached content") ToolTip.text: i18nd("kdeconnect-sms", "No new messages can be sent or received, but you can browse cached content")
} }
} }
contextualActions: [ contextualActions: [
Kirigami.Action { Kirigami.Action {
text: i18n("Refresh") text: i18nd("kdeconnect-sms", "Refresh")
icon.name: "view-refresh" icon.name: "view-refresh"
enabled: devicesCombo.count > 0 enabled: devicesCombo.count > 0
onTriggered: { onTriggered: {
@ -77,12 +77,12 @@ Kirigami.ScrollablePage
header: Kirigami.InlineMessage { header: Kirigami.InlineMessage {
Layout.fillWidth: true Layout.fillWidth: true
visible: page.initialMessage.length > 0 visible: page.initialMessage.length > 0
text: i18n("Choose recipient") text: i18nd("kdeconnect-sms", "Choose recipient")
actions: [ actions: [
Kirigami.Action { Kirigami.Action {
iconName: "dialog-cancel" iconName: "dialog-cancel"
text: i18n("Cancel") text: i18nd("kdeconnect-sms", "Cancel")
onTriggered: initialMessage = "" onTriggered: initialMessage = ""
} }
] ]
@ -91,7 +91,7 @@ Kirigami.ScrollablePage
footer: ComboBox { footer: ComboBox {
id: devicesCombo id: devicesCombo
enabled: count > 0 enabled: count > 0
displayText: !enabled ? i18n("No devices available") : undefined displayText: !enabled ? i18nd("kdeconnect-sms", "No devices available") : undefined
model: DevicesSortProxyModel { model: DevicesSortProxyModel {
id: devicesModel id: devicesModel
//TODO: make it possible to filter if they can do sms //TODO: make it possible to filter if they can do sms
@ -137,7 +137,7 @@ Kirigami.ScrollablePage
* Used as the filter of the list of messages * Used as the filter of the list of messages
*/ */
id: filter id: filter
placeholderText: i18n("Filter...") placeholderText: i18nd("kdeconnect-sms", "Filter...")
width: parent.width width: parent.width
z: 10 z: 10
onTextChanged: { onTextChanged: {

View file

@ -32,7 +32,7 @@ Kirigami.ApplicationWindow
height: 600 height: 600
pageStack.initialPage: ConversationList { pageStack.initialPage: ConversationList {
title: i18n("KDE Connect SMS") title: i18nd("kdeconnect-sms", "KDE Connect SMS")
initialMessage: _initialMessage initialMessage: _initialMessage
} }
@ -47,7 +47,7 @@ Kirigami.ApplicationWindow
actions: [ actions: [
Kirigami.Action { Kirigami.Action {
text: i18n("About...") text: i18nd("kdeconnect-sms", "About...")
icon.name: "help-about" icon.name: "help-about"
onTriggered: { onTriggered: {
applicationWindow().pageStack.push(aboutPageComponent, { aboutData: aboutData }); applicationWindow().pageStack.push(aboutPageComponent, { aboutData: aboutData });