atom / spell-check

Spell check Atom package
MIT License
204 stars 121 forks source link

Second locale (not system) has no effect (ru_RU) #290

Open badfiles opened 5 years ago

badfiles commented 5 years ago

It is somehow impossible to add a second locale to spell-checker. I tried ru_RU, en_US (only US works), changed order (only US works) ru_RU (does not work at all) en_US (works)

System locale is en_US

Ubuntu 18.04, atom 1.33.1, spell-check 0.74.2

hunspell -D
AVAILABLE DICTIONARIES (path is not mandatory for -d option):
/usr/share/hunspell/en_US
/usr/share/hunspell/en_CA
/usr/share/hunspell/en_AU
/usr/share/hunspell/en_GB
/usr/share/hunspell/en_ZA
/usr/share/hunspell/ru_RU
/usr/share/myspell/dicts/hyph_ru_RU
LOADED DICTIONARY:
/usr/share/hunspell/en_US.aff
/usr/share/hunspell/en_US.dic
ghost commented 5 years ago

You need to use the IETF language tag, hombre. Replace your underscores with hyphens within the add-on setting and reference https://www.iana.org/assignments/lang-subtags-templates/lang-subtags-templates.xhtml

badfiles commented 5 years ago

I don'k know which underscores should be hyphens screenshot from 2019-01-10 16-24-54

ghost commented 5 years ago

Looks like the correct IETF language tags now. Perhaps the language pack can't be read from the host?

badfiles commented 5 years ago

I never tried en_US or ru_RU, only en-US and ru-RU, but ru-RU does not work no matter if I use it alone or with en-US. en-US always works.

dmoonfire commented 5 years ago

Could you look at the console when it shows the error and paste that? If it can't find the Russian dictionary, it should give an error along with the search paths it tried.

The code tries to normalize dashes and underscores. We went with IEFT tags internally and then check both the - and _ versions.

max-underthesun commented 5 years ago

got similar problem... second locale (ru-RU) not working for me two languages in the file and Russian text underscored with red (all words, and no suggestions) it looks, like only English spell-check is working

Ubuntu 18.04, Atom 1.34.0 x 64

:~$ hunspell -v
@(#) International Ispell Version 3.2.06 (but really Hunspell 1.6.2)

...

~$ /usr/bin/hunspell -D
SEARCH PATH:
.::/usr/share/hunspell:/usr/share/myspell: ...
.....
AVAILABLE DICTIONARIES (path is not mandatory for -d option):
/usr/share/hunspell/en_US
/usr/share/hunspell/ru_RU
LOADED DICTIONARY:
/usr/share/hunspell/en_US.aff
/usr/share/hunspell/en_US.dic
Hunspell 1.6.2

I have en-US, ru-RU in Settings > Locales it is clear in the console, no errors, no warnings

GoPavel commented 5 years ago

Instead of spell-check you can use linter-spell. It's bad, but not worse than a text editor, which can't call simple utilities and show the result.

dmoonfire commented 5 years ago

With the changes in Atom 1.37 (now a beta), we changed how we are passing accented and non-Latin characters to Hunspell. Could you please check out the beta and see if you are still having a problem? Thank you.

max-underthesun commented 5 years ago

Hi @dmoonfire! I've tried it with beta it's working but unstable it could work, then stop working I've tried it next way:

thank you for this package! it is very useful (when it is working ))))

dmoonfire commented 5 years ago

@max-underthesun What platform and distribution if Linux? My Russian is terrible so could you give me an example of what you are putting before using corrections?

max-underthesun commented 5 years ago

@dmoonfire I am on Ubuntu 18.04.2 LTS (desktop) what am i putting? ))) some terrible stuff with tons of mistakes in nearly every word))) like:

thisse is the anly путылка которуйю я будту drinkeng tonight и эта бутет вотка because i lovve vodka ошень сильно

this way i am changing languages in one sentence in a file (this is my usual workflow) and at some point it stopping to check errors (but it was checking both languages some time ago... sorry could't say from which version it failed)