Skip to content

Commit

Permalink
Merge pull request #1334 from Scille/gui-fix-device-invite-translations
Browse files Browse the repository at this point in the history
Fixed device invitation texts
  • Loading branch information
AntoineDupre authored Aug 6, 2020
2 parents 5aca1b8 + d43a17c commit d91189b
Show file tree
Hide file tree
Showing 7 changed files with 177 additions and 58 deletions.
1 change: 1 addition & 0 deletions newsfragments/1304.misc.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Updated instructions texts for the device invitation process
36 changes: 29 additions & 7 deletions parsec/core/gui/forms/greet_device_instructions_widget.ui
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,15 @@
<x>0</x>
<y>0</y>
<width>400</width>
<height>227</height>
<height>259</height>
</rect>
</property>
<property name="windowTitle">
<string>Form</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout">
<property name="spacing">
<number>10</number>
<number>15</number>
</property>
<property name="leftMargin">
<number>0</number>
Expand All @@ -38,7 +38,13 @@
</sizepolicy>
</property>
<property name="text">
<string>TEXT_GREET_DEVICE_INSTRUCTIONS</string>
<string>TEXT_GREET_DEVICE_INSTRUCTIONS_email</string>
</property>
<property name="textFormat">
<enum>Qt::RichText</enum>
</property>
<property name="alignment">
<set>Qt::AlignJustify|Qt::AlignVCenter</set>
</property>
<property name="wordWrap">
<bool>true</bool>
Expand All @@ -61,16 +67,16 @@
</spacer>
</item>
<item>
<widget class="QPushButton" name="button_copy_addr">
<widget class="QPushButton" name="button_send_email">
<property name="text">
<string>ACTION_COPY_ADDR</string>
<string>ACTION_SEND_EMAIL</string>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="button_send_email">
<widget class="QPushButton" name="button_copy_addr">
<property name="text">
<string>ACTION_SEND_EMAIL</string>
<string>ACTION_COPY_ADDR</string>
</property>
</widget>
</item>
Expand All @@ -89,6 +95,22 @@
</item>
</layout>
</item>
<item>
<widget class="QLabel" name="label">
<property name="text">
<string>TEXT_GREET_DEVICE_INSTRUCTIONS_START</string>
</property>
<property name="textFormat">
<enum>Qt::RichText</enum>
</property>
<property name="alignment">
<set>Qt::AlignJustify|Qt::AlignVCenter</set>
</property>
<property name="wordWrap">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
Expand Down
7 changes: 7 additions & 0 deletions parsec/core/gui/greet_device_widget.py
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,13 @@ def __init__(self, jobs_ctx, greeter, invite_addr, core):
# Hide the send email button if the user has no human_handle (hand hence no email)
if not self.core.device.human_handle:
self.button_send_email.hide()
self.label_instructions.setText(_("TEXT_GREET_DEVICE_INSTRUCTIONS_NO_EMAIL"))
else:
self.label_instructions.setText(
_("TEXT_GREET_DEVICE_INSTRUCTIONS_email").format(
email=self.core.device.human_handle.email
)
)
self.button_copy_addr.clicked.connect(self._on_copy_addr_clicked)

def _on_copy_addr_clicked(self):
Expand Down
57 changes: 42 additions & 15 deletions parsec/core/gui/tr/parsec_en.po
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ msgid ""
msgstr ""
"Project-Id-Version: PROJECT VERSION\n"
"Report-Msgid-Bugs-To: EMAIL@ADDRESS\n"
"POT-Creation-Date: 2020-07-24 11:13+0200\n"
"PO-Revision-Date: 2020-07-24 11:17+0200\n"
"POT-Creation-Date: 2020-08-06 10:09+0200\n"
"PO-Revision-Date: 2020-08-03 13:43+0200\n"
"Last-Translator: \n"
"Language: en\n"
"Language-Team: en <[email protected]>\n"
Expand Down Expand Up @@ -219,7 +219,9 @@ msgid "TEXT_GREET_USER_SIGNIFY_TRUST_ERROR"
msgstr "Error while acknowledging SAS code. Please restart the process."

msgid "TEXT_GREET_USER_WAIT_PEER_TRUST_ERROR"
msgstr "Error while waiting for peer SAS code acknowledgment. Please restart the process."
msgstr ""
"Error while waiting for peer SAS code acknowledgment. Please restart the "
"process."

msgid "TEXT_USER_GREET_SUCCESSFUL"
msgstr "The user was successfully greeter in your organization."
Expand Down Expand Up @@ -365,7 +367,9 @@ msgid "TEXT_CLAIM_USER_SIGNIFY_TRUST_ERROR"
msgstr "Error while acknowledging SAS code. Please restart the process."

msgid "TEXT_CLAIM_USER_WAIT_PEER_TRUST_ERROR"
msgstr "Error while waiting for peer SAS code acknowledgment. Please restart the process."
msgstr ""
"Error while waiting for peer SAS code acknowledgment. Please restart the "
"process."

msgid "TEXT_CLAIM_USER_INVALID_HUMAN_HANDLE"
msgstr "The email is invalid."
Expand Down Expand Up @@ -516,6 +520,28 @@ msgstr "Workspace"
msgid "ACTION_WORKSPACE_NEW_CREATE"
msgstr "Create"

msgid "TEXT_GREET_DEVICE_INSTRUCTIONS_NO_EMAIL"
msgstr ""
"To greet your new device, Parsec needs to be started on both devices.\n"
"<br /><br />\n"
"You will have to exchange codes between the two devices. This way, we can"
" be certain that the process is secure.\n"
"<br /><br />\n"
"To get the invitation link, click the <i>Copy invitation link to the "
"clipboard</i> button below and transfer it to your new device."

msgid "TEXT_GREET_DEVICE_INSTRUCTIONS_email"
msgstr ""
"To greet your new device, Parsec needs to be started on both devices.\n"
"<br /><br />\n"
"You will have to exchange codes between the two devices. This way, we can"
" be certain that the process is secure.\n"
"<br /><br />\n"
"To get the invitation link to you new device, you can either transfer it "
"manually by clicking the <i>Copy invitation link to the clipboard</i> "
"button, or we can send an email with the link to <b>{email}</b> by "
"clicking the <i>Send an email</i> button."

msgid "TEXT_GREET_DEVICE_ADDR_COPIED_TO_CLIPBOARD"
msgstr "The invitation link has been copied to the clipboard"

Expand All @@ -529,7 +555,9 @@ msgid "TEXT_GREET_DEVICE_WAITING"
msgstr "Waiting for the new device..."

msgid "TEXT_GREET_DEVICE_WAIT_PEER_ERROR"
msgstr "An error occured while waiting for the other user. Please restart the process "
msgstr ""
"An error occured while waiting for the other user. Please restart the "
"process "

msgid "TEXT_GREET_DEVICE_PEER_RESET"
msgstr "The invitee has reset the process.. We will restart from the beginning."
Expand Down Expand Up @@ -557,7 +585,9 @@ msgid "TEXT_GREET_DEVICE_SIGNIFY_TRUST_ERROR"
msgstr "Error while acknowledging SAS code. Please restart the process."

msgid "TEXT_GREET_DEVICE_WAIT_PEER_TRUST_ERROR"
msgstr "Error while waiting for peer SAS code acknowledgment. Please restart the process."
msgstr ""
"Error while waiting for peer SAS code acknowledgment. Please restart the "
"process."

msgid "TEXT_DEVICE_GREET_SUCCESSFUL"
msgstr "The device was successfully created."
Expand Down Expand Up @@ -1656,7 +1686,9 @@ msgid "TEXT_CLAIM_DEVICE_SIGNIFY_TRUST_ERROR"
msgstr "Error while acknowledging SAS code. Please restart the process."

msgid "TEXT_CLAIM_DEVICE_WAIT_PEER_TRUST_ERROR"
msgstr "Error while waiting for peer SAS code acknowledgment. Please restart the process."
msgstr ""
"Error while waiting for peer SAS code acknowledgment. Please restart the "
"process."

msgid "TEXT_CLAIM_DEVICE_CLAIM_ERROR"
msgstr "Error while validating invite information. Please restart the process."
Expand Down Expand Up @@ -2145,13 +2177,10 @@ msgstr "Copy invitation link to the clipboard"
msgid "ACTION_SEND_EMAIL"
msgstr "Send an email"

msgid "TEXT_GREET_DEVICE_INSTRUCTIONS"
msgid "TEXT_GREET_DEVICE_INSTRUCTIONS_START"
msgstr ""
"To greet your new device, Parsec needs to be started on both devices.\n"
"\n"
"You will have to exchange codes between the two devices. This way, we can"
" be certain that the process is secure.\n"
"When you are ready, click Start."
"Once Parsec is installed on your other device and you've clicked on the "
"invitation link, you can click <i>Start</i> to begin the process."

msgid "TEXT_GREET_USER_WAITING_FOR_INFO"
msgstr ""
Expand Down Expand Up @@ -2340,5 +2369,3 @@ msgstr "Create a new workspace"
msgid "ACTION_WORKSPACE_GOTO_FILE_LINK"
msgstr "Go to a file using a link"

#~ msgid "TEXT_GREET_USER_ADDR_COPIED_TO_CLIPBOARD"
#~ msgstr "The invitation link has been copied to the clipboard"
13 changes: 9 additions & 4 deletions parsec/core/gui/tr/parsec_en.ts
Original file line number Diff line number Diff line change
Expand Up @@ -637,23 +637,28 @@ p, li { white-space: pre-wrap; }
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../forms/greet_device_instructions_widget.ui" line="66"/>
<location filename="../forms/greet_device_instructions_widget.ui" line="79"/>
<source>ACTION_COPY_ADDR</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../forms/greet_device_instructions_widget.ui" line="73"/>
<location filename="../forms/greet_device_instructions_widget.ui" line="72"/>
<source>ACTION_SEND_EMAIL</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../forms/greet_device_instructions_widget.ui" line="110"/>
<location filename="../forms/greet_device_instructions_widget.ui" line="132"/>
<source>ACTION_START</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../forms/greet_device_instructions_widget.ui" line="101"/>
<source>TEXT_GREET_DEVICE_INSTRUCTIONS_START</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../forms/greet_device_instructions_widget.ui" line="41"/>
<source>TEXT_GREET_DEVICE_INSTRUCTIONS</source>
<source>TEXT_GREET_DEVICE_INSTRUCTIONS_email</source>
<translation type="unfinished"></translation>
</message>
</context>
Expand Down
Loading

0 comments on commit d91189b

Please sign in to comment.