From 372ea8839b2ab067e56f127a81934b35a832c44b Mon Sep 17 00:00:00 2001 From: Albert Vaca Date: Fri, 14 Feb 2014 17:11:41 +0100 Subject: [PATCH] Added missing i18n() calls to plasmoid --- plasmoid/package/contents/ui/Battery.qml | 8 ++++---- .../contents/ui/CompactRepresentation.qml | 2 +- plasmoid/package/contents/ui/DeviceDelegate.qml | 16 ++++++++-------- plasmoid/package/contents/ui/Sftp.qml | 6 +++--- 4 files changed, 16 insertions(+), 16 deletions(-) diff --git a/plasmoid/package/contents/ui/Battery.qml b/plasmoid/package/contents/ui/Battery.qml index 531137e00..09a6a09c4 100644 --- a/plasmoid/package/contents/ui/Battery.qml +++ b/plasmoid/package/contents/ui/Battery.qml @@ -29,9 +29,9 @@ QtObject { property string deviceId: "" property bool available: false - property bool state: false + property bool charging: false property int charge: -1 - property string displayString: (available) ? ((state) ? ("Charging, " + charge) : ("Discharging, " + charge)) : "No Info" + property string displayString: (available && charge > -1) ? ((charging) ? (i18n("Charging, %1").arg(charge)) : (i18n("Discharging, %1").arg(charge))) : i18n("No info") property variant device: DeviceDbusInterfaceFactory.create(deviceId) property variant battery: null @@ -39,7 +39,7 @@ QtObject { property variant nested1: DBusAsyncResponse { id: startupCheck1 autoDelete: false - onSuccess: state = result + onSuccess: charging = result } property variant nested2: DBusAsyncResponse { @@ -52,7 +52,7 @@ QtObject { if (available) { battery = DeviceBatteryDbusInterfaceFactory.create(deviceId) - battery.stateChanged.connect(function(charging) {root.state = charging}) + battery.stateChanged.connect(function(charging) {root.charging = charging}) battery.chargeChanged.connect(function(charge) {root.charge = charge}) startupCheck1.setPendingCall(battery.isCharging()) diff --git a/plasmoid/package/contents/ui/CompactRepresentation.qml b/plasmoid/package/contents/ui/CompactRepresentation.qml index b2267ab94..7f9fb3672 100644 --- a/plasmoid/package/contents/ui/CompactRepresentation.qml +++ b/plasmoid/package/contents/ui/CompactRepresentation.qml @@ -45,7 +45,7 @@ Item { id: tooltip target: mouseArea image: QIcon("smartphone") - subText: "KDE Connect device notifications" + subText: i18n("KDE Connect device notifications") } } diff --git a/plasmoid/package/contents/ui/DeviceDelegate.qml b/plasmoid/package/contents/ui/DeviceDelegate.qml index cfe6aca85..e522146f3 100644 --- a/plasmoid/package/contents/ui/DeviceDelegate.qml +++ b/plasmoid/package/contents/ui/DeviceDelegate.qml @@ -40,7 +40,7 @@ PlasmaComponents.ListItem horizontalAlignment: Text.AlignHCenter text: display } - + PlasmaComponents.Button { id: browse @@ -50,27 +50,27 @@ PlasmaComponents.ListItem states: [ State { name: "UNMOUNTED" - PropertyChanges { target: browse; checked: false; text: "Browse" } + PropertyChanges { target: browse; checked: false; text: i18n("Browse") } }, State { name: "MOUNTING" - PropertyChanges { target: browse; checked: true; text: "Mounting..." } + PropertyChanges { target: browse; checked: true; text: i18n("Mounting...") } }, State { name: "MOUNTED" - PropertyChanges { target: browse; checked: false; text: "Unmount" } + PropertyChanges { target: browse; checked: false; text: i18n("Unmount") } } ] Sftp { id: sftp deviceId: root.deviceId - + onMounted: browse.state = "MOUNTED" onUnmounted: browse.state = "UNMOUNTED" onError: browse.state = "UNMOUNTED" } - + onClicked: { if (state == "UNMOUNTED") { state = "MOUNTING" @@ -82,12 +82,12 @@ PlasmaComponents.ListItem } } } - + height: browse.height width: parent.width } - + //Battery PlasmaComponents.ListItem { diff --git a/plasmoid/package/contents/ui/Sftp.qml b/plasmoid/package/contents/ui/Sftp.qml index 19578ba57..e42dc6baf 100644 --- a/plasmoid/package/contents/ui/Sftp.qml +++ b/plasmoid/package/contents/ui/Sftp.qml @@ -24,9 +24,9 @@ import org.kde.plasma.components 0.1 as PlasmaComponents import org.kde.kdeconnect 1.0 QtObject { - + id: root - + property string deviceId: "" property bool isMounted: false property variant sftp: SftpDbusInterfaceFactory.create(deviceId) @@ -40,7 +40,7 @@ QtObject { signal mounted signal unmounted signal error(string message) - + onMounted: isMounted = true onUnmounted: isMounted = false