diff options
Diffstat (limited to 'gui/src/main')
| -rw-r--r-- | gui/src/main/index.ts | 4 | ||||
| -rw-r--r-- | gui/src/main/notification-controller.ts | 20 |
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', ), |
