diff options
Diffstat (limited to 'src/index.js')
-rw-r--r-- | src/index.js | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/index.js b/src/index.js index 758b11dc9..97a4f0379 100644 --- a/src/index.js +++ b/src/index.js | |||
@@ -550,6 +550,20 @@ ipcMain.on('stop-find-in-page', (e, action) => { | |||
550 | e.returnValue = null; | 550 | e.returnValue = null; |
551 | }); | 551 | }); |
552 | 552 | ||
553 | ipcMain.on('set-spellchecker-locales', (e, { locale, serviceId }) => { | ||
554 | if (serviceId === undefined) { | ||
555 | return; | ||
556 | } | ||
557 | |||
558 | const serviceSession = session.fromPartition(`persist:service-${serviceId}`); | ||
559 | const [defaultLocale] = serviceSession.getSpellCheckerLanguages(); | ||
560 | debug(`Spellchecker default locale is: ${defaultLocale}`); | ||
561 | |||
562 | const locales = [locale, defaultLocale, DEFAULT_APP_SETTINGS.fallbackLocale]; | ||
563 | debug(`Setting spellchecker locales to: ${locales}`); | ||
564 | serviceSession.setSpellCheckerLanguages(locales); | ||
565 | }); | ||
566 | |||
553 | // Quit when all windows are closed. | 567 | // Quit when all windows are closed. |
554 | app.on('window-all-closed', () => { | 568 | app.on('window-all-closed', () => { |
555 | // On OS X it is common for applications and their menu bar | 569 | // On OS X it is common for applications and their menu bar |