diff --git a/README.md b/README.md index 8ca56d8..c9a4562 100644 --- a/README.md +++ b/README.md @@ -41,3 +41,9 @@ We supply an arm-pie version of tor in `android/libs/armeabi-v7a` with the name If all that is done, then check out cwtch.im/ui and run `qtdeploy` in the root of it. Currently you will need to manually run tor first before running cwtch.im/ui. Use the included tor and torrc file: `tor -f torrc` + +# Development + +## Translations + +Translations can be update by runing QT Linguist in the project directory (`linguist`) and loading and editing any of the `i18n/translate_*.ts` files. To add a new translation, please register the file in qml.qrc. To update translations, run `lupdate ui.pro` to update the editable .ts files and when you are done run `lrelease ui.pro` to generate the .qm files that are used at runtime. diff --git a/i18n/translation_de.ts b/i18n/translation_de.ts index 6ac8e75..77d4960 100644 --- a/i18n/translation_de.ts +++ b/i18n/translation_de.ts @@ -5,27 +5,31 @@ AddGroupPane - Create a new group + create-group-title - - Server: + + server-label + Server label - - Group name: + + group-name-label + Group name label - - my awesome group + + default-group-name + default suggested group name - - create + + create-group-btn + create group button @@ -33,7 +37,19 @@ BulletinOverlay - New Bulletin + new-bulletin-label + + + + + post-new-bulletin-label + Post a new Bulletin Post + + + + + title-placeholder + title place holder text @@ -41,130 +57,167 @@ GroupSettingsPane - Server: + server-label - copy + copy-btn - Invitation: + invitation-label - Group name: + group-name-label - Save + save-btn - - Invite someone to the group: + + invite-to-group-label + Invite someone to the group - - Invite + + invite-btn - - delete + + delete-btn ListOverlay - - Add a New List Item + + add-list-item + Add a New List Item + + + + + add-new-item + Add a new item to the list + + + + + todo-placeholder + Todo... placeholder text + + + + + MembershipOverlay + + + membership-description + Below is a list of users who have sent messages to the group. This list may not reflect all users who have access to the group. Message - - Could not send this message: + + dm-tooltip + Click to DM - - Acknowledged + + could-not-send-msg-error + Could not send this message - - Pending + + acknowledged-label + + + + + pending-label MyProfile - - copy + + copy-btn + Button for copying profile onion address to clipboard - - copied to clipboard! + + copied-clipboard-notification + Copied to clipboard - - new group + + new-group-btn + create new group button - - ... paste an address here to add a contact ... + + paste-address-to-add-contact + ex: "... paste an address here to add a contact ..." OverlayPane - - Do you want to accept the invitation to + + accept-group-invite-label + Do you want to accept the invitation to $GROUP - - Accept + + accept-group-btn + Accept group invite button - - Reject - - - - - Chat + + reject-group-btn + Reject Group invite button - Lists + chat-btn - Bulletins + lists-btn - Puzzle Game + bulletins-btn + + + + + puzzle-game-btn @@ -172,60 +225,64 @@ PeerSettingsPane - Address: + address-label - copy + copy-btn - - copied to clipboard! + + copied-to-clipboard-notification + notification: copied to clipboard - - Display name: + + display-name-label - - Save + + save-btn - - delete + + delete-btn SettingsPane - - Cwtch Settings + + cwtch-settings-title + Cwtch Settings title - - Interface zoom (mostly affects text and button sizes): + + zoom-label + Interface zoom (mostly affects text and button sizes) - - Large text + + large-text-label - - Default size text (scale factor: + + default-scaling-text + "Default size text (scale factor: " - - Small text + + small-text-label diff --git a/i18n/translation_en.qm b/i18n/translation_en.qm index 9dad8df..86fa022 100644 Binary files a/i18n/translation_en.qm and b/i18n/translation_en.qm differ diff --git a/i18n/translation_en.ts b/i18n/translation_en.ts index 4c89e42..2f0174f 100644 --- a/i18n/translation_en.ts +++ b/i18n/translation_en.ts @@ -4,188 +4,286 @@ AddGroupPane - Create a new group - + + create-group-title + Create Group - Server: - + + server-label + Server label + Server - Group name: - + + group-name-label + Group name label + Group name - my awesome group - + + default-group-name + default suggested group name + Awesome Group - create - + + create-group-btn + create group button + Create BulletinOverlay - New Bulletin - + + new-bulletin-label + New Bulletin + + + + post-new-bulletin-label + Post a new Bulletin Post + Post new bulletin + + + + title-placeholder + title place holder text + title... GroupSettingsPane - Server: - + + server-label + Server - copy - + + + copy-btn + Copy - Invitation: - + + invitation-label + Invitation - Group name: - + + group-name-label + Group Name - Save - + + save-btn + Save - Invite someone to the group: - + + invite-to-group-label + Invite someone to the group + Invite to group - Invite - + + invite-btn + Invite - delete - + + delete-btn + Delete ListOverlay - Add a New List Item - + + add-list-item + Add a New List Item + Add a New List Item + + + + add-new-item + Add a new item to the list + Add a new item to the list + + + + todo-placeholder + Todo... placeholder text + Todo... + + + + MembershipOverlay + + + membership-description + Below is a list of users who have sent messages to the group. This list may not reflect all users who have access to the group. + Below is a list of users who have sent messages to the group. This list may not reflect all users who have access to the group. Message - Could not send this message: - + + dm-tooltip + Click to DM + Click to DM - Acknowledged - + + could-not-send-msg-error + Could not send this message + Could not send this message - Pending - + + acknowledged-label + Acknowledged + + + + pending-label + Pending MyProfile - copy - + + copy-btn + Button for copying profile onion address to clipboard + Copy - copied to clipboard! - + + copied-clipboard-notification + Copied to clipboard + Copied to clipboard - new group - + + new-group-btn + create new group button + Create new group - ... paste an address here to add a contact ... - + + paste-address-to-add-contact + ex: "... paste an address here to add a contact ..." + ... paste an address here to add a contact... OverlayPane - Do you want to accept the invitation to - + + accept-group-invite-label + Do you want to accept the invitation to $GROUP + Do you want to accept the invitation to - Accept - + + accept-group-btn + Accept group invite button + Accept - Reject - + + reject-group-btn + Reject Group invite button + Reject - Chat - + + chat-btn + Chat - Lists - + + lists-btn + Lists - Bulletins - + + bulletins-btn + Bulletins - Puzzle Game - + + puzzle-game-btn + Puzzle Game PeerSettingsPane - Address: - + + address-label + Address - copy - + + copy-btn + Copy - copied to clipboard! - + + copied-to-clipboard-notification + notification: copied to clipboard + Copied to Clipboard - Display name: - + + display-name-label + Display Name - Save - + + save-btn + Save - delete - + + delete-btn + Delete SettingsPane - Cwtch Settings - + + cwtch-settings-title + Cwtch Settings title + Cwtch Settings - Interface zoom (mostly affects text and button sizes): - + + zoom-label + Interface zoom (mostly affects text and button sizes) + Interface zoon (mostly affects text and button sizes) - Large text - + + large-text-label + Large - Default size text (scale factor: - + + default-scaling-text + "Default size text (scale factor: " + Default size text (scale factor: - Small text - + + small-text-label + Small diff --git a/qml.qrc b/qml.qrc index 13bf602..062de41 100644 --- a/qml.qrc +++ b/qml.qrc @@ -5,6 +5,7 @@ qml/overlays/Game1Overlay.qml qml/overlays/Game2Overlay.qml qml/overlays/ListOverlay.qml + qml/overlays/MembershipOverlay.qml qml/main.qml qml/panes/AddGroupPane.qml qml/panes/GroupSettingsPane.qml @@ -29,7 +30,7 @@ qml/widgets/controls/Loader.qml qml/widgets/controls/Text.qml qml/widgets/controls/Variables.qml - i18n/translation_en.qm - i18n/translation_de.qm + i18n/translation_en.qm + i18n/translation_de.qm diff --git a/qml/overlays/BulletinOverlay.qml b/qml/overlays/BulletinOverlay.qml index 640ff1a..3936f57 100644 --- a/qml/overlays/BulletinOverlay.qml +++ b/qml/overlays/BulletinOverlay.qml @@ -178,7 +178,7 @@ ColumnLayout { } GroupBox { - title: qsTr("New Bulletin") + title: qsTr("new-bulletin-label") Layout.fillWidth: true RowLayout { @@ -189,12 +189,14 @@ ColumnLayout { Text { - text: "Post a new Bulletin Post" + //: Post a new Bulletin Post + text: qsTr("post-new-bulletin-label") } TextField { id: newposttitle - placeholderText: "Title.." + //: title place holder text + placeholderText: qsTr("title-placeholder") Layout.fillWidth: true style: CwtchTextFieldStyle{} } diff --git a/qml/overlays/ListOverlay.qml b/qml/overlays/ListOverlay.qml index 4624436..2a6ea5d 100644 --- a/qml/overlays/ListOverlay.qml +++ b/qml/overlays/ListOverlay.qml @@ -158,7 +158,8 @@ ColumnLayout { } GroupBox { - title: qsTr("Add a New List Item") + //: Add a New List Item + title: qsTr("add-list-item") Layout.fillWidth: true RowLayout { @@ -169,12 +170,14 @@ ColumnLayout { Text { - text: "Add a new item to the list" + //: Add a new item to the list + text: qsTr("add-new-item") } TextField { id: newposttitle - placeholderText: "Todo.." + //: Todo... placeholder text + placeholderText: qsTr("todo-placeholder") Layout.fillWidth: true style: CwtchTextFieldStyle{} } diff --git a/qml/overlays/MembershipOverlay.qml b/qml/overlays/MembershipOverlay.qml index 97298af..6717a86 100644 --- a/qml/overlays/MembershipOverlay.qml +++ b/qml/overlays/MembershipOverlay.qml @@ -17,7 +17,8 @@ ColumnLayout { Layout.maximumWidth: parent.width horizontalAlignment: Text.AlignHCenter padding: 1 - text: qsTr("Below is a list of users who have sent messages to the group. This list may not reflect all users who have access to the group.") + //: Below is a list of users who have sent messages to the group. This list may not reflect all users who have access to the group. + text: qsTr("membership-description") } Flickable { // THE ACTUAL CONTACT LIST diff --git a/qml/panes/AddGroupPane.qml b/qml/panes/AddGroupPane.qml index 036aa83..e8e3ff0 100644 --- a/qml/panes/AddGroupPane.qml +++ b/qml/panes/AddGroupPane.qml @@ -14,7 +14,7 @@ ColumnLayout { // settingsPane StackToolbar { - text: qsTr("Create a new group") + text: qsTr("create-group-title") aux.visible: false } @@ -23,7 +23,8 @@ ColumnLayout { // settingsPane spacing: 5 ScalingLabel { - text: qsTr("Server:") + //: Server label + text: qsTr("server-label") + ":" } TextField { @@ -33,17 +34,20 @@ ColumnLayout { // settingsPane } ScalingLabel{ - text: qsTr("Group name:") + //: Group name label + text: qsTr("group-name-label") + ":" } TextField { id: txtGroupName style: CwtchTextFieldStyle{ width: 400 } - text: qsTr("my awesome group") + //: default suggested group name + text: qsTr("default-group-name") } SimpleButton { - text: qsTr("create") + //: create group button + text: qsTr("create-group-btn") onClicked: { gcd.createGroup(txtServer.text, txtGroupName.text) diff --git a/qml/panes/GroupSettingsPane.qml b/qml/panes/GroupSettingsPane.qml index 9fdfd62..3a7fd18 100644 --- a/qml/panes/GroupSettingsPane.qml +++ b/qml/panes/GroupSettingsPane.qml @@ -27,7 +27,7 @@ ColumnLayout { // groupSettingsPane spacing: 5 ScalingLabel { - text: qsTr("Server:") + text: qsTr("server-label") + ":" } TextField { @@ -38,17 +38,17 @@ ColumnLayout { // groupSettingsPane SimpleButton { icon: "regular/clipboard" - text: qsTr("copy") + text: qsTr("copy-btn") onClicked: { - gcd.popup("copied to clipboard!") + gcd.popup("copied-clipboard-notification") txtServer.selectAll() txtServer.copy() } } ScalingLabel { - text: qsTr("Invitation:") + text: qsTr("invitation-label") + ":" } TextField { @@ -59,17 +59,17 @@ ColumnLayout { // groupSettingsPane SimpleButton { icon: "regular/clipboard" - text: qsTr("copy") + text: qsTr("copy-btn") onClicked: { - gcd.popup("copied to clipboard!") + gcd.popup("copied-clipboard-notification") txtInvitation.selectAll() txtInvitation.copy() } } ScalingLabel{ - text: qsTr("Group name:") + text: qsTr("group-name-label") + ":" } TextField { @@ -78,7 +78,7 @@ ColumnLayout { // groupSettingsPane } SimpleButton { - text: qsTr("Save") + text: qsTr("save-btn") onClicked: { gcd.saveGroupSettings(groupID, txtGroupName.text) @@ -87,7 +87,8 @@ ColumnLayout { // groupSettingsPane } } - ScalingLabel { text: qsTr("Invite someone to the group:") } + //: Invite someone to the group + ScalingLabel { text: qsTr("invite-to-group-label") } ComboBox { id: cbInvite @@ -98,7 +99,7 @@ ColumnLayout { // groupSettingsPane } SimpleButton { - text: qsTr("Invite") + text: qsTr("invite-btn") onClicked: { gcd.inviteToGroup(addrbook[cbInvite.currentIndex], groupID) @@ -107,7 +108,7 @@ ColumnLayout { // groupSettingsPane SimpleButton { icon: "regular/trash-alt" - text: qsTr("delete") + text: qsTr("delete-btn") onClicked: { gcd.leaveGroup(groupID) diff --git a/qml/panes/OverlayPane.qml b/qml/panes/OverlayPane.qml index 33bfb6c..bbd4e36 100644 --- a/qml/panes/OverlayPane.qml +++ b/qml/panes/OverlayPane.qml @@ -40,11 +40,13 @@ ColumnLayout { Text { - text: qsTr("Do you want to accept the invitation to ") + overlay.name + "?" + //: Do you want to accept the invitation to $GROUP + text: qsTr("accept-group-invite-label") + " " + overlay.name + "?" } SimpleButton { - text: qsTr("Accept") + //: Accept group invite button + text: qsTr("accept-group-btn") icon: "regular/heart" onClicked: { gcd.acceptGroup(gcd.currentOpenConversation) @@ -53,7 +55,8 @@ ColumnLayout { } SimpleButton { - text: qsTr("Reject") + //: Reject Group invite button + text: qsTr("reject-group-btn") icon: "regular/trash-alt" onClicked: { gcd.leaveGroup(gcd.currentOpenConversation) @@ -67,28 +70,28 @@ ColumnLayout { SimpleButton { - text: qsTr("Chat") + text: qsTr("chat-btn") onClicked: overlayStack.overlay = overlayStack.chatOverlay } SimpleButton { - text: qsTr("Lists") + text: qsTr("lists-btn") onClicked: overlayStack.overlay = overlayStack.listOverlay } SimpleButton { - text: qsTr("Bulletins") + text: qsTr("bulletins-btn") onClicked: overlayStack.overlay = overlayStack.bulletinOverlay } SimpleButton { - text: qsTr("Puzzle Game") + text: qsTr("puzzle-game-btn") onClicked: overlayStack.overlay = overlayStack.game1Overlay diff --git a/qml/panes/PeerSettingsPane.qml b/qml/panes/PeerSettingsPane.qml index 6feec39..846a49e 100644 --- a/qml/panes/PeerSettingsPane.qml +++ b/qml/panes/PeerSettingsPane.qml @@ -26,7 +26,7 @@ ColumnLayout { // peerSettingsPane spacing: 5 ScalingLabel { - text: qsTr("Address:") + text: qsTr("address-label") } TextField { @@ -37,17 +37,18 @@ ColumnLayout { // peerSettingsPane SimpleButton { icon: "regular/clipboard" - text: qsTr("copy") + text: qsTr("copy-btn") onClicked: { - gcd.popup(qsTr("copied to clipboard!")) + //: notification: copied to clipboard + gcd.popup(qsTr("copied-to-clipboard-notification")) txtOnion.selectAll() txtOnion.copy() } } ScalingLabel{ - text: qsTr("Display name:") + text: qsTr("display-name-label") } TextField { @@ -56,7 +57,7 @@ ColumnLayout { // peerSettingsPane } SimpleButton { - text: qsTr("Save") + text: qsTr("save-btn") onClicked: { gcd.savePeerSettings(txtOnion.text, txtDisplayName.text) @@ -67,7 +68,7 @@ ColumnLayout { // peerSettingsPane SimpleButton { icon: "regular/trash-alt" - text: qsTr("delete") + text: qsTr("delete-btn") onClicked: { gcd.setAttribute(txtOnion.text, "deleted", "deleted") diff --git a/qml/panes/SettingsPane.qml b/qml/panes/SettingsPane.qml index 8d5c5ff..ffc18b2 100644 --- a/qml/panes/SettingsPane.qml +++ b/qml/panes/SettingsPane.qml @@ -13,7 +13,8 @@ ColumnLayout { // settingsPane StackToolbar { - text: qsTr("Cwtch Settings") + //: Cwtch Settings title + text: qsTr("cwtch-settings-title") aux.visible: false } @@ -23,7 +24,8 @@ ColumnLayout { // settingsPane ScalingLabel { Layout.maximumWidth: parent.width - text: qsTr("Interface zoom (mostly affects text and button sizes):") + //: Interface zoom (mostly affects text and button sizes) + text: qsTr("zoom-label") + ":" } Slider { @@ -39,16 +41,17 @@ ColumnLayout { // settingsPane } ScalingLabel { - text: qsTr("Large text") + text: qsTr("large-text-label") size: 20 } ScalingLabel{ - text: qsTr("Default size text (scale factor: ") + zoomSlider.value + ")" + //: "Default size text (scale factor: " + text: qsTr("default-scaling-text") + zoomSlider.value + ")" } ScalingLabel { - text: qsTr("Small text") + text: qsTr("small-text-label") size: 8 } diff --git a/qml/widgets/Message.qml b/qml/widgets/Message.qml index 92a7ed7..1142757 100644 --- a/qml/widgets/Message.qml +++ b/qml/widgets/Message.qml @@ -51,7 +51,8 @@ RowLayout { highlight: ima.containsMouse ToolTip.visible: ima.containsMouse - ToolTip.text: qsTr("Click to DM") + //: Click to DM + ToolTip.text: qsTr("dm-tooltip") MouseArea { id: ima @@ -149,7 +150,8 @@ RowLayout { sourceSize.height: 10 visible: fromMe ToolTip.visible: ma.containsMouse - ToolTip.text: root.error != "" ? qsTr("Could not send this message: ") + qsTr(root.error) : (root.ackd ? qsTr("Acknowledged") : qsTr("Pending")) + //: Could not send this message + ToolTip.text: root.error != "" ? qsTr("could-not-send-msg-error") + ":" + root.error : (root.ackd ? qsTr("acknowledged-label") : qsTr("pending-label")) MouseArea { id: ma anchors.fill: parent diff --git a/qml/widgets/MyProfile.qml b/qml/widgets/MyProfile.qml index 8c40a43..f76124f 100644 --- a/qml/widgets/MyProfile.qml +++ b/qml/widgets/MyProfile.qml @@ -165,10 +165,12 @@ ColumnLayout { SimpleButton { // COPY ONION ADDRESS BUTTON icon: "regular/clipboard" - text: qsTr("copy") + //: Button for copying profile onion address to clipboard + text: qsTr("copy-btn") onClicked: { - gcd.popup(qsTr("copied to clipboard!")) + //: Copied to clipboard + gcd.popup(qsTr("copied-clipboard-notification")) txtHidden.text = nick.replace(" ", "~") + "~" + onion txtHidden.selectAll() txtHidden.copy() @@ -197,7 +199,8 @@ ColumnLayout { SimpleButton { // CREATE GROUP BUTTON icon: "regular/clipboard" - text: qsTr("new group") + //: create new group button + text: qsTr("new-group-btn") onClicked: theStack.pane = theStack.addGroupPane } @@ -206,7 +209,8 @@ ColumnLayout { TextField { anchors.horizontalCenter: parent.horizontalCenter style: CwtchTextFieldStyle{ width: 400 } - placeholderText: qsTr("... paste an address here to add a contact ...") + //: ex: "... paste an address here to add a contact ..." + placeholderText: qsTr("paste-address-to-add-contact") horizontalAlignment: TextInput.AlignHCenter onTextChanged: { diff --git a/qml/widgets/SimpleButton.qml b/qml/widgets/SimpleButton.qml index 8fefb6d..2b3b67e 100644 --- a/qml/widgets/SimpleButton.qml +++ b/qml/widgets/SimpleButton.qml @@ -51,7 +51,7 @@ Rectangle { } ToolTip.visible: tooltip != "" && mouseArea.containsMouse - ToolTip.text: qsTr(tooltip) + ToolTip.text: tooltip }