Skip to content

Commit d6fb03e

Browse files
authored
Merge pull request #17943 from nvaccess/remoteTerminology
Fixes #17815 Summary of the issue: NVDA's new Remote Access feature currently uses inconsistent terminology. Description of user facing changes Remote Access: Is consistently referred to as "Remote Access". Uses the term "computer" to refer to clients. Previously both "computer" and "machine" were used. I also considered "device", as this seems to be the preferred terminology in Windows. Uses the word "send" instead of "push" for sending the clipboard to connected clients. Has descriptive help items for its menu items, all of which are complete sentences. Uses sentence fragments for UI messages where appropriate Description of development approach Generated a pot file, and searched for the word "remote" therein. If it was referring to Remote Access, and some other name was used, replaced it with Remote Access. Searched for the word "remote" in the user guide and edited as appropriate. Also did a full readthrough of the remote section. Reviewed the strings in the settings dialog, menu, and cues explicitly and edited as appropriate. Calculated the diff 1b4a28d...9833d78. Searched in it for newly introduced translator comments, and edited them if related to Remote Access and I thought they were unclear. Calculated the diff 9833d78...42aaea7. Reviewed it for any changed strings that used gettext (_(...)), and changed to use pgettext (pgettext("remote", ...)).
1 parent e00f275 commit d6fb03e

File tree

13 files changed

+147
-131
lines changed

13 files changed

+147
-131
lines changed

source/_remoteClient/client.py

Lines changed: 20 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -135,8 +135,8 @@ def pushClipboard(self):
135135
"""
136136
connector = self.followerTransport or self.leaderTransport
137137
if not getattr(connector, "connected", False):
138-
# Translators: Message shown when trying to push the clipboard to the remote computer while not connected.
139-
ui.message(_("Not connected."))
138+
# Translators: Message shown when trying to send the clipboard to the remote computer while not connected.
139+
ui.message(pgettext("remote", "Not connected"))
140140
return
141141
elif self.connectedClientsCount < 1:
142142
# Translators: Reported when performing a Remote Access action, but there are no other computers in the channel.
@@ -148,7 +148,7 @@ def pushClipboard(self):
148148
except (TypeError, OSError):
149149
log.debug("Unable to push clipboard", exc_info=True)
150150
# Translators: Message shown when clipboard content cannot be sent to the remote computer.
151-
ui.message(_("Unable to push clipboard"))
151+
ui.message(pgettext("remote", "Unable to send clipboard"))
152152

153153
def copyLink(self):
154154
"""Copy connection URL to clipboard.
@@ -158,7 +158,7 @@ def copyLink(self):
158158
session = self.leaderSession or self.followerSession
159159
if session is None:
160160
# Translators: Message shown when trying to copy the link to connect to the remote computer while not connected.
161-
ui.message(_("Not connected."))
161+
ui.message(pgettext("remote", "Not connected"))
162162
return
163163
url = session.getConnectionInfo().getURLToConnect()
164164
api.copyToClip(str(url))
@@ -228,7 +228,7 @@ def onConnectAsLeaderFailed(self):
228228
parent=gui.mainFrame,
229229
# Translators: Title of the connection error dialog.
230230
caption=_("Error Connecting"),
231-
# Translators: Message shown when cannot connect to the remote computer.
231+
# Translators: Message shown when unable to connect to the remote computer.
232232
message=_("Unable to connect to the remote computer"),
233233
style=wx.OK | wx.ICON_WARNING,
234234
)
@@ -529,10 +529,13 @@ def verifyAndConnect(self, conInfo: ConnectionInfo):
529529
"""
530530
if self.isConnected() or self.connecting:
531531
gui.messageBox(
532-
# Translators: Message shown when trying to connect while already connected.
533-
_("NVDA Remote is already connected. Disconnect before opening a new connection."),
532+
pgettext(
533+
"remote",
534+
# Translators: Message shown when trying to connect while already connected.
535+
"A Remote Access session is already in progress. Disconnect before starting a new session.",
536+
),
534537
# Translators: Title of the connection error dialog.
535-
_("NVDA Remote Already Connected"),
538+
pgettext("remote", "Already Connected"),
536539
wx.OK | wx.ICON_WARNING,
537540
)
538541
return
@@ -544,18 +547,22 @@ def verifyAndConnect(self, conInfo: ConnectionInfo):
544547

545548
# Prepare connection request message based on mode
546549
if conInfo.mode == ConnectionMode.LEADER:
547-
# Translators: Ask the user if they want to control the remote computer.
548-
question = _("Do you wish to control the machine on server {server} with key {key}?")
550+
question = pgettext(
551+
"remote",
552+
# Translators: Ask the user if they want to control the remote computer.
553+
"Do you wish to control the computer on server {server} with key {key}?",
554+
)
549555
else:
550-
question = _(
556+
question = pgettext(
557+
"remote",
551558
# Translators: Ask the user if they want to allow the remote computer to control this computer.
552-
"Do you wish to allow this machine to be controlled on server {server} with key {key}?",
559+
"Do you wish to allow this computer to be controlled on server {server} with key {key}?",
553560
)
554561

555562
question = question.format(server=serverAddr, key=key)
556563

557564
# Translators: Title of the connection request dialog.
558-
dialogTitle = _("NVDA Remote Connection Request")
565+
dialogTitle = pgettext("remote", "Remote Access Connection Request")
559566

560567
# Show confirmation dialog
561568
if (

source/_remoteClient/cues.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,16 +32,16 @@ class Cue(TypedDict, total=False):
3232
"controlServerConnected": {
3333
"wave": "controlled",
3434
"beeps": [(720, 100), (None, 50), (720, 100), (None, 50), (720, 100)],
35-
# Translators: Presented in direct (client to server) remote connection when the controlled computer is ready.
36-
"message": _("Connected to control server"),
35+
# Translators: Presented in direct (client to server) Remote Access connection when the controlled computer is ready.
36+
"message": pgettext("remote", "Connected as controlled computer"),
3737
},
3838
"clientConnected": {"wave": "controlling", "beeps": [(1000, 300)]},
3939
"clientDisconnected": {"wave": "disconnected", "beeps": [(108, 300)]},
4040
"clipboardPushed": {
4141
"wave": "clipboardPush",
4242
"beeps": [(500, 100), (600, 100)],
43-
# Translators: Message shown when the clipboard is successfully pushed to the remote computer.
44-
"message": _("Clipboard pushed"),
43+
# Translators: Message shown when the clipboard is successfully sent to the remote computer.
44+
"message": pgettext("remote", "Clipboard sent"),
4545
},
4646
"clipboardReceived": {
4747
"wave": "clipboardReceive",

source/_remoteClient/dialogs.py

Lines changed: 16 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ def __init__(self, parent: wx.Window | None = None, id: int = wx.ID_ANY):
4242
wx.ComboBox,
4343
)
4444
self.key = sizerHelper.addLabeledControl(
45-
# Translators: Label of the edit field to enter key (password) to secure the remote connection.
45+
# Translators: Label of the edit field to enter key (password) to secure the Remote Access connection.
4646
_("&Key:"),
4747
wx.TextCtrl,
4848
)
@@ -70,9 +70,9 @@ def _onGenerateKey(self, evt: wx.CommandEvent) -> None:
7070
def _generateKeyCommand(self, insecure: bool = False) -> None:
7171
self._keyGenerationProgressDialog = gui.IndeterminateProgressDialog(
7272
self,
73-
# Translators: Title of a dialog shown to users when asking a Remote control server to generate a key
73+
# Translators: Title of a dialog shown to users when asking a Remote Access server to generate a key
7474
pgettext("remote", "Generating key"),
75-
# Translators: Message on a dialog shown to users when asking a Remote control server to generate a key
75+
# Translators: Message on a dialog shown to users when asking a Remote Access server to generate a key
7676
pgettext("remote", "Generating key..."),
7777
)
7878
address = protocol.addressToHostPort(self.host.GetValue())
@@ -103,8 +103,8 @@ def _handleConnectionFailed(self) -> None:
103103
gui.messageBox(
104104
pgettext(
105105
"remote",
106-
# Translators: Message shown to users when requesting that a Remote control server generate a key fails.
107-
# {host} will be replaced with the address of the Remote control server.
106+
# Translators: Message shown to users when requesting that a Remote Access server generate a key fails.
107+
# {host} will be replaced with the address of the Remote Access server.
108108
"Unable to connect to {host}. Check that you have internet access, and that there are no mistakes in the host field.",
109109
).format(host=self.host.GetValue()),
110110
# Translators: Title of a dialog.
@@ -193,8 +193,8 @@ def __init__(self, parent: wx.Window | None = None, id: int = wx.ID_ANY):
193193
max=65535,
194194
initial=SERVER_PORT,
195195
)
196-
# Translators: Label of the edit field to enter key (password) to secure the remote connection.
197-
self.key = sizerHelper.addLabeledControl(_("&Key"), wx.TextCtrl)
196+
# Translators: Label of the edit field to enter key (password) to secure the Remote Access connection.
197+
self.key = sizerHelper.addLabeledControl(pgettext("remote", "&Key"), wx.TextCtrl)
198198
# Translators: The button used to generate a random key/password.
199199
self._generateKeyButton = wx.Button(parent=self, label=_("&Generate Key"))
200200
self._generateKeyButton.Bind(wx.EVT_BUTTON, self.onGenerateKey)
@@ -338,13 +338,13 @@ def _onOk(self, evt: wx.CommandEvent) -> None:
338338
if self._selectedPanel is self._clientPanel and (
339339
not self._selectedPanel.host.GetValue() or not self._selectedPanel.key.GetValue()
340340
):
341-
# Translators: A message box displayed when the host or key field is empty and the user tries to connect.
341+
# Translators: Message displayed when the host or key field is empty and the user tries to connect.
342342
message = _("Both host and key must be set.")
343343
focusTarget = self._selectedPanel.host
344344
elif self._selectedPanel is self._serverPanel and (
345345
not self._selectedPanel.port.GetValue() or not self._selectedPanel.key.GetValue()
346346
):
347-
# Translators: A message box displayed when the port or key field is empty and the user tries to connect.
347+
# Translators: Message displayed when the port or key field is empty and the user tries to connect.
348348
message = _("Both port and key must be set.")
349349
focusTarget = self._selectedPanel.port
350350
if message is not None:
@@ -389,11 +389,13 @@ def getConnectionInfo(self) -> ConnectionInfo:
389389

390390
class CertificateUnauthorizedDialog(wx.MessageDialog):
391391
def __init__(self, parent: wx.Window | None, fingerprint: str | None = None):
392-
# Translators: A title bar of a window presented when an attempt has been made to connect with a server with unauthorized certificate.
393-
title = _("NVDA Remote Connection Security Warning")
394-
message = _(
395-
# Translators: {fingerprint} is a SHA256 fingerprint of the server certificate.
396-
"The certificate of this server could not be verified. Using the wrong fingerprint may allow a third party to access the remote session..\n"
392+
# Translators: Title of the dialog presented when attempting to connect to a server with an untrusted certificate.
393+
title = pgettext("remote", "Security Warning")
394+
message = pgettext(
395+
"remote",
396+
# Translators: Message presented when attempting to connect to a server with an untrusted certificate.
397+
# {fingerprint} will be replaced with the SHA256 fingerprint of the server certificate.
398+
"The certificate of this server could not be verified. Using the wrong fingerprint may allow a third party to access the Remote Access session.\n"
397399
"\n"
398400
"Before continuing, please make sure that the following server certificate fingerprint is correct.\n"
399401
"Server SHA256 fingerprint: {fingerprint}\n"

source/_remoteClient/localMachine.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -256,6 +256,6 @@ def sendSAS(self) -> None:
256256
if hasUiAccess():
257257
ctypes.windll.sas.SendSAS(0)
258258
else:
259-
# Translators: Message displayed when a remote machine tries to send a SAS but UI Access is disabled.
259+
# Translators: Message displayed when a remote computer tries to send ctrl+alt+del but UI Access is disabled.
260260
ui.message(_("Unable to trigger Alt Control Delete from remote"))
261261
logger.warning("UI Access is disabled on this machine so cannot trigger CTRL+ALT+DEL")

source/_remoteClient/menu.py

Lines changed: 27 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -28,20 +28,20 @@ def __init__(self, client: "RemoteClient") -> None:
2828
self._switchToConnectItem()
2929
self.muteItem: wx.MenuItem = self.Append(
3030
wx.ID_ANY,
31-
# Translators: Menu item in NvDA Remote submenu to mute speech and sounds from the remote computer.
31+
# Translators: Menu item in Remote Access submenu to mute speech and sounds from the remote computer.
3232
_("Mute remote"),
33-
# Translators: Tooltip for the Mute Remote menu item in the NVDA Remote submenu.
34-
_("Mute speech and sounds from the remote computer"),
33+
# Translators: Tooltip for the Mute Remote menu item in the Remote Access submenu.
34+
pgettext("remote", "Mute speech and sounds from the remote computer."),
3535
kind=wx.ITEM_CHECK,
3636
)
3737
self.muteItem.Enable(False)
3838
sysTrayIcon.Bind(wx.EVT_MENU, self.onMuteItem, self.muteItem)
3939
self.pushClipboardItem: wx.MenuItem = self.Append(
4040
wx.ID_ANY,
41-
# Translators: Menu item in NVDA Remote submenu to push clipboard content to the remote computer.
42-
_("&Push clipboard"),
43-
# Translators: Tooltip for the Push Clipboard menu item in the NVDA Remote submenu.
44-
_("Push the clipboard to the other machine"),
41+
# Translators: Menu item in the Remote Access submenu to send the contents of the clipboard to the remote computer.
42+
pgettext("remote", "&Send clipboard"),
43+
# Translators: Tooltip for the Send clipboard menu item in the Remote Access submenu.
44+
pgettext("remote", "Send the clipboard text to the remote computer."),
4545
)
4646
self.pushClipboardItem.Enable(False)
4747
sysTrayIcon.Bind(
@@ -51,10 +51,10 @@ def __init__(self, client: "RemoteClient") -> None:
5151
)
5252
self.copyLinkItem: wx.MenuItem = self.Append(
5353
wx.ID_ANY,
54-
# Translators: Menu item in NVDA Remote submenu to copy a link to the current session.
54+
# Translators: Menu item in the Remote Access submenu to copy a link to the current session.
5555
_("Copy &link"),
56-
# Translators: Tooltip for the Copy Link menu item in the NVDA Remote submenu.
57-
_("Copy a link to the remote session"),
56+
# Translators: Tooltip for the Copy Link menu item in the Remote Access submenu.
57+
pgettext("remote", "Copy a link to the current Remote Access session to the clipboard."),
5858
)
5959
self.copyLinkItem.Enable(False)
6060
sysTrayIcon.Bind(
@@ -64,10 +64,10 @@ def __init__(self, client: "RemoteClient") -> None:
6464
)
6565
self.sendCtrlAltDelItem: wx.MenuItem = self.Append(
6666
wx.ID_ANY,
67-
# Translators: Menu item in NVDA Remote submenu to send Control+Alt+Delete to the remote computer.
68-
_("Send Ctrl+Alt+Del"),
69-
# Translators: Tooltip for the Send Ctrl+Alt+Del menu item in the NVDA Remote submenu.
70-
_("Send Ctrl+Alt+Del"),
67+
# Translators: Menu item in the Remote Access submenu to send Control+Alt+Delete to the remote computer.
68+
pgettext("remote", "Send ctrl+alt+del"),
69+
# Translators: Tooltip for the Send Ctrl+Alt+Del menu item in the Remote Access submenu.
70+
pgettext("remote", "Send control+alt+delete to the controlled computer."),
7171
)
7272
sysTrayIcon.Bind(
7373
wx.EVT_MENU,
@@ -77,10 +77,13 @@ def __init__(self, client: "RemoteClient") -> None:
7777
self.sendCtrlAltDelItem.Enable(False)
7878
self.remoteItem = toolsMenu.AppendSubMenu(
7979
self,
80-
# Translators: Label of menu in NVDA tools menu.
81-
_("R&emote"),
82-
# Translators: Tooltip for the Remote menu in the NVDA Tools menu.
83-
_("NVDA Remote Access"),
80+
# Translators: Label of the Remote Access submenu in the NVDA tools menu.
81+
pgettext("remote", "R&emote Access"),
82+
pgettext(
83+
"remote",
84+
# Translators: Tooltip for the Remote Access submenu in the NVDA Tools menu.
85+
"Allow someone to control this computer from elsewhere, or control another computer running NVDA with this one.",
86+
),
8487
)
8588

8689
def terminate(self) -> None:
@@ -149,10 +152,10 @@ def _switchToConnectItem(self):
149152
Sets the label, help text and event bindings of the connection item
150153
to those appropriate for creating a new Remote session.
151154
"""
152-
# Translators: Item in NVDA Remote submenu to connect to a remote computer.
155+
# Translators: Item in the Remote Access submenu to connect to another computer.
153156
self.connectionItem.SetItemLabel(_("Connect..."))
154-
# Translators: Tooltip for the Connect menu item in the NVDA Remote submenu.
155-
self.connectionItem.SetHelp(_("Remotely connect to another computer running NVDA Remote Access"))
157+
# Translators: Tooltip for the Connect menu item in the Remote Access submenu.
158+
self.connectionItem.SetHelp(pgettext("remote", "Remotely connect to another computer running NVDA."))
156159
gui.mainFrame.sysTrayIcon.Unbind(wx.EVT_MENU, self.connectionItem)
157160
gui.mainFrame.sysTrayIcon.Bind(
158161
wx.EVT_MENU,
@@ -169,10 +172,10 @@ def _switchToDisconnectItem(self):
169172
Sets the label, help text and event bindings of the connection item
170173
to those appropriate for disconnecting an existing Remote session.
171174
"""
172-
# Translators: Menu item in NVDA Remote submenu to disconnect from another computer running NVDA Remote Access.
175+
# Translators: Menu item in the Remote Access submenu to disconnect from another computer running NVDA.
173176
self.connectionItem.SetItemLabel(_("Disconnect"))
174-
# Translators: Tooltip for the Disconnect menu item in the NVDA Remote submenu.
175-
self.connectionItem.SetHelp(_("Disconnect from another computer running NVDA Remote Access"))
177+
# Translators: Tooltip for the Disconnect menu item in the Remote Access submenu.
178+
self.connectionItem.SetHelp(pgettext("remote", "Disconnect from the current Remote Access session."))
176179
gui.mainFrame.sysTrayIcon.Unbind(wx.EVT_MENU, self.connectionItem)
177180
gui.mainFrame.sysTrayIcon.Bind(
178181
wx.EVT_MENU,

source/_remoteClient/session.py

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -162,9 +162,11 @@ def handleVersionMismatch(self) -> None:
162162
"""
163163
log.error("Protocol version mismatch detected with relay server")
164164
ui.message(
165-
# Translators: Message for version mismatch
166-
_("""The version of the relay server which you have connected to is not compatible with this version of the Remote Client.
167-
Please use a different server."""),
165+
pgettext(
166+
"remote",
167+
# Translators: Message presented when attempting to connect to an incompatible Remote Access server.
168+
"The Remote Access server you have connected to is not compatible with this version of NVDA. Please use a different server.",
169+
),
168170
)
169171
self.transport.close()
170172

@@ -182,8 +184,8 @@ def handleMOTD(self, motd: str, force_display: bool = False) -> None:
182184
if force_display or self.shouldDisplayMotd(motd):
183185
gui.messageBox(
184186
parent=gui.mainFrame,
185-
# Translators: Caption for message of the day dialog
186-
caption=_("Message of the Day"),
187+
# Translators: Title of a dialog showing a message sent by a Remote Access server.
188+
caption=pgettext("remote", "Message from Remote Access Server"),
187189
message=motd,
188190
)
189191

@@ -548,7 +550,7 @@ def handleNVDANotConnected(self) -> None:
548550
speech.cancelSpeech()
549551
ui.message(
550552
# Translators: Message for when the remote NVDA is not connected
551-
_("Remote NVDA not connected."),
553+
pgettext("remote", "Remote NVDA not connected"),
552554
)
553555

554556
def handleChannelJoined(

source/config/configFlags.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -318,10 +318,10 @@ class RemoteConnectionMode(DisplayStringIntEnum):
318318
@property
319319
def _displayStringLabels(self):
320320
return {
321-
# Translators: Allow this computer to be controlled by the remote computer.
322-
RemoteConnectionMode.FOLLOWER: pgettext("remote", "Allow this machine to be controlled"),
323-
# Translators: Allow this computer to control the remote computer.
324-
RemoteConnectionMode.LEADER: pgettext("remote", "Control another machine"),
321+
# Translators: Option that allows this computer to be controlled by the remote computer.
322+
RemoteConnectionMode.FOLLOWER: pgettext("remote", "Allow this computer to be controlled"),
323+
# Translators: Option that allows this computer to control the remote computer.
324+
RemoteConnectionMode.LEADER: pgettext("remote", "Control another computer"),
325325
}
326326

327327
def toConnectionMode(self) -> "_remoteClient.connectionInfo.ConnectionMode":

source/core.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -564,7 +564,7 @@ def _handleNVDAModuleCleanupBeforeGUIExit():
564564
_terminate(globalPluginHandler)
565565
# the brailleViewer should be destroyed safely before closing the window
566566
brailleViewer.destroyBrailleViewer()
567-
# Terminating remote causes it to clean up its menus, so do it here while they still exist
567+
# Terminating remoteClient causes it to clean up its menus, so do it here while they still exist
568568
_terminate(_remoteClient)
569569

570570

0 commit comments

Comments
 (0)