From 234819030c66276cebc17dc1ccad29511f158c98 Mon Sep 17 00:00:00 2001 From: ShikiSuen Date: Wed, 19 Oct 2022 16:30:55 +0800 Subject: [PATCH] Repo // Fix informativeText localization when cassette path error. --- Source/Modules/SessionCtl_Menu.swift | 5 +++-- Source/Modules/UIModules/PrefUI/VwrPrefPaneCassette.swift | 5 +++-- Source/Modules/WindowControllers/CtlPrefWindow.swift | 5 +++-- 3 files changed, 9 insertions(+), 6 deletions(-) diff --git a/Source/Modules/SessionCtl_Menu.swift b/Source/Modules/SessionCtl_Menu.swift index d3b7614e..ed5272c4 100644 --- a/Source/Modules/SessionCtl_Menu.swift +++ b/Source/Modules/SessionCtl_Menu.swift @@ -230,8 +230,9 @@ extension SessionCtl { if !PrefMgr.shared.cassetteEnabled, !LMMgr.checkCassettePathValidity(PrefMgr.shared.cassettePath) { DispatchQueue.main.async { let alert = NSAlert(error: NSLocalizedString("Path invalid or file access error.", comment: "")) - alert.informativeText = - "Please reconfigure the cassette path to a valid one before enabling this mode." + alert.informativeText = NSLocalizedString( + "Please reconfigure the cassette path to a valid one before enabling this mode.", comment: "" + ) let result = alert.runModal() if result == NSApplication.ModalResponse.alertFirstButtonReturn { LMMgr.resetCassettePath() diff --git a/Source/Modules/UIModules/PrefUI/VwrPrefPaneCassette.swift b/Source/Modules/UIModules/PrefUI/VwrPrefPaneCassette.swift index e5550b92..fbcbe89c 100644 --- a/Source/Modules/UIModules/PrefUI/VwrPrefPaneCassette.swift +++ b/Source/Modules/UIModules/PrefUI/VwrPrefPaneCassette.swift @@ -110,8 +110,9 @@ struct VwrPrefPaneCassette: View { if selCassetteEnabled, !LMMgr.checkCassettePathValidity(PrefMgr.shared.cassettePath) { if let window = CtlPrefUI.shared.controller.window { let alert = NSAlert(error: NSLocalizedString("Path invalid or file access error.", comment: "")) - alert.informativeText = - "Please reconfigure the cassette path to a valid one before enabling this mode." + alert.informativeText = NSLocalizedString( + "Please reconfigure the cassette path to a valid one before enabling this mode.", comment: "" + ) alert.beginSheetModal(for: window) { _ in LMMgr.resetCassettePath() PrefMgr.shared.cassetteEnabled = false diff --git a/Source/Modules/WindowControllers/CtlPrefWindow.swift b/Source/Modules/WindowControllers/CtlPrefWindow.swift index 699223ef..fffba373 100644 --- a/Source/Modules/WindowControllers/CtlPrefWindow.swift +++ b/Source/Modules/WindowControllers/CtlPrefWindow.swift @@ -284,8 +284,9 @@ class CtlPrefWindow: NSWindowController { if PrefMgr.shared.cassetteEnabled, !LMMgr.checkCassettePathValidity(PrefMgr.shared.cassettePath) { if let window = window { let alert = NSAlert(error: NSLocalizedString("Path invalid or file access error.", comment: "")) - alert.informativeText = - "Please reconfigure the cassette path to a valid one before enabling this mode." + alert.informativeText = NSLocalizedString( + "Please reconfigure the cassette path to a valid one before enabling this mode.", comment: "" + ) alert.beginSheetModal(for: window) { _ in LMMgr.resetCassettePath() PrefMgr.shared.cassetteEnabled = false