diff --git a/aegisub/src/spellchecker_hunspell.cpp b/aegisub/src/spellchecker_hunspell.cpp index 6fffd7378..88ba834c8 100644 --- a/aegisub/src/spellchecker_hunspell.cpp +++ b/aegisub/src/spellchecker_hunspell.cpp @@ -194,7 +194,10 @@ wxArrayString HunspellSpellChecker::GetLanguageList() { } void HunspellSpellChecker::SetLanguage(wxString language) { - if (language.empty()) return; + if (language.empty()) { + hunspell.reset(); + return; + } wxString userDicRoot = StandardPaths::DecodePath(lagi_wxString(OPT_GET("Path/Dictionary")->GetString())); wxString dataDicRoot = StandardPaths::DecodePath("?data/dictionaries"); diff --git a/aegisub/src/subs_edit_ctrl.cpp b/aegisub/src/subs_edit_ctrl.cpp index 969b08328..ba76844a5 100644 --- a/aegisub/src/subs_edit_ctrl.cpp +++ b/aegisub/src/subs_edit_ctrl.cpp @@ -883,12 +883,13 @@ void SubsTextEditCtrl::OnUseSuggestion(wxCommandEvent &event) { void SubsTextEditCtrl::OnSetDicLanguage(wxCommandEvent &event) { wxArrayString langs = spellchecker->GetLanguageList(); - // Set dictionary int index = event.GetId() - EDIT_MENU_DIC_LANGS - 1; - if (index >= 0) { - spellchecker->SetLanguage(langs[index]); - OPT_SET("Tool/Spell Checker/Language")->SetString(STD_STR(langs[index])); - } + wxString lang; + if (index >= 0) + lang = langs[index]; + + spellchecker->SetLanguage(lang); + OPT_SET("Tool/Spell Checker/Language")->SetString(STD_STR(lang)); UpdateStyle(); } @@ -896,7 +897,6 @@ void SubsTextEditCtrl::OnSetDicLanguage(wxCommandEvent &event) { void SubsTextEditCtrl::OnSetThesLanguage(wxCommandEvent &event) { wxArrayString langs = thesaurus->GetLanguageList(); - // Set language int index = event.GetId() - EDIT_MENU_THES_LANGS - 1; wxString lang; if (index >= 0) lang = langs[index];