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

View file

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

View file

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

View file

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

View file

@ -30,7 +30,7 @@ Kirigami.Page
property bool muted: false
property int volumeUnmuted
property var volume: pluginInterface.volume
title: i18n("Multimedia Controls")
title: i18nd("kdeconnect-app", "Multimedia Controls")
onVolumeChanged: {
if (muted && volume != 0) {
@ -73,7 +73,7 @@ Kirigami.Page
Label {
id: noPlayersText
text: i18n("No players available")
text: i18nd("kdeconnect-app", "No players available")
anchors.centerIn: parent
visible: pluginInterface.playerList.length == 0
}
@ -121,7 +121,7 @@ Kirigami.Page
Label {
id: artistAlbum
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
wrapMode: Text.Wrap
}

View file

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

View file

@ -27,15 +27,15 @@ import org.kde.kdeconnect 1.0
Kirigami.Page
{
id: root
title: i18n("Run command")
title: i18nd("kdeconnect-app", "Run command")
property QtObject pluginInterface
actions.main: Kirigami.Action {
icon.name: "document-edit"
text: i18n("Edit commands")
text: i18nd("kdeconnect-app", "Edit commands")
onTriggered: {
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 {
visible: commandsList.count === 0
text: i18n("No commands defined")
text: i18nd("kdeconnect-app", "No commands defined")
anchors.centerIn: parent
}

View file

@ -27,7 +27,7 @@ import org.kde.kdeconnect 1.0
Kirigami.Page
{
id: root
title: i18n("Volume control")
title: i18nd("kdeconnect-app", "Volume control")
property QtObject pluginInterface
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 {
id: contextMenu
Controls.MenuItem {
text: i18n("Copy Message")
text: i18nd("kdeconnect-sms", "Copy Message")
enabled: bodyLabel.visible
onTriggered: {
root.messageCopyRequested(messageBody)
@ -147,7 +147,7 @@ RowLayout {
}
Controls.Label {
id: dateLabeltest
text: spoilerHint == "" ? qsTr("Spoiler") : spoilerHint
text: spoilerHint == "" ? i18nd("kdeconnect-sms", "Spoiler") : spoilerHint
color: sentByMe ? Kirigami.Theme.textColor
: Kirigami.Theme.complementaryTextColor
font.pixelSize: Kirigami.Units.gridUnit * 0.8
@ -187,7 +187,7 @@ RowLayout {
// mediaLocation === "" &&
// mediaGetUrl !== ""
}
text: qsTr("Download")
text: i18nd("kdeconnect-sms", "Download")
onClicked: {
print("Downloading " + mediaGetUrl + "...")
kaidan.downloadMedia(msgId, mediaGetUrl)

View file

@ -196,7 +196,7 @@ Kirigami.ScrollablePage
TextArea {
id: messageField
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
topPadding: Kirigami.Units.gridUnit * 0.5
bottomPadding: topPadding

View file

@ -35,7 +35,7 @@ Kirigami.ScrollablePage
id: noDevicesWarning
visible: !page.deviceConnected
timeout: -1
text: "⚠️ " + i18n("No devices available") + " ⚠️"
text: "⚠️ " + i18nd("kdeconnect-sms", "No devices available") + " ⚠️"
MouseArea {
// Detect mouseover and show another tooltip with more information
@ -45,13 +45,13 @@ Kirigami.ScrollablePage
ToolTip.visible: containsMouse
ToolTip.delay: Qt.styleHints.mousePressAndHoldInterval
// 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: [
Kirigami.Action {
text: i18n("Refresh")
text: i18nd("kdeconnect-sms", "Refresh")
icon.name: "view-refresh"
enabled: devicesCombo.count > 0
onTriggered: {
@ -77,12 +77,12 @@ Kirigami.ScrollablePage
header: Kirigami.InlineMessage {
Layout.fillWidth: true
visible: page.initialMessage.length > 0
text: i18n("Choose recipient")
text: i18nd("kdeconnect-sms", "Choose recipient")
actions: [
Kirigami.Action {
iconName: "dialog-cancel"
text: i18n("Cancel")
text: i18nd("kdeconnect-sms", "Cancel")
onTriggered: initialMessage = ""
}
]
@ -91,7 +91,7 @@ Kirigami.ScrollablePage
footer: ComboBox {
id: devicesCombo
enabled: count > 0
displayText: !enabled ? i18n("No devices available") : undefined
displayText: !enabled ? i18nd("kdeconnect-sms", "No devices available") : undefined
model: DevicesSortProxyModel {
id: devicesModel
//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
*/
id: filter
placeholderText: i18n("Filter...")
placeholderText: i18nd("kdeconnect-sms", "Filter...")
width: parent.width
z: 10
onTextChanged: {

View file

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