From f87f9b1b89ecf01fe9889526da1f073ec5d40345 Mon Sep 17 00:00:00 2001 From: David Lechner Date: Mon, 18 Jan 2021 18:56:02 -0600 Subject: [PATCH] associate related programChanged translations --- src/components/notification-i18n.en.json | 6 ++++-- src/components/notification-i18n.ts | 4 ++-- src/sagas/notification.ts | 4 ++-- 3 files changed, 8 insertions(+), 6 deletions(-) diff --git a/src/components/notification-i18n.en.json b/src/components/notification-i18n.en.json index f4e861be..90dc0233 100644 --- a/src/components/notification-i18n.en.json +++ b/src/components/notification-i18n.en.json @@ -6,8 +6,10 @@ "connectFailed": "Unexpected error while trying to connect. Check console log and report the error." }, "editor": { - "programChanged": "The program was changed in another window. Do you want to delete this program and replace it with the new program?", - "yesReloadProgram": "Reload" + "programChanged": { + "message": "The program was changed in another window. Do you want to delete this program and replace it with the new program?", + "action": "Reload" + } }, "mpy": { "error": "{errorMessage}" diff --git a/src/components/notification-i18n.ts b/src/components/notification-i18n.ts index b28abff2..e5948e18 100644 --- a/src/components/notification-i18n.ts +++ b/src/components/notification-i18n.ts @@ -8,9 +8,9 @@ export enum MessageId { BleGattPermission = 'ble.gattPermission', BleGattServiceNotFound = 'ble.gattServiceNotFound', BleNoWebBluetooth = 'ble.noWebBluetooth', - ProgramChanged = 'editor.programChanged', + ProgramChangedMessage = 'editor.programChanged.message', + ProgramChangedAction = 'editor.programChanged.action', ServiceWorkerUpdateMessage = 'serviceWorker.update.message', ServiceWorkerUpdateAction = 'serviceWorker.update.action', - YesReloadProgram = 'editor.yesReloadProgram', MpyError = 'mpy.error', } diff --git a/src/sagas/notification.ts b/src/sagas/notification.ts index 7a947e91..23b60cbd 100644 --- a/src/sagas/notification.ts +++ b/src/sagas/notification.ts @@ -201,9 +201,9 @@ function* showEditorStorageChanged(): Generator { yield* showSingleton( Level.Info, - MessageId.ProgramChanged, + MessageId.ProgramChangedMessage, undefined, - dispatchAction(MessageId.YesReloadProgram, ch.put, 'tick'), + dispatchAction(MessageId.ProgramChangedAction, ch.put, 'tick'), ch.close, );