Rocket.chat.electron: Spelling language missing

Created on 12 Apr 2016  路  13Comments  路  Source: RocketChat/Rocket.Chat.Electron

My Setup

  • My OS name and version: ArchLinux
  • My current app version: 1.3.1

fr_FR is missing in the spelling languages menu. So every word I type is underlined in red.

Thanks.

Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.

spell checker enhancement

Most helpful comment

Unfortunately just adding the dictionary files won't work. This is caused by this part of the code:

https://github.com/RocketChat/Rocket.Chat.Electron/blob/e0a426a2cbad6fc40f0e976848284dc268097031/app/scripts/preload.js#L197-L208

I did some research and this seems to happen in the code:

  • node-spellchecker is loaded via require()
  • Then getAvailableDictionaries() is called which will always return an empty array on Linux (see https://github.com/atom/node-spellchecker/issues/54 and https://github.com/atom/node-spellchecker/issues/51)
  • Now the client falls back to the three dictonaries which are included in the distribution. But the three locales are hard coded in the client (see code linked above)

I see the following ways to fix this:

  1. Wait for the upstream issues to get fixed ;-)
  2. Remove the hard coded locales and check the contents of the dictionaries folder to determine the locales. This way users can add dictionaries more easily.
  3. The same as mentioned in (2) but also check /usr/share/hunspell for dictionaries.

Any thoughts?

Upstream issues:

All 13 comments

I'm also affected, with Ubuntu 16.04. Simply adding the fr_FR.dic & fr_FR.aff in /resources/dictionaries/ is not enough.

After you added those dictionaries did you also try LANG=fr_FR.UTF-8 or the equivalent proper environment variable? This could be a clue that it's not actually looking there for the dicts.

starting rocket.chat.electron with the following command does not help:
$ ./rocketchat --LANG=fr_FR.UTF-8

If anything it would be

export LANG=fr_FR.UTF-8
rocketchat

or

LANG=fr_FR.UTF-8 rocketchat

it does not work either. And the command line output only complains about the certificate.json file that I have deleted earlier.

Unfortunately just adding the dictionary files won't work. This is caused by this part of the code:

https://github.com/RocketChat/Rocket.Chat.Electron/blob/e0a426a2cbad6fc40f0e976848284dc268097031/app/scripts/preload.js#L197-L208

I did some research and this seems to happen in the code:

  • node-spellchecker is loaded via require()
  • Then getAvailableDictionaries() is called which will always return an empty array on Linux (see https://github.com/atom/node-spellchecker/issues/54 and https://github.com/atom/node-spellchecker/issues/51)
  • Now the client falls back to the three dictonaries which are included in the distribution. But the three locales are hard coded in the client (see code linked above)

I see the following ways to fix this:

  1. Wait for the upstream issues to get fixed ;-)
  2. Remove the hard coded locales and check the contents of the dictionaries folder to determine the locales. This way users can add dictionaries more easily.
  3. The same as mentioned in (2) but also check /usr/share/hunspell for dictionaries.

Any thoughts?

Upstream issues:

Hmm, a possible clue as to why I can't get spellchecking to work in Fedora:

$ rpm -ql hunspell-en-US
/usr/share/doc/hunspell-en-US
/usr/share/doc/hunspell-en-US/README_en_US.txt
/usr/share/myspell/en_US.aff
/usr/share/myspell/en_US.dic

I don't have a deep understanding of how the spellchecking works, but I am eager to get it working on Fedora for my package. Thanks for the input!

I've fixed this in node-spellchecker, but the PR is still open.

See: https://github.com/atom/node-spellchecker/pull/69

It that is merged, the spellchecker will search for dictionaries installed globally on the system.

That's awesome. Thank you so much.

Any news on this issue?

+1

+1

Added this issue in 2.15.0 version milestone since I'm refactoring the spell checker code.

Was this page helpful?
0 / 5 - 0 ratings