Makes it able to reload user phrases.
This commit is contained in:
parent
e909dc20b5
commit
a5247d958c
|
@ -233,8 +233,13 @@ static double FindHighestScore(const vector<NodeAnchor>& nodes, double epsilon)
|
||||||
chineseConversionMenuItem.state = _chineseConversionEnabled ? NSControlStateValueOn : NSControlStateValueOff;
|
chineseConversionMenuItem.state = _chineseConversionEnabled ? NSControlStateValueOn : NSControlStateValueOff;
|
||||||
[menu addItem:chineseConversionMenuItem];
|
[menu addItem:chineseConversionMenuItem];
|
||||||
|
|
||||||
NSMenuItem *editUserPhraseItem = [[NSMenuItem alloc] initWithTitle:NSLocalizedString(@"Edit User Phrases", @"") action:@selector(openUserPhrases:) keyEquivalent:@""];
|
if (_inputMode != kPlainBopomofoModeIdentifier) {
|
||||||
[menu addItem:editUserPhraseItem];
|
NSMenuItem *editUserPhraseItem = [[NSMenuItem alloc] initWithTitle:NSLocalizedString(@"Edit User Phrases", @"") action:@selector(openUserPhrases:) keyEquivalent:@""];
|
||||||
|
[menu addItem:editUserPhraseItem];
|
||||||
|
|
||||||
|
NSMenuItem *reloadUserPhraseItem = [[NSMenuItem alloc] initWithTitle:NSLocalizedString(@"Reload User Phrases", @"") action:@selector(reloadUserPhrases:) keyEquivalent:@""];
|
||||||
|
[menu addItem:reloadUserPhraseItem];
|
||||||
|
}
|
||||||
|
|
||||||
NSMenuItem *updateCheckItem = [[NSMenuItem alloc] initWithTitle:NSLocalizedString(@"Check for Updates…", @"") action:@selector(checkForUpdate:) keyEquivalent:@""];
|
NSMenuItem *updateCheckItem = [[NSMenuItem alloc] initWithTitle:NSLocalizedString(@"Check for Updates…", @"") action:@selector(checkForUpdate:) keyEquivalent:@""];
|
||||||
[menu addItem:updateCheckItem];
|
[menu addItem:updateCheckItem];
|
||||||
|
@ -666,6 +671,8 @@ NS_INLINE size_t max(size_t a, size_t b) { return a > b ? a : b; }
|
||||||
NSData *data = [currentMarkedPhrase dataUsingEncoding:NSUTF8StringEncoding];
|
NSData *data = [currentMarkedPhrase dataUsingEncoding:NSUTF8StringEncoding];
|
||||||
[file writeData:data];
|
[file writeData:data];
|
||||||
[file closeFile];
|
[file closeFile];
|
||||||
|
|
||||||
|
LTLoadUserLanguageModelFile();
|
||||||
return YES;
|
return YES;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1550,11 +1557,11 @@ NS_INLINE size_t max(size_t a, size_t b) { return a > b ? a : b; }
|
||||||
}
|
}
|
||||||
NSURL *url = [NSURL fileURLWithPath:path];
|
NSURL *url = [NSURL fileURLWithPath:path];
|
||||||
[[NSWorkspace sharedWorkspace] openURL:url];
|
[[NSWorkspace sharedWorkspace] openURL:url];
|
||||||
// NSWorkspaceOpenConfiguration *config = [NSWorkspaceOpenConfiguration configuration];
|
}
|
||||||
// [[NSWorkspace sharedWorkspace] openURL:url configuration:config completionHandler:^(NSRunningApplication * app, NSError * error) {
|
|
||||||
// NSLog(@"app %@", app);
|
- (void)reloadUserPhrases:(id)sender
|
||||||
// NSLog(@"error %@", error);
|
{
|
||||||
// }];
|
LTLoadUserLanguageModelFile();
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void)showAbout:(id)sender
|
- (void)showAbout:(id)sender
|
||||||
|
|
|
@ -50,3 +50,7 @@
|
||||||
"You're currently using McBopomofo %@ (%@), a new version %@ (%@) is now available. Do you want to visit McBopomofo's website to download the version?%@" = "You're currently using McBopomofo %@ (%@), a new version %@ (%@) is now available. Do you want to visit McBopomofo's website to download the version?%@";
|
"You're currently using McBopomofo %@ (%@), a new version %@ (%@) is now available. Do you want to visit McBopomofo's website to download the version?%@" = "You're currently using McBopomofo %@ (%@), a new version %@ (%@) is now available. Do you want to visit McBopomofo's website to download the version?%@";
|
||||||
|
|
||||||
"Chinese Conversion" = "Convert to Simplified Chinese";
|
"Chinese Conversion" = "Convert to Simplified Chinese";
|
||||||
|
|
||||||
|
"Edit User Phrases" = "Edit User Phrases";
|
||||||
|
|
||||||
|
"Reload User Phrases" = "Reload User Phrases";
|
||||||
|
|
|
@ -50,3 +50,8 @@
|
||||||
"You're currently using McBopomofo %@ (%@), a new version %@ (%@) is now available. Do you want to visit McBopomofo's website to download the version?%@" = "目前使用的小麥注音版本是 %1$@ (%2$@),網路上有更新版本 %3$@ (%4$@) 可供下載。是否要前往小麥注音網站下載新版來安裝?%5$@";
|
"You're currently using McBopomofo %@ (%@), a new version %@ (%@) is now available. Do you want to visit McBopomofo's website to download the version?%@" = "目前使用的小麥注音版本是 %1$@ (%2$@),網路上有更新版本 %3$@ (%4$@) 可供下載。是否要前往小麥注音網站下載新版來安裝?%5$@";
|
||||||
|
|
||||||
"Chinese Conversion" = "輸出簡體中文";
|
"Chinese Conversion" = "輸出簡體中文";
|
||||||
|
|
||||||
|
"Edit User Phrases" = "編輯使用者詞彙";
|
||||||
|
|
||||||
|
"Reload User Phrases" = "重新載入使用者詞彙";
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue