macOS: Localize tooltips

Signed-off-by: Roopesh Chander <roop@roopc.net>
This commit is contained in:
Roopesh Chander 2019-03-17 20:19:25 +05:30 committed by Jason A. Donenfeld
parent 0f98312d15
commit 9795b0609a
2 changed files with 7 additions and 2 deletions

View File

@ -352,3 +352,8 @@
"macAppExitingWithActiveTunnelInfo" = "The tunnel will remain active after exiting. You may disable it by reopening this application or through the Network panel in System Preferences.";
"macPrivacyNoticeMessage" = "Privacy notice: be sure you trust this configuration file";
"macPrivacyNoticeInfo" = "You will be prompted by the system to allow or disallow adding a VPN configuration. While this application does not send any information to the WireGuard project, information is by design sent to the servers specified inside of the configuration file you have just added, which configures your computer to use those servers as a VPN. Be certain that you trust this configuration before clicking “Allow” in the following dialog.";
// Mac tooltip
"macToolTipEditTunnel" = "Edit tunnel (⌘E)";
"macToolTipToggleStatus" = "Toggle status (⌘T)";

View File

@ -56,7 +56,7 @@ class TunnelDetailTableViewController: NSViewController {
button.title = tr("Edit")
button.setButtonType(.momentaryPushIn)
button.bezelStyle = .rounded
button.toolTip = "Edit tunnel (⌘E)"
button.toolTip = tr("macToolTipEditTunnel")
return button
}()
@ -406,7 +406,7 @@ extension TunnelDetailTableViewController: NSTableViewDelegate {
let cell: ButtonRow = tableView.dequeueReusableCell()
cell.buttonTitle = TunnelDetailTableViewController.localizedToggleStatusActionText(forStatus: tunnel.status)
cell.isButtonEnabled = (tunnel.status == .active || tunnel.status == .inactive)
cell.buttonToolTip = "Toggle status (⌘T)"
cell.buttonToolTip = tr("macToolTipToggleStatus")
cell.onButtonClicked = { [weak self] in
self?.handleToggleActiveStatusAction()
}