async switchLanguage (lang) {
    if (isOsx) {
      // NB: On macOS the OS spell checker is used and will detect the language automatically.
      return true
    } else if (!lang) {
      throw new Error('Expected non-empty language for spell checker.')
    } else if (this.isEnabled) {
      await ipcRenderer.invoke('mt::spellchecker-switch-language', lang)
      this.lang = lang
      return true
    }
    return false
  }
Explicitly switch the language to a specific language.

NOTE: This function can throw an exception.

@param {string} lang The language code
@returns {Promise<boolean>} Return the language on success or null.