AtomLinter / linter-spell

Multilingual grammar-specific spell checking for Atom and linter using Ispell compatible interface such as GNU Aspell or Hunspell.
https://atom.io/packages/linter-spell
MIT License
14 stars 1 forks source link

updateDictionaries() always throws error if dictionary for the locale is not available #54

Open naota opened 7 years ago

naota commented 7 years ago

updateDictionaries() is using user's locale, so that hunspell try to load a dictionary for the locale. If dictionaries for the locale is not available (like in "ja_JP" locale), hunspell exits with error claiming "Can't open affix or dictionary files for dictionary named "ja_JP"." Thus, the fucntion always popups "Call to hunspell failed with a code of 1" error, which is irritating.

How about calling the process with LANG=C instead? It's not necessary here to honor user's locale.

shuntaroy commented 7 years ago

I encounter the same issue with hunspell. It might be better to add -d {defaultLangages} when executing updateDictionaries() for robustness instead of just adding LANG=C which may cause another conflict in a specific language environment.

@naota I found an ad-hoc solution. You can avoid the error message by adding two empty files named ja_JP.dic and ja_JP.aff into ~/Library/Spelling (if you use macOS) or somewhere else in the path of hunspell. The execution permission (+x) may be required for both files.