Repo // Fix informativeText localization when cassette path error.
This commit is contained in:
parent
baaa563c45
commit
234819030c
|
@ -230,8 +230,9 @@ extension SessionCtl {
|
||||||
if !PrefMgr.shared.cassetteEnabled, !LMMgr.checkCassettePathValidity(PrefMgr.shared.cassettePath) {
|
if !PrefMgr.shared.cassetteEnabled, !LMMgr.checkCassettePathValidity(PrefMgr.shared.cassettePath) {
|
||||||
DispatchQueue.main.async {
|
DispatchQueue.main.async {
|
||||||
let alert = NSAlert(error: NSLocalizedString("Path invalid or file access error.", comment: ""))
|
let alert = NSAlert(error: NSLocalizedString("Path invalid or file access error.", comment: ""))
|
||||||
alert.informativeText =
|
alert.informativeText = NSLocalizedString(
|
||||||
"Please reconfigure the cassette path to a valid one before enabling this mode."
|
"Please reconfigure the cassette path to a valid one before enabling this mode.", comment: ""
|
||||||
|
)
|
||||||
let result = alert.runModal()
|
let result = alert.runModal()
|
||||||
if result == NSApplication.ModalResponse.alertFirstButtonReturn {
|
if result == NSApplication.ModalResponse.alertFirstButtonReturn {
|
||||||
LMMgr.resetCassettePath()
|
LMMgr.resetCassettePath()
|
||||||
|
|
|
@ -110,8 +110,9 @@ struct VwrPrefPaneCassette: View {
|
||||||
if selCassetteEnabled, !LMMgr.checkCassettePathValidity(PrefMgr.shared.cassettePath) {
|
if selCassetteEnabled, !LMMgr.checkCassettePathValidity(PrefMgr.shared.cassettePath) {
|
||||||
if let window = CtlPrefUI.shared.controller.window {
|
if let window = CtlPrefUI.shared.controller.window {
|
||||||
let alert = NSAlert(error: NSLocalizedString("Path invalid or file access error.", comment: ""))
|
let alert = NSAlert(error: NSLocalizedString("Path invalid or file access error.", comment: ""))
|
||||||
alert.informativeText =
|
alert.informativeText = NSLocalizedString(
|
||||||
"Please reconfigure the cassette path to a valid one before enabling this mode."
|
"Please reconfigure the cassette path to a valid one before enabling this mode.", comment: ""
|
||||||
|
)
|
||||||
alert.beginSheetModal(for: window) { _ in
|
alert.beginSheetModal(for: window) { _ in
|
||||||
LMMgr.resetCassettePath()
|
LMMgr.resetCassettePath()
|
||||||
PrefMgr.shared.cassetteEnabled = false
|
PrefMgr.shared.cassetteEnabled = false
|
||||||
|
|
|
@ -284,8 +284,9 @@ class CtlPrefWindow: NSWindowController {
|
||||||
if PrefMgr.shared.cassetteEnabled, !LMMgr.checkCassettePathValidity(PrefMgr.shared.cassettePath) {
|
if PrefMgr.shared.cassetteEnabled, !LMMgr.checkCassettePathValidity(PrefMgr.shared.cassettePath) {
|
||||||
if let window = window {
|
if let window = window {
|
||||||
let alert = NSAlert(error: NSLocalizedString("Path invalid or file access error.", comment: ""))
|
let alert = NSAlert(error: NSLocalizedString("Path invalid or file access error.", comment: ""))
|
||||||
alert.informativeText =
|
alert.informativeText = NSLocalizedString(
|
||||||
"Please reconfigure the cassette path to a valid one before enabling this mode."
|
"Please reconfigure the cassette path to a valid one before enabling this mode.", comment: ""
|
||||||
|
)
|
||||||
alert.beginSheetModal(for: window) { _ in
|
alert.beginSheetModal(for: window) { _ in
|
||||||
LMMgr.resetCassettePath()
|
LMMgr.resetCassettePath()
|
||||||
PrefMgr.shared.cassetteEnabled = false
|
PrefMgr.shared.cassetteEnabled = false
|
||||||
|
|
Loading…
Reference in New Issue