From 65b47d4613c0b290e2ba08c4cc9fb79d26a56f0b Mon Sep 17 00:00:00 2001 From: Dominique Fuchs <32204802+DominiqueFuchs@users.noreply.github.com> Date: Tue, 14 Jan 2020 07:59:28 +0100 Subject: [PATCH] Make qml UI strings translatable Signed-off-by: Dominique Fuchs <32204802+DominiqueFuchs@users.noreply.github.com> --- src/gui/tray/UserLine.qml | 4 ++-- src/gui/tray/Window.qml | 18 +++++------------- 2 files changed, 7 insertions(+), 15 deletions(-) diff --git a/src/gui/tray/UserLine.qml b/src/gui/tray/UserLine.qml index 700951fef..0c2025032 100644 --- a/src/gui/tray/UserLine.qml +++ b/src/gui/tray/UserLine.qml @@ -118,7 +118,7 @@ MenuItem { } MenuItem { - text: isConnected ? "Log out" : "Log in" + text: isConnected ? qsTr("Log out") : qsTr("Log in") onClicked: { isConnected ? userModelBackend.logout(index) : userModelBackend.login(index) accountMenu.close() @@ -126,7 +126,7 @@ MenuItem { } MenuItem { - text: "Remove Account" + text: qsTr("Remove Account") onClicked: { userModelBackend.removeAccount(index) accountMenu.close() diff --git a/src/gui/tray/Window.qml b/src/gui/tray/Window.qml index 7b38106bc..af9641239 100644 --- a/src/gui/tray/Window.qml +++ b/src/gui/tray/Window.qml @@ -109,7 +109,7 @@ Window { hoverEnabled: true onClicked: { - syncPauseButton.text = systrayBackend.syncIsPaused() ? "Resume sync for all" : "Pause sync for all" + syncPauseButton.text = systrayBackend.syncIsPaused() ? qsTr("Resume sync for all") : qsTr("Pause sync for all") accountMenu.open() } @@ -156,7 +156,7 @@ Window { } Label { Layout.leftMargin: 10 - text: "Add account" + text: qsTr("Add account") color: "black" font.pixelSize: 12 } @@ -176,27 +176,19 @@ Window { } MenuItem { - text: "Open settings" + text: qsTr("Open settings") onClicked: systrayBackend.openSettings() } MenuItem { - text: "Help" + text: qsTr("Help") onClicked: systrayBackend.openHelp() } MenuItem { - text: "Quit Nextcloud" + text: qsTr("Quit Nextcloud") onClicked: systrayBackend.shutdown() } - - Component.onCompleted: {/* - if(userModelBackend.numUsers() === 1) { - accountMenuSeparator.height = 0 - } else { - accountMenuSeparator.height = 13 - }*/ - } } }