diff options
| author | David Lönnhager <david.l@mullvad.net> | 2019-10-23 13:38:40 +0200 |
|---|---|---|
| committer | David Lönnhager <david.l@mullvad.net> | 2019-10-23 13:41:26 +0200 |
| commit | da96f43c2e5f496d0115936b74f02dbec3eab4c5 (patch) | |
| tree | dcc99649a3c70372203c500f2bb78bb5ec9efb4d | |
| parent | eca83074097e5b715ac880723b69c42ffab14320 (diff) | |
| download | mullvadvpn-da96f43c2e5f496d0115936b74f02dbec3eab4c5.tar.xz mullvadvpn-da96f43c2e5f496d0115936b74f02dbec3eab4c5.zip | |
Show relay name in notifications
| -rw-r--r-- | gui/src/main/notification-controller.ts | 34 |
1 files changed, 32 insertions, 2 deletions
diff --git a/gui/src/main/notification-controller.ts b/gui/src/main/notification-controller.ts index 976d0dda4c..515918f50c 100644 --- a/gui/src/main/notification-controller.ts +++ b/gui/src/main/notification-controller.ts @@ -36,11 +36,41 @@ export default class NotificationController { switch (tunnelState.state) { case 'connecting': if (!this.reconnecting) { - this.showTunnelStateNotification(messages.pgettext('notifications', 'Connecting')); + const details = tunnelState.details; + if (details && details.location && details.location.hostname) { + const msg = sprintf( + // TRANSLATORS: The message showed when a server is being connected to. + // TRANSLATORS: Available placeholder: + // TRANSLATORS: %(location) - name of the server location we're connecting to (e.g. "se-got-003") + messages.pgettext('notifications', 'Connecting to %(location)s'), + { + location: details.location.hostname, + }, + ); + this.showTunnelStateNotification(msg); + } else { + this.showTunnelStateNotification(messages.pgettext('notifications', 'Connecting')); + } } break; case 'connected': - this.showTunnelStateNotification(messages.pgettext('notifications', 'Secured')); + { + const details = tunnelState.details; + if (details.location && details.location.hostname) { + const msg = sprintf( + // TRANSLATORS: The message showed when a server has been connected to. + // TRANSLATORS: Available placeholder: + // TRANSLATORS: %(location) - name of the server location we're connected to (e.g. "se-got-003") + messages.pgettext('notifications', 'Connected to %(location)s'), + { + location: details.location.hostname, + }, + ); + this.showTunnelStateNotification(msg); + } else { + this.showTunnelStateNotification(messages.pgettext('notifications', 'Secured')); + } + } break; case 'disconnected': this.showTunnelStateNotification(messages.pgettext('notifications', 'Unsecured')); |
