Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rockat.chat update into 2.17.3 leave reference of deleted dictionaries #1497

Closed
Xarkam opened this issue Feb 4, 2020 · 22 comments
Closed

Rockat.chat update into 2.17.3 leave reference of deleted dictionaries #1497

Xarkam opened this issue Feb 4, 2020 · 22 comments

Comments

@Xarkam
Copy link

Xarkam commented Feb 4, 2020

My Setup

  • Operating System: Windows 10 1909
  • App Version: 2.17.3
  • Installation type: exe

Description

image
image
image

Current Behavior

I have updated Rocketchat from 2.17.2 to 2.17.3.
I still see the list of old dictionaries used in the old format.
But, they were installed in the dictionaries folder: C:\Program Files\Rocket.Chat\resources\dictionaries
I added the new FR dictionary from chrome.
The correction no longer works. As on the capture we see that no dictionaries are selected. That's why it doesn't work anymore. When I click to select a dictionary present on the disc, I do not have the check mark in the menu.
I do not understand how the list of old format dictionaries is still present.
There are no errors in the console.

Expected Behavior

Using dictionary

@ankar84
Copy link

ankar84 commented Feb 4, 2020

Same here.
I copied dictionary file from c:\Users\UserName\AppData\Local\Google\Chrome\User Data\ru-RU-3-0.bdic to c:\Program Files\Rocket.Chat\resources\dictionaries\ru-RU.bdic but nothing happened.
image

@tassoevan tassoevan changed the title Rockat.chat update into 2.17.3 leave reference of deleted dictionaries. Rockat.chat update into 2.17.3 leave reference of non-binary dictionaries Feb 4, 2020
@tassoevan tassoevan added this to the 3.0.0 milestone Feb 4, 2020
@tassoevan tassoevan changed the title Rockat.chat update into 2.17.3 leave reference of non-binary dictionaries Rockat.chat update into 2.17.3 leave reference of deleted dictionaries Feb 4, 2020
@tassoevan
Copy link
Collaborator

The app always get the list of dictionaries by looking at the directory; nothing is cached besides the list of enabled ones. Is this happening even after restarting the app?

@Xarkam
Copy link
Author

Xarkam commented Feb 4, 2020

@tassoevan yes, is happening even deleting \AppData\Roaming\Rocket.Chat folder.

@tassoevan
Copy link
Collaborator

@Xarkam @ankar84 What about the %AppData%\Microsoft\Spelling\ directory? Maybe the Windows Spell Checking API is adding files there and the @felixrieseberg/spellchecker module is loading them by default.

@Xarkam
Copy link
Author

Xarkam commented Feb 4, 2020

@tassoevan no because it's come from Office
image
And I have more fr spelling dictionaries referenced.

I have already searched for all the .dic files on my disks and cannot find anything.
Rocketchat is installed for all users of the machine.

In my listing the fr_FR-3-0 come from chrome.
Even if the references are ghosts, I should be able to use the dictionary coming from chrome. This is not the case.

@ankar84
Copy link

ankar84 commented Feb 5, 2020

@Xarkam @ankar84 What about the %AppData%\Microsoft\Spelling\ directory? Maybe the Windows Spell Checking API is adding files there and the @felixrieseberg/spellchecker module is loading them by default.

For me it is 2 folders in c:\Users\UserName\AppData\Roaming\Microsoft\Spelling\ folder
image

I updated to 2.17.5
image
and I can see this:
image
And now I can check ru-RU
image
But spell check don work anyway
image

Then I copied dictionary file from c:\Users\UserName\AppData\Local\Google\Chrome\User Data\ru-RU-3-0.bdic to c:\Program Files\Rocket.Chat\resources\dictionaries\ru-RU.bdic again and restart Rocket.Chat
And now I can not check ru-RU againg
image
Then deleted c:\Program Files\Rocket.Chat\resources\dictionaries\ru-RU.bdic file and restart RC and now I can ckeck ru-RU again but Russian spell check do not work
image

@Xarkam
Copy link
Author

Xarkam commented Feb 5, 2020

Have tested the latest version.
I can select spelling dictionnary in my list:
image

  1. I selected fr-be but i have no idea where he finds it
  2. I added fr-FR-3-0.bdic from chrome. I can't select he.

If you try to install spelling dictionnary with rocket.chat installed for all users and is not launched as administrator, you ha this error:
image

@ankar84
Copy link

ankar84 commented Feb 11, 2020

With version 2.17.7 dictionary selection is much better. And en-US spell checker works fine.
But ru-RU do not checking russian text. How to add Russian spell checker support to Rocket.Chat.Electron?

@tassoevan
Copy link
Collaborator

@ankar84 I've rolled-back to plain text dictionaries (pair of *.aff and *.dic). Are you importing both files?

@ankar84
Copy link

ankar84 commented Feb 12, 2020

@ankar84 I've rolled-back to plain text dictionaries (pair of *.aff and *.dic). Are you importing both files?

Yes.
I added dic and aff files from here
I unpacked files, remane it and convert to UTF-8 in Notepad++
dictionaries.zip
But anyway no spell checking...
image

@cdisabatino
Copy link

Other issue : #1426

Version 2.17.7 offers few languages. There is no French whereas in a previous version, French was offered.

image

@Forage
Copy link

Forage commented Feb 12, 2020

Again, French was not included by default in the past, nor have there been more languages included than your current list. At least not since 2.15 when I started using RC. You must have added it yourself manually. To have more included by default is a different discussion/issue though.

@Xarkam
Copy link
Author

Xarkam commented Feb 12, 2020

I tested last night under linux (arch) and I added the hunspell dictionary fr without problem by copy, but only with the root account.

I will test the day under windows if the addition goes well.

@cdisabatino
Copy link

Sorry but it looks like it is not a manual installation. Several colleagues installed the windows client and the fix worked. Personally, I keep the Windows client up to date to make sure it works properly before encouraging my colleagues to update their client.

Currently, a colleague, with version 2.15.5 has several dictionaries and the correction in French works. He did not do manual installation. Its dictionary folder does not contain the languages ​​offered in the rocketchat menu.

I found issues out.

With this #169 I went back to the sources of Atom atom/node-spellchecker#51.

atom/node-spellchecker#69 and atom/node-spellchecker#54 lets me imagine that a version of Atom allowed in a previous version to search for dictionaries on a PC.

I have not analyzed the rocketchat code. I don't have the skills.

Does this hypothesis seem plausible to you ?
It is not the code of rocketchat but of Atom ?

This could explain why the menu offers dictionaries that are not available in the rocketchat dictionaries folder.

Version :
rc_version

Proposed dictionaries :
rc_langues

Dictionary folder :
rc_directory

Functional correction in French :
rc_correct

@cdisabatino
Copy link

I confirm my previous message.

On my computer, I uninstalled the windows client version 2.17.7 by deleting the user data. I installed version 2.15.5. I have not installed additional dictionaries. Spelling correction works in French. Rocktechat offers 20 dictionaries.

Version 2.15.5 : https://github.com/RocketChat/Rocket.Chat.Electron/releases/tag/2.15.5

@Forage
Copy link

Forage commented Feb 12, 2020

They are not included in the different ZIPs, nor the DEB. So unless the EXE is the exception, they must be obtained in some other way on your system, or maybe some stale resource folder somewhere.

@tassoevan
Copy link
Collaborator

2.15.5 uses the spellchecker package; until 2.17.5, @felixrieseberg/spellchecker was used. Both state the following:

Native bindings to NSSpellChecker, Hunspell, or the Windows 8 Spell Check API, depending on your platform. Windows 7 and below as well as Linux will rely on Hunspell.

According to https://docs.microsoft.com/en-us/windows/win32/intl/about-the-spell-checker-api:

The user-specific dictionaries for a language, which hold the content for the Added, Excluded, and AutoCorrect word lists, are located under "%AppData%\Microsoft\Spelling". The filenames are default.dic (Added), default.exc (Excluded) and default.acl (AutoCorrect). The files are UTF-16 LE plaintext that must start with the appropriate Byte Order Mark (BOM). Each line contains a word (in the Added and Excluded word lists), or an autocorrect pair with the words separated by a vertical bar ("|") (in the AutoCorrect word list). Other .dic, .exc, and .acl files present in the directory will be detected by the spell checking service and added to the user word lists. These files are considered to be read-only and are not modified by the spell checking API.

Please notice that all French dictionary names have hyphens (e.g. fr-FR), indicating they come from the Windows Spell Checking API because Hunspell conventions to use underscores (e.g. en_US).

2.17.7 depends on electron-hunspell which provides only the Hunspell engine consistently across platforms. I've to ascertain @ankar84's report though.

@ankar84
Copy link

ankar84 commented Feb 14, 2020

2.17.7 depends on electron-hunspell which provides only the Hunspell engine consistently across platforms. I've to ascertain @ankar84's report though.

I confirm that pre 2.17.7 versions find a lot of system (?) dictionaries, because they have hyphens in their names (like en-US).
image
image

Version 2.17.7 find only dictionaries in folder c:\Program Files\Rocket.Chat\resources\dictionaries\ and one can easy check it by underscores in their names (en_US).
image
image
image

But anyway, I did not find the way to add Russian Spell checker functionality with two different Hunspell dictionaries: one and two
And help in that is appreciated.
image
English Spell checker is works good as you can see.
Update: In devtools on Console I see error:

app.js:6161 Error: ENOENT: no such file or directory, scandir 'C:\Users\username\AppData\Roaming\Rocket.Chat\dictionaries'
getPairsOfDictionaryFiles @ app.js:6161

In there is no such directory
image

Part of code:

const getPairsOfDictionaryFiles = async directoryPath => {
  try {
    return Object.entries((await fs.promises.readdir(directoryPath, {
      encoding: 'utf8'
    })).filter(filename => ['.dic', '.aff'].includes(path.extname(filename).toLowerCase())).reduce((obj, filename) => {
      const extension = path.extname(filename);
      const dictionaryName = path.basename(filename, path.extname(filename));
      return { ...obj,
        [dictionaryName]: { ...obj[dictionaryName],
          [extension.slice(1).toLowerCase()]: path.join(directoryPath, filename)
        }
      };
    }, {})).filter(([, {
      aff,
      dic
    }]) => aff && dic).sort(([a], [b]) => a.localeCompare(b));
  } catch (error) {
    console.error(error);
    return [];
  }
};

@Forage
Copy link

Forage commented Feb 14, 2020

Too bad non of that automatic importing has ever worked on Ubuntu (no matter which package was used) : #1077

@tassoevan
Copy link
Collaborator

@Forage Since now we have some fine control over where to look for dictionaries, we don't need to wait for changes in those packages anymore.

@ankar84
Copy link

ankar84 commented Oct 1, 2020

Fixed in 3.0
image

@tassoevan
Copy link
Collaborator

Closed by #1737

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants