mgrLM // Add notification when core dict finishes loading.
This commit is contained in:
parent
3c64ddcbe9
commit
8722e45dd8
|
@ -58,8 +58,21 @@ class mgrLangModel: NSObject {
|
|||
}
|
||||
|
||||
public static func loadDataModels() {
|
||||
if !gLangModelCHT.isCNSDataLoaded() {
|
||||
gLangModelCHT.loadCNSData(path: getBundleDataPath("char-kanji-cns"))
|
||||
}
|
||||
if !gLangModelCHT.isDataModelLoaded() {
|
||||
NotifierController.notify(
|
||||
message: String(
|
||||
format: "%@", NSLocalizedString("Loading CHT Core Dict...", comment: "")
|
||||
)
|
||||
)
|
||||
loadCoreLanguageModelFile(filenameSansExtension: "data-cht", langModel: &gLangModelCHT)
|
||||
NotifierController.notify(
|
||||
message: String(
|
||||
format: "%@", NSLocalizedString("Core Dict loading complete.", comment: "")
|
||||
)
|
||||
)
|
||||
}
|
||||
if !gLangModelCHT.isMiscDataLoaded() {
|
||||
gLangModelCHT.loadMiscData(path: getBundleDataPath("data-zhuyinwen"))
|
||||
|
@ -67,13 +80,23 @@ class mgrLangModel: NSObject {
|
|||
if !gLangModelCHT.isSymbolDataLoaded() {
|
||||
gLangModelCHT.loadSymbolData(path: getBundleDataPath("data-symbols"))
|
||||
}
|
||||
if !gLangModelCHT.isCNSDataLoaded() {
|
||||
gLangModelCHT.loadCNSData(path: getBundleDataPath("char-kanji-cns"))
|
||||
}
|
||||
|
||||
// -----------------
|
||||
if !gLangModelCHS.isCNSDataLoaded() {
|
||||
gLangModelCHS.loadCNSData(path: getBundleDataPath("char-kanji-cns"))
|
||||
}
|
||||
if !gLangModelCHS.isDataModelLoaded() {
|
||||
NotifierController.notify(
|
||||
message: String(
|
||||
format: "%@", NSLocalizedString("Loading CHS Core Dict...", comment: "")
|
||||
)
|
||||
)
|
||||
loadCoreLanguageModelFile(filenameSansExtension: "data-chs", langModel: &gLangModelCHS)
|
||||
NotifierController.notify(
|
||||
message: String(
|
||||
format: "%@", NSLocalizedString("Core Dict loading complete.", comment: "")
|
||||
)
|
||||
)
|
||||
}
|
||||
if !gLangModelCHS.isMiscDataLoaded() {
|
||||
gLangModelCHS.loadMiscData(path: getBundleDataPath("data-zhuyinwen"))
|
||||
|
@ -81,16 +104,10 @@ class mgrLangModel: NSObject {
|
|||
if !gLangModelCHS.isSymbolDataLoaded() {
|
||||
gLangModelCHS.loadSymbolData(path: getBundleDataPath("data-symbols"))
|
||||
}
|
||||
if !gLangModelCHS.isCNSDataLoaded() {
|
||||
gLangModelCHS.loadCNSData(path: getBundleDataPath("char-kanji-cns"))
|
||||
}
|
||||
}
|
||||
|
||||
public static func loadDataModel(_ mode: InputMode) {
|
||||
if mode == InputMode.imeModeCHS {
|
||||
if !gLangModelCHS.isDataModelLoaded() {
|
||||
loadCoreLanguageModelFile(filenameSansExtension: "data-chs", langModel: &gLangModelCHS)
|
||||
}
|
||||
if !gLangModelCHS.isMiscDataLoaded() {
|
||||
gLangModelCHS.loadMiscData(path: getBundleDataPath("data-zhuyinwen"))
|
||||
}
|
||||
|
@ -100,10 +117,20 @@ class mgrLangModel: NSObject {
|
|||
if !gLangModelCHS.isCNSDataLoaded() {
|
||||
gLangModelCHS.loadCNSData(path: getBundleDataPath("char-kanji-cns"))
|
||||
}
|
||||
} else if mode == InputMode.imeModeCHT {
|
||||
if !gLangModelCHT.isDataModelLoaded() {
|
||||
loadCoreLanguageModelFile(filenameSansExtension: "data-cht", langModel: &gLangModelCHT)
|
||||
if !gLangModelCHS.isDataModelLoaded() {
|
||||
NotifierController.notify(
|
||||
message: String(
|
||||
format: "%@", NSLocalizedString("Loading CHS Core Dict...", comment: "")
|
||||
)
|
||||
)
|
||||
loadCoreLanguageModelFile(filenameSansExtension: "data-chs", langModel: &gLangModelCHS)
|
||||
NotifierController.notify(
|
||||
message: String(
|
||||
format: "%@", NSLocalizedString("Core Dict loading complete.", comment: "")
|
||||
)
|
||||
)
|
||||
}
|
||||
} else if mode == InputMode.imeModeCHT {
|
||||
if !gLangModelCHT.isMiscDataLoaded() {
|
||||
gLangModelCHT.loadMiscData(path: getBundleDataPath("data-zhuyinwen"))
|
||||
}
|
||||
|
@ -113,6 +140,19 @@ class mgrLangModel: NSObject {
|
|||
if !gLangModelCHT.isCNSDataLoaded() {
|
||||
gLangModelCHT.loadCNSData(path: getBundleDataPath("char-kanji-cns"))
|
||||
}
|
||||
if !gLangModelCHT.isDataModelLoaded() {
|
||||
NotifierController.notify(
|
||||
message: String(
|
||||
format: "%@", NSLocalizedString("Loading CHT Core Dict...", comment: "")
|
||||
)
|
||||
)
|
||||
loadCoreLanguageModelFile(filenameSansExtension: "data-cht", langModel: &gLangModelCHT)
|
||||
NotifierController.notify(
|
||||
message: String(
|
||||
format: "%@", NSLocalizedString("Core Dict loading complete.", comment: "")
|
||||
)
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -57,6 +57,9 @@
|
|||
"Edit User Symbol & Emoji Data…" = "Edit User Symbol & Emoji Data…";
|
||||
"Choose your desired user data folder." = "Choose your desired user data folder.";
|
||||
"Cursor is between \"%@\" and \"%@\"." = "Cursor is between \"%@\" and \"%@\".";
|
||||
"Loading CHS Core Dict..." = "Loading CHS Core Dict...";
|
||||
"Loading CHT Core Dict..." = "Loading CHT Core Dict...";
|
||||
"Core Dict loading complete." = "Core Dict loading complete.";
|
||||
|
||||
// The followings are the category names used in the Symbol menu.
|
||||
"catCommonSymbols" = "CommonSymbols";
|
||||
|
|
|
@ -57,6 +57,9 @@
|
|||
"Edit User Symbol & Emoji Data…" = "Edit User Symbol & Emoji Data…";
|
||||
"Choose your desired user data folder." = "Choose your desired user data folder.";
|
||||
"Cursor is between \"%@\" and \"%@\"." = "Cursor is between \"%@\" and \"%@\".";
|
||||
"Loading CHS Core Dict..." = "Loading CHS Core Dict...";
|
||||
"Loading CHT Core Dict..." = "Loading CHT Core Dict...";
|
||||
"Core Dict loading complete." = "Core Dict loading complete.";
|
||||
|
||||
// The followings are the category names used in the Symbol menu.
|
||||
"catCommonSymbols" = "CommonSymbols";
|
||||
|
|
|
@ -57,6 +57,9 @@
|
|||
"Edit User Symbol & Emoji Data…" = "ユーザー符号&絵文字辞書を編集…";
|
||||
"Choose your desired user data folder." = "欲しがるユーザー辞書フォルダをお選びください。";
|
||||
"Cursor is between \"%@\" and \"%@\"." = "カーソルは「%@」と「%@」に間れ。";
|
||||
"Loading CHS Core Dict..." = "簡体中国語核心辞書読込中…";
|
||||
"Loading CHT Core Dict..." = "繁体中国語核心辞書読込中…";
|
||||
"Core Dict loading complete." = "核心辞書読込完了";
|
||||
|
||||
// The followings are the category names used in the Symbol menu.
|
||||
"catCommonSymbols" = "常用";
|
||||
|
|
|
@ -57,6 +57,9 @@
|
|||
"Edit User Symbol & Emoji Data…" = "编辑自订符号&绘文字资料…";
|
||||
"Choose your desired user data folder." = "请选择您想指定的使用者语汇档案目录。";
|
||||
"Cursor is between \"%@\" and \"%@\"." = "游标介于「%@」与「%@」之间。";
|
||||
"Loading CHS Core Dict..." = "载入简体中文核心辞典…";
|
||||
"Loading CHT Core Dict..." = "载入繁体中文核心辞典…";
|
||||
"Core Dict loading complete." = "核心辞典载入完毕";
|
||||
|
||||
// The followings are the category names used in the Symbol menu.
|
||||
"catCommonSymbols" = "常用";
|
||||
|
|
|
@ -57,6 +57,9 @@
|
|||
"Edit User Symbol & Emoji Data…" = "編輯自訂符號&繪文字資料…";
|
||||
"Choose your desired user data folder." = "請選擇您想指定的使用者語彙檔案目錄。";
|
||||
"Cursor is between \"%@\" and \"%@\"." = "游標介於「%@」與「%@」之間。";
|
||||
"Loading CHS Core Dict..." = "載入簡體中文核心辭典…";
|
||||
"Loading CHT Core Dict..." = "載入繁體中文核心辭典…";
|
||||
"Core Dict loading complete." = "核心辭典載入完畢";
|
||||
|
||||
// The followings are the category names used in the Symbol menu.
|
||||
"catCommonSymbols" = "常用";
|
||||
|
|
Loading…
Reference in New Issue