Add context menu to select spelling language

This commit is contained in:
Yuya Ochiai
2017-04-27 00:42:48 +09:00
parent 3a9227f974
commit 256e317402
10 changed files with 103 additions and 44 deletions

View File

@@ -148,10 +148,14 @@ notification.override({
}
});
const spellCheckerLocale = ipc.sendSync('get-spellchecker-locale');
webFrame.setSpellCheckProvider(spellCheckerLocale, false, {
spellCheck(text) {
const res = ipc.sendSync('checkspell', text);
return res === null ? true : res;
}
});
function setSpellChecker() {
const spellCheckerLocale = ipc.sendSync('get-spellchecker-locale');
webFrame.setSpellCheckProvider(spellCheckerLocale, false, {
spellCheck(text) {
const res = ipc.sendSync('checkspell', text);
return res === null ? true : res;
}
});
}
setSpellChecker();
ipc.on('set-spellcheker', setSpellChecker);