Repo // Fix informativeText localization when cassette path error.

This commit is contained in:
ShikiSuen 2022-10-19 16:30:55 +08:00
parent baaa563c45
commit 234819030c
3 changed files with 9 additions and 6 deletions

View File

@ -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()

View File

@ -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

View File

@ -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