mgrLM // Update outdated symbol names.
This commit is contained in:
parent
c387865383
commit
2cabab808d
|
@ -318,9 +318,9 @@ extension ctlInputMethod {
|
||||||
}
|
}
|
||||||
|
|
||||||
@objc func openExcludedPhrases(_: Any?) {
|
@objc func openExcludedPhrases(_: Any?) {
|
||||||
IME.openPhraseFile(userFileAt: mgrLangModel.excludedPhrasesDataPath(IME.getInputMode()))
|
IME.openPhraseFile(userFileAt: mgrLangModel.userFilteredDataPath(IME.getInputMode()))
|
||||||
if NSEvent.modifierFlags.contains(.option), mgrPrefs.isDebugModeEnabled {
|
if NSEvent.modifierFlags.contains(.option), mgrPrefs.isDebugModeEnabled {
|
||||||
IME.openPhraseFile(userFileAt: mgrLangModel.excludedPhrasesDataPath(IME.getInputMode(isReversed: true)))
|
IME.openPhraseFile(userFileAt: mgrLangModel.userFilteredDataPath(IME.getInputMode(isReversed: true)))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -332,17 +332,17 @@ extension ctlInputMethod {
|
||||||
}
|
}
|
||||||
|
|
||||||
@objc func openPhraseReplacement(_: Any?) {
|
@objc func openPhraseReplacement(_: Any?) {
|
||||||
IME.openPhraseFile(userFileAt: mgrLangModel.phraseReplacementDataPath(IME.getInputMode()))
|
IME.openPhraseFile(userFileAt: mgrLangModel.userReplacementsDataPath(IME.getInputMode()))
|
||||||
if NSEvent.modifierFlags.contains(.option), mgrPrefs.isDebugModeEnabled {
|
if NSEvent.modifierFlags.contains(.option), mgrPrefs.isDebugModeEnabled {
|
||||||
IME.openPhraseFile(userFileAt: mgrLangModel.phraseReplacementDataPath(IME.getInputMode(isReversed: true)))
|
IME.openPhraseFile(userFileAt: mgrLangModel.userReplacementsDataPath(IME.getInputMode(isReversed: true)))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@objc func openAssociatedPhrases(_: Any?) {
|
@objc func openAssociatedPhrases(_: Any?) {
|
||||||
IME.openPhraseFile(userFileAt: mgrLangModel.userAssociatedPhrasesDataPath(IME.getInputMode()))
|
IME.openPhraseFile(userFileAt: mgrLangModel.userAssociatesDataPath(IME.getInputMode()))
|
||||||
if NSEvent.modifierFlags.contains(.option), mgrPrefs.isDebugModeEnabled {
|
if NSEvent.modifierFlags.contains(.option), mgrPrefs.isDebugModeEnabled {
|
||||||
IME.openPhraseFile(
|
IME.openPhraseFile(
|
||||||
userFileAt: mgrLangModel.userAssociatedPhrasesDataPath(IME.getInputMode(isReversed: true)))
|
userFileAt: mgrLangModel.userAssociatesDataPath(IME.getInputMode(isReversed: true)))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -150,11 +150,11 @@ enum mgrLangModel {
|
||||||
public static func loadUserPhrasesData() {
|
public static func loadUserPhrasesData() {
|
||||||
gLangModelCHT.loadUserPhrasesData(
|
gLangModelCHT.loadUserPhrasesData(
|
||||||
path: userPhrasesDataPath(InputMode.imeModeCHT),
|
path: userPhrasesDataPath(InputMode.imeModeCHT),
|
||||||
filterPath: excludedPhrasesDataPath(InputMode.imeModeCHT)
|
filterPath: userFilteredDataPath(InputMode.imeModeCHT)
|
||||||
)
|
)
|
||||||
gLangModelCHS.loadUserPhrasesData(
|
gLangModelCHS.loadUserPhrasesData(
|
||||||
path: userPhrasesDataPath(InputMode.imeModeCHS),
|
path: userPhrasesDataPath(InputMode.imeModeCHS),
|
||||||
filterPath: excludedPhrasesDataPath(InputMode.imeModeCHS)
|
filterPath: userFilteredDataPath(InputMode.imeModeCHS)
|
||||||
)
|
)
|
||||||
gLangModelCHT.loadUserSymbolData(path: userSymbolDataPath(InputMode.imeModeCHT))
|
gLangModelCHT.loadUserSymbolData(path: userSymbolDataPath(InputMode.imeModeCHT))
|
||||||
gLangModelCHS.loadUserSymbolData(path: userSymbolDataPath(InputMode.imeModeCHS))
|
gLangModelCHS.loadUserSymbolData(path: userSymbolDataPath(InputMode.imeModeCHS))
|
||||||
|
@ -162,19 +162,19 @@ enum mgrLangModel {
|
||||||
|
|
||||||
public static func loadUserAssociatesData() {
|
public static func loadUserAssociatesData() {
|
||||||
gLangModelCHT.loadUserAssociatesData(
|
gLangModelCHT.loadUserAssociatesData(
|
||||||
path: mgrLangModel.userAssociatedPhrasesDataPath(InputMode.imeModeCHT)
|
path: mgrLangModel.userAssociatesDataPath(InputMode.imeModeCHT)
|
||||||
)
|
)
|
||||||
gLangModelCHS.loadUserAssociatesData(
|
gLangModelCHS.loadUserAssociatesData(
|
||||||
path: mgrLangModel.userAssociatedPhrasesDataPath(InputMode.imeModeCHS)
|
path: mgrLangModel.userAssociatesDataPath(InputMode.imeModeCHS)
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
public static func loadUserPhraseReplacement() {
|
public static func loadUserPhraseReplacement() {
|
||||||
gLangModelCHT.loadReplacementsData(
|
gLangModelCHT.loadReplacementsData(
|
||||||
path: mgrLangModel.phraseReplacementDataPath(InputMode.imeModeCHT)
|
path: mgrLangModel.userReplacementsDataPath(InputMode.imeModeCHT)
|
||||||
)
|
)
|
||||||
gLangModelCHS.loadReplacementsData(
|
gLangModelCHS.loadReplacementsData(
|
||||||
path: mgrLangModel.phraseReplacementDataPath(InputMode.imeModeCHS)
|
path: mgrLangModel.userReplacementsDataPath(InputMode.imeModeCHS)
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -229,17 +229,17 @@ enum mgrLangModel {
|
||||||
return URL(fileURLWithPath: dataFolderPath(isDefaultFolder: false)).appendingPathComponent(fileName).path
|
return URL(fileURLWithPath: dataFolderPath(isDefaultFolder: false)).appendingPathComponent(fileName).path
|
||||||
}
|
}
|
||||||
|
|
||||||
static func userAssociatedPhrasesDataPath(_ mode: InputMode) -> String {
|
static func userAssociatesDataPath(_ mode: InputMode) -> String {
|
||||||
let fileName = (mode == InputMode.imeModeCHT) ? "associatedPhrases-cht.txt" : "associatedPhrases-chs.txt"
|
let fileName = (mode == InputMode.imeModeCHT) ? "associatedPhrases-cht.txt" : "associatedPhrases-chs.txt"
|
||||||
return URL(fileURLWithPath: dataFolderPath(isDefaultFolder: false)).appendingPathComponent(fileName).path
|
return URL(fileURLWithPath: dataFolderPath(isDefaultFolder: false)).appendingPathComponent(fileName).path
|
||||||
}
|
}
|
||||||
|
|
||||||
static func excludedPhrasesDataPath(_ mode: InputMode) -> String {
|
static func userFilteredDataPath(_ mode: InputMode) -> String {
|
||||||
let fileName = (mode == InputMode.imeModeCHT) ? "exclude-phrases-cht.txt" : "exclude-phrases-chs.txt"
|
let fileName = (mode == InputMode.imeModeCHT) ? "exclude-phrases-cht.txt" : "exclude-phrases-chs.txt"
|
||||||
return URL(fileURLWithPath: dataFolderPath(isDefaultFolder: false)).appendingPathComponent(fileName).path
|
return URL(fileURLWithPath: dataFolderPath(isDefaultFolder: false)).appendingPathComponent(fileName).path
|
||||||
}
|
}
|
||||||
|
|
||||||
static func phraseReplacementDataPath(_ mode: InputMode) -> String {
|
static func userReplacementsDataPath(_ mode: InputMode) -> String {
|
||||||
let fileName = (mode == InputMode.imeModeCHT) ? "phrases-replacement-cht.txt" : "phrases-replacement-chs.txt"
|
let fileName = (mode == InputMode.imeModeCHT) ? "phrases-replacement-cht.txt" : "phrases-replacement-chs.txt"
|
||||||
return URL(fileURLWithPath: dataFolderPath(isDefaultFolder: false)).appendingPathComponent(fileName).path
|
return URL(fileURLWithPath: dataFolderPath(isDefaultFolder: false)).appendingPathComponent(fileName).path
|
||||||
}
|
}
|
||||||
|
@ -275,9 +275,9 @@ enum mgrLangModel {
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
if !ensureFileExists(userPhrasesDataPath(mode))
|
if !ensureFileExists(userPhrasesDataPath(mode))
|
||||||
|| !ensureFileExists(userAssociatedPhrasesDataPath(mode))
|
|| !ensureFileExists(userAssociatesDataPath(mode))
|
||||||
|| !ensureFileExists(excludedPhrasesDataPath(mode))
|
|| !ensureFileExists(userFilteredDataPath(mode))
|
||||||
|| !ensureFileExists(phraseReplacementDataPath(mode))
|
|| !ensureFileExists(userReplacementsDataPath(mode))
|
||||||
|| !ensureFileExists(userSymbolDataPath(mode))
|
|| !ensureFileExists(userSymbolDataPath(mode))
|
||||||
{
|
{
|
||||||
return false
|
return false
|
||||||
|
@ -391,7 +391,7 @@ enum mgrLangModel {
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
|
||||||
let path = areWeDeleting ? excludedPhrasesDataPath(mode) : userPhrasesDataPath(mode)
|
let path = areWeDeleting ? userFilteredDataPath(mode) : userPhrasesDataPath(mode)
|
||||||
|
|
||||||
if areWeDuplicating, !areWeDeleting {
|
if areWeDuplicating, !areWeDeleting {
|
||||||
// Do not use ASCII characters to comment here.
|
// Do not use ASCII characters to comment here.
|
||||||
|
|
Loading…
Reference in New Issue