Electron-47

1. Added a default language ('en-US') for windows
2. Included app.asar.unpacked dir in the windows installer as `spawn-rx` module is required for spellchecker to work.
This commit is contained in:
Kiran Niranjan
2017-08-01 13:28:32 +05:30
committed by Kiran Niranjan
parent e21f7adfaa
commit ae0398d8d0
2 changed files with 41 additions and 3 deletions

View File

@@ -1,5 +1,6 @@
const { remote } = require('electron');
const { MenuItem } = remote;
const { isMac } = require('./../utils/misc');
const { SpellCheckHandler, ContextMenuListener, ContextMenuBuilder } = require('electron-spellchecker');
class SpellCheckHelper {
@@ -14,6 +15,15 @@ class SpellCheckHelper {
initializeSpellChecker() {
this.spellCheckHandler.attachToInput();
// This is only for window as in mac the
// language is switched w.r.t to the current system language.
//
// In windows we need to implement RxJS observable
// in order to switch language dynamically
if (!isMac) {
this.spellCheckHandler.switchLanguage('en-US');
}
const contextMenuBuilder = new ContextMenuBuilder(this.spellCheckHandler, null, false, SpellCheckHelper.processMenu);
this.contextMenuListener = new ContextMenuListener((info) => {
contextMenuBuilder.showPopupMenu(info);