getAvailableDictionaries = win => {
  if (!win.webContents.session.isSpellCheckerEnabled) {
    console.warn('Spell Checker not available but dictionaries requested.')
    return []
  } else if (isOsx) {
    // NB: On macOS the OS spellchecker is used and will detect the language automatically.
    return []
  }
  return win.webContents.session.availableSpellCheckerLanguages
}
@param {BrowserWindow} win The browser window.
@returns {string[]} List of available spellchecker languages or an empty array on macOS.