Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 20 additions & 13 deletions source/_remoteClient/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -134,8 +134,8 @@ def pushClipboard(self):
"""
connector = self.followerTransport or self.leaderTransport
if not getattr(connector, "connected", False):
# Translators: Message shown when trying to push the clipboard to the remote computer while not connected.
ui.message(_("Not connected."))
# Translators: Message shown when trying to send the clipboard to the remote computer while not connected.
ui.message(pgettext("remote", "Not connected"))
return
elif self.connectedClientsCount < 1:
# Translators: Reported when performing a Remote Access action, but there are no other computers in the channel.
Expand All @@ -147,7 +147,7 @@ def pushClipboard(self):
except (TypeError, OSError):
log.debug("Unable to push clipboard", exc_info=True)
# Translators: Message shown when clipboard content cannot be sent to the remote computer.
ui.message(_("Unable to push clipboard"))
ui.message(pgettext("remote", "Unable to send clipboard"))

def copyLink(self):
"""Copy connection URL to clipboard.
Expand All @@ -157,7 +157,7 @@ def copyLink(self):
session = self.leaderSession or self.followerSession
if session is None:
# Translators: Message shown when trying to copy the link to connect to the remote computer while not connected.
ui.message(_("Not connected."))
ui.message(pgettext("remote", "Not connected"))
return
url = session.getConnectionInfo().getURLToConnect()
api.copyToClip(str(url))
Expand Down Expand Up @@ -227,7 +227,7 @@ def onConnectAsLeaderFailed(self):
parent=gui.mainFrame,
# Translators: Title of the connection error dialog.
caption=_("Error Connecting"),
# Translators: Message shown when cannot connect to the remote computer.
# Translators: Message shown when unable to connect to the remote computer.
message=_("Unable to connect to the remote computer"),
style=wx.OK | wx.ICON_WARNING,
)
Expand Down Expand Up @@ -522,10 +522,13 @@ def verifyAndConnect(self, conInfo: ConnectionInfo):
"""
if self.isConnected() or self.connecting:
gui.messageBox(
# Translators: Message shown when trying to connect while already connected.
_("NVDA Remote is already connected. Disconnect before opening a new connection."),
pgettext(
"remote",
# Translators: Message shown when trying to connect while already connected.
"A Remote Access session is already in progress. Disconnect before starting a new session.",
),
# Translators: Title of the connection error dialog.
_("NVDA Remote Already Connected"),
pgettext("remote", "Already Connected"),
wx.OK | wx.ICON_WARNING,
)
return
Expand All @@ -537,18 +540,22 @@ def verifyAndConnect(self, conInfo: ConnectionInfo):

# Prepare connection request message based on mode
if conInfo.mode == ConnectionMode.LEADER:
# Translators: Ask the user if they want to control the remote computer.
question = _("Do you wish to control the machine on server {server} with key {key}?")
question = pgettext(
"remote",
# Translators: Ask the user if they want to control the remote computer.
"Do you wish to control the computer on server {server} with key {key}?",
)
else:
question = _(
question = pgettext(
"remote",
# Translators: Ask the user if they want to allow the remote computer to control this computer.
"Do you wish to allow this machine to be controlled on server {server} with key {key}?",
"Do you wish to allow this computer to be controlled on server {server} with key {key}?",
)

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

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

# Show confirmation dialog
if (
Expand Down
8 changes: 4 additions & 4 deletions source/_remoteClient/cues.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,16 +32,16 @@ class Cue(TypedDict, total=False):
"controlServerConnected": {
"wave": "controlled",
"beeps": [(720, 100), (None, 50), (720, 100), (None, 50), (720, 100)],
# Translators: Presented in direct (client to server) remote connection when the controlled computer is ready.
"message": _("Connected to control server"),
# Translators: Presented in direct (client to server) Remote Access connection when the controlled computer is ready.
"message": pgettext("remote", "Connected as controlled computer"),
},
"clientConnected": {"wave": "controlling", "beeps": [(1000, 300)]},
"clientDisconnected": {"wave": "disconnected", "beeps": [(108, 300)]},
"clipboardPushed": {
"wave": "clipboardPush",
"beeps": [(500, 100), (600, 100)],
# Translators: Message shown when the clipboard is successfully pushed to the remote computer.
"message": _("Clipboard pushed"),
# Translators: Message shown when the clipboard is successfully sent to the remote computer.
"message": pgettext("remote", "Clipboard sent"),
},
"clipboardReceived": {
"wave": "clipboardReceive",
Expand Down
30 changes: 16 additions & 14 deletions source/_remoteClient/dialogs.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ def __init__(self, parent: wx.Window | None = None, id: int = wx.ID_ANY):
wx.ComboBox,
)
self.key = sizerHelper.addLabeledControl(
# Translators: Label of the edit field to enter key (password) to secure the remote connection.
# Translators: Label of the edit field to enter key (password) to secure the Remote Access connection.
_("&Key:"),
wx.TextCtrl,
)
Expand Down Expand Up @@ -70,9 +70,9 @@ def _onGenerateKey(self, evt: wx.CommandEvent) -> None:
def _generateKeyCommand(self, insecure: bool = False) -> None:
self._keyGenerationProgressDialog = gui.IndeterminateProgressDialog(
self,
# Translators: Title of a dialog shown to users when asking a Remote control server to generate a key
# Translators: Title of a dialog shown to users when asking a Remote Access server to generate a key
pgettext("remote", "Generating key"),
# Translators: Message on a dialog shown to users when asking a Remote control server to generate a key
# Translators: Message on a dialog shown to users when asking a Remote Access server to generate a key
pgettext("remote", "Generating key..."),
)
address = protocol.addressToHostPort(self.host.GetValue())
Expand Down Expand Up @@ -103,8 +103,8 @@ def _handleConnectionFailed(self) -> None:
gui.messageBox(
pgettext(
"remote",
# Translators: Message shown to users when requesting that a Remote control server generate a key fails.
# {host} will be replaced with the address of the Remote control server.
# Translators: Message shown to users when requesting that a Remote Access server generate a key fails.
# {host} will be replaced with the address of the Remote Access server.
"Unable to connect to {host}. Check that you have internet access, and that there are no mistakes in the host field.",
).format(host=self.host.GetValue()),
# Translators: Title of a dialog.
Expand Down Expand Up @@ -193,8 +193,8 @@ def __init__(self, parent: wx.Window | None = None, id: int = wx.ID_ANY):
max=65535,
initial=SERVER_PORT,
)
# Translators: Label of the edit field to enter key (password) to secure the remote connection.
self.key = sizerHelper.addLabeledControl(_("&Key"), wx.TextCtrl)
# Translators: Label of the edit field to enter key (password) to secure the Remote Access connection.
self.key = sizerHelper.addLabeledControl(pgettext("remote", "&Key"), wx.TextCtrl)
# Translators: The button used to generate a random key/password.
self._generateKeyButton = wx.Button(parent=self, label=_("&Generate Key"))
self._generateKeyButton.Bind(wx.EVT_BUTTON, self.onGenerateKey)
Expand Down Expand Up @@ -338,13 +338,13 @@ def _onOk(self, evt: wx.CommandEvent) -> None:
if self._selectedPanel is self._clientPanel and (
not self._selectedPanel.host.GetValue() or not self._selectedPanel.key.GetValue()
):
# Translators: A message box displayed when the host or key field is empty and the user tries to connect.
# Translators: Message displayed when the host or key field is empty and the user tries to connect.
message = _("Both host and key must be set.")
focusTarget = self._selectedPanel.host
elif self._selectedPanel is self._serverPanel and (
not self._selectedPanel.port.GetValue() or not self._selectedPanel.key.GetValue()
):
# Translators: A message box displayed when the port or key field is empty and the user tries to connect.
# Translators: Message displayed when the port or key field is empty and the user tries to connect.
message = _("Both port and key must be set.")
focusTarget = self._selectedPanel.port
if message is not None:
Expand Down Expand Up @@ -389,11 +389,13 @@ def getConnectionInfo(self) -> ConnectionInfo:

class CertificateUnauthorizedDialog(wx.MessageDialog):
def __init__(self, parent: wx.Window | None, fingerprint: str | None = None):
# Translators: A title bar of a window presented when an attempt has been made to connect with a server with unauthorized certificate.
title = _("NVDA Remote Connection Security Warning")
message = _(
# Translators: {fingerprint} is a SHA256 fingerprint of the server certificate.
"The certificate of this server could not be verified. Using the wrong fingerprint may allow a third party to access the remote session..\n"
# Translators: Title of the dialog presented when attempting to connect to a server with an untrusted certificate.
title = pgettext("remote", "Security Warning")
message = pgettext(
"remote",
# Translators: Message presented when attempting to connect to a server with an untrusted certificate.
# {fingerprint} will be replaced with the SHA256 fingerprint of the server certificate.
"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"
"\n"
"Before continuing, please make sure that the following server certificate fingerprint is correct.\n"
"Server SHA256 fingerprint: {fingerprint}\n"
Expand Down
2 changes: 1 addition & 1 deletion source/_remoteClient/localMachine.py
Original file line number Diff line number Diff line change
Expand Up @@ -256,6 +256,6 @@ def sendSAS(self) -> None:
if hasUiAccess():
ctypes.windll.sas.SendSAS(0)
else:
# Translators: Message displayed when a remote machine tries to send a SAS but UI Access is disabled.
# Translators: Message displayed when a remote computer tries to send ctrl+alt+del but UI Access is disabled.
ui.message(_("Unable to trigger Alt Control Delete from remote"))
logger.warning("UI Access is disabled on this machine so cannot trigger CTRL+ALT+DEL")
51 changes: 27 additions & 24 deletions source/_remoteClient/menu.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,20 +27,20 @@ def __init__(self, client: "RemoteClient") -> None:
self._switchToConnectItem()
self.muteItem: wx.MenuItem = self.Append(
wx.ID_ANY,
# Translators: Menu item in NvDA Remote submenu to mute speech and sounds from the remote computer.
# Translators: Menu item in Remote Access submenu to mute speech and sounds from the remote computer.
_("Mute remote"),
# Translators: Tooltip for the Mute Remote menu item in the NVDA Remote submenu.
_("Mute speech and sounds from the remote computer"),
# Translators: Tooltip for the Mute Remote menu item in the Remote Access submenu.
pgettext("remote", "Mute speech and sounds from the remote computer."),
kind=wx.ITEM_CHECK,
)
self.muteItem.Enable(False)
sysTrayIcon.Bind(wx.EVT_MENU, self.onMuteItem, self.muteItem)
self.pushClipboardItem: wx.MenuItem = self.Append(
wx.ID_ANY,
# Translators: Menu item in NVDA Remote submenu to push clipboard content to the remote computer.
_("&Push clipboard"),
# Translators: Tooltip for the Push Clipboard menu item in the NVDA Remote submenu.
_("Push the clipboard to the other machine"),
# Translators: Menu item in the Remote Access submenu to send the contents of the clipboard to the remote computer.
pgettext("remote", "&Send clipboard"),
# Translators: Tooltip for the Send clipboard menu item in the Remote Access submenu.
pgettext("remote", "Send the clipboard text to the remote computer."),
)
self.pushClipboardItem.Enable(False)
sysTrayIcon.Bind(
Expand All @@ -50,10 +50,10 @@ def __init__(self, client: "RemoteClient") -> None:
)
self.copyLinkItem: wx.MenuItem = self.Append(
wx.ID_ANY,
# Translators: Menu item in NVDA Remote submenu to copy a link to the current session.
# Translators: Menu item in the Remote Access submenu to copy a link to the current session.
_("Copy &link"),
# Translators: Tooltip for the Copy Link menu item in the NVDA Remote submenu.
_("Copy a link to the remote session"),
# Translators: Tooltip for the Copy Link menu item in the Remote Access submenu.
pgettext("remote", "Copy a link to the current Remote Access session to the clipboard."),
)
self.copyLinkItem.Enable(False)
sysTrayIcon.Bind(
Expand All @@ -63,10 +63,10 @@ def __init__(self, client: "RemoteClient") -> None:
)
self.sendCtrlAltDelItem: wx.MenuItem = self.Append(
wx.ID_ANY,
# Translators: Menu item in NVDA Remote submenu to send Control+Alt+Delete to the remote computer.
_("Send Ctrl+Alt+Del"),
# Translators: Tooltip for the Send Ctrl+Alt+Del menu item in the NVDA Remote submenu.
_("Send Ctrl+Alt+Del"),
# Translators: Menu item in the Remote Access submenu to send Control+Alt+Delete to the remote computer.
pgettext("remote", "Send ctrl+alt+del"),
# Translators: Tooltip for the Send Ctrl+Alt+Del menu item in the Remote Access submenu.
pgettext("remote", "Send control+alt+delete to the controlled computer."),
)
sysTrayIcon.Bind(
wx.EVT_MENU,
Expand All @@ -76,10 +76,13 @@ def __init__(self, client: "RemoteClient") -> None:
self.sendCtrlAltDelItem.Enable(False)
self.remoteItem = toolsMenu.AppendSubMenu(
self,
# Translators: Label of menu in NVDA tools menu.
_("R&emote"),
# Translators: Tooltip for the Remote menu in the NVDA Tools menu.
_("NVDA Remote Access"),
# Translators: Label of the Remote Access submenu in the NVDA tools menu.
pgettext("remote", "R&emote Access"),
pgettext(
"remote",
# Translators: Tooltip for the Remote Access submenu in the NVDA Tools menu.
"Allow someone to control this computer from elsewhere, or control another computer running NVDA with this one.",
),
)

def terminate(self) -> None:
Expand Down Expand Up @@ -148,10 +151,10 @@ def _switchToConnectItem(self):
Sets the label, help text and event bindings of the connection item
to those appropriate for creating a new Remote session.
"""
# Translators: Item in NVDA Remote submenu to connect to a remote computer.
# Translators: Item in the Remote Access submenu to connect to another computer.
self.connectionItem.SetItemLabel(_("Connect..."))
# Translators: Tooltip for the Connect menu item in the NVDA Remote submenu.
self.connectionItem.SetHelp(_("Remotely connect to another computer running NVDA Remote Access"))
# Translators: Tooltip for the Connect menu item in the Remote Access submenu.
self.connectionItem.SetHelp(pgettext("remote", "Remotely connect to another computer running NVDA."))
gui.mainFrame.sysTrayIcon.Unbind(wx.EVT_MENU, self.connectionItem)
gui.mainFrame.sysTrayIcon.Bind(
wx.EVT_MENU,
Expand All @@ -165,10 +168,10 @@ def _switchToDisconnectItem(self):
Sets the label, help text and event bindings of the connection item
to those appropriate for disconnecting an existing Remote session.
"""
# Translators: Menu item in NVDA Remote submenu to disconnect from another computer running NVDA Remote Access.
# Translators: Menu item in the Remote Access submenu to disconnect from another computer running NVDA.
self.connectionItem.SetItemLabel(_("Disconnect"))
# Translators: Tooltip for the Disconnect menu item in the NVDA Remote submenu.
self.connectionItem.SetHelp(_("Disconnect from another computer running NVDA Remote Access"))
# Translators: Tooltip for the Disconnect menu item in the Remote Access submenu.
self.connectionItem.SetHelp(pgettext("remote", "Disconnect from the current Remote Access session."))
gui.mainFrame.sysTrayIcon.Unbind(wx.EVT_MENU, self.connectionItem)
gui.mainFrame.sysTrayIcon.Bind(
wx.EVT_MENU,
Expand Down
14 changes: 8 additions & 6 deletions source/_remoteClient/session.py
Original file line number Diff line number Diff line change
Expand Up @@ -162,9 +162,11 @@ def handleVersionMismatch(self) -> None:
"""
log.error("Protocol version mismatch detected with relay server")
ui.message(
# Translators: Message for version mismatch
_("""The version of the relay server which you have connected to is not compatible with this version of the Remote Client.
Please use a different server."""),
pgettext(
"remote",
# Translators: Message presented when attempting to connect to an incompatible Remote Access server.
"The Remote Access server you have connected to is not compatible with this version of NVDA. Please use a different server.",
),
)
self.transport.close()

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

Expand Down Expand Up @@ -548,7 +550,7 @@ def handleNVDANotConnected(self) -> None:
speech.cancelSpeech()
ui.message(
# Translators: Message for when the remote NVDA is not connected
_("Remote NVDA not connected."),
pgettext("remote", "Remote NVDA not connected"),
)

def handleChannelJoined(
Expand Down
8 changes: 4 additions & 4 deletions source/config/configFlags.py
Original file line number Diff line number Diff line change
Expand Up @@ -318,10 +318,10 @@ class RemoteConnectionMode(DisplayStringIntEnum):
@property
def _displayStringLabels(self):
return {
# Translators: Allow this computer to be controlled by the remote computer.
RemoteConnectionMode.FOLLOWER: pgettext("remote", "Allow this machine to be controlled"),
# Translators: Allow this computer to control the remote computer.
RemoteConnectionMode.LEADER: pgettext("remote", "Control another machine"),
# Translators: Option that allows this computer to be controlled by the remote computer.
RemoteConnectionMode.FOLLOWER: pgettext("remote", "Allow this computer to be controlled"),
# Translators: Option that allows this computer to control the remote computer.
RemoteConnectionMode.LEADER: pgettext("remote", "Control another computer"),
}

def toConnectionMode(self) -> "_remoteClient.connectionInfo.ConnectionMode":
Expand Down
2 changes: 1 addition & 1 deletion source/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -564,7 +564,7 @@ def _handleNVDAModuleCleanupBeforeGUIExit():
_terminate(globalPluginHandler)
# the brailleViewer should be destroyed safely before closing the window
brailleViewer.destroyBrailleViewer()
# Terminating remote causes it to clean up its menus, so do it here while they still exist
# Terminating remoteClient causes it to clean up its menus, so do it here while they still exist
_terminate(_remoteClient)


Expand Down
Loading