summaryrefslogtreecommitdiffhomepage
path: root/gui/src/main
diff options
context:
space:
mode:
authorAndrej Mihajlov <and@mullvad.net>2019-04-09 15:42:36 +0200
committerAndrej Mihajlov <and@mullvad.net>2019-04-09 15:42:36 +0200
commitb427aa1adca8fcfeca7f777499f0b4e1c84e3c6e (patch)
treeb096c6eb2a2bf3885436910894249452ccb1d813 /gui/src/main
parent88031a653167df93396433fcf53a1422c2f995fd (diff)
parent6405e1eebbe12313bed10f3f8bd1a0f051e83d24 (diff)
downloadmullvadvpn-b427aa1adca8fcfeca7f777499f0b4e1c84e3c6e.tar.xz
mullvadvpn-b427aa1adca8fcfeca7f777499f0b4e1c84e3c6e.zip
Merge branch 'multi-catalogue'
Diffstat (limited to 'gui/src/main')
-rw-r--r--gui/src/main/index.ts4
-rw-r--r--gui/src/main/notification-controller.ts20
2 files changed, 13 insertions, 11 deletions
diff --git a/gui/src/main/index.ts b/gui/src/main/index.ts
index 2d048ab2c3..67bb326465 100644
--- a/gui/src/main/index.ts
+++ b/gui/src/main/index.ts
@@ -17,7 +17,7 @@ import {
RelaySettingsUpdate,
TunnelStateTransition,
} from '../shared/daemon-rpc-types';
-import { loadTranslations } from '../shared/gettext';
+import { loadTranslations, messages } from '../shared/gettext';
import { IpcMainEventChannel } from '../shared/ipc-event-channel';
import { getOpenAtLogin, setOpenAtLogin } from './autostart';
import { ConnectionObserver, DaemonRpc, SubscriptionListener } from './daemon-rpc';
@@ -282,7 +282,7 @@ class ApplicationMain {
log.info(`Detected locale: ${this.locale}`);
- loadTranslations(this.locale);
+ loadTranslations(this.locale, messages);
this.daemonRpc.addConnectionObserver(
new ConnectionObserver(this.onDaemonConnected, this.onDaemonDisconnected),
diff --git a/gui/src/main/notification-controller.ts b/gui/src/main/notification-controller.ts
index 35314aa73a..a2e1e00a0b 100644
--- a/gui/src/main/notification-controller.ts
+++ b/gui/src/main/notification-controller.ts
@@ -3,7 +3,7 @@ import path from 'path';
import { sprintf } from 'sprintf-js';
import config from '../config.json';
import { TunnelStateTransition } from '../shared/daemon-rpc-types';
-import { pgettext } from '../shared/gettext';
+import { messages } from '../shared/gettext';
export default class NotificationController {
private lastTunnelStateAnnouncement?: { body: string; notification: Notification };
@@ -26,24 +26,26 @@ export default class NotificationController {
switch (tunnelState.state) {
case 'connecting':
if (!this.reconnecting) {
- this.showTunnelStateNotification(pgettext('notifications', 'Connecting'));
+ this.showTunnelStateNotification(messages.pgettext('notifications', 'Connecting'));
}
break;
case 'connected':
- this.showTunnelStateNotification(pgettext('notifications', 'Secured'));
+ this.showTunnelStateNotification(messages.pgettext('notifications', 'Secured'));
break;
case 'disconnected':
- this.showTunnelStateNotification(pgettext('notifications', 'Unsecured'));
+ this.showTunnelStateNotification(messages.pgettext('notifications', 'Unsecured'));
break;
case 'blocked':
switch (tunnelState.details.reason) {
case 'set_firewall_policy_error':
this.showTunnelStateNotification(
- pgettext('notifications', 'Critical failure - Unsecured'),
+ messages.pgettext('notifications', 'Critical failure - Unsecured'),
);
break;
default:
- this.showTunnelStateNotification(pgettext('notifications', 'Blocked all connections'));
+ this.showTunnelStateNotification(
+ messages.pgettext('notifications', 'Blocked all connections'),
+ );
break;
}
break;
@@ -54,7 +56,7 @@ export default class NotificationController {
// no-op
break;
case 'reconnect':
- this.showTunnelStateNotification(pgettext('notifications', 'Reconnecting'));
+ this.showTunnelStateNotification(messages.pgettext('notifications', 'Reconnecting'));
this.reconnecting = true;
return;
}
@@ -68,7 +70,7 @@ export default class NotificationController {
this.presentNotificationOnce('inconsistent-version', () => {
const notification = new Notification({
title: this.notificationTitle,
- body: pgettext(
+ body: messages.pgettext(
'notifications',
'Inconsistent internal version information, please restart the app',
),
@@ -87,7 +89,7 @@ export default class NotificationController {
// TRANSLATORS: The system notification displayed to the user when the running app becomes unsupported.
// TRANSLATORS: Available placeholder:
// TRANSLATORS: %(version) - the newest available version of the app
- pgettext(
+ messages.pgettext(
'notifications',
'You are running an unsupported app version. Please upgrade to %(version)s now to ensure your security',
),