WPS Office Spellcheck Not Working

It's not perfect, but you're the first to come up with a solution in ages!

Sure can use browser plugins or other tools like Grammerly and write there; but having at least basic spellchecking in Writer is important.

I tried the instructions and that didn't work for me. Multinlingual (symlink) doesn't show up in the list. I got all the other languages installed.

~/.local/share/Kingsoft/office6/dicts/
That folder exists but is empty

/usr/share/hunspell
folder contains en_US-large.aff and en_US-large.dic, along with en_US.aff and en_US.dic as symlinks

Personally I place all my scripts in my home folder so that I know where they are and can run or edit them easily.

You need to create the fr_FR folder manually. It should be ~/.local/share/Kingsoft/office6/dicts/fr_FR

and then place the dict.conf file in there. After restarting WPS, you should be able to select Multilingual (symlink) in the ā€œSet languageā€ menu (at least this is how it works on my system).

If you got all the other language installed in WPS, maybe try to uninstall them all first. Iā€™m using only the Flatpak version of WPS office but did not install any additional language pack as nothing did make the spell check work. Itā€™s only with this symlink trick that it works on my system.

EDIT: @Hanuman If that still doesnā€™t work, maybe try to place the fr_FR folder in ~/.local/share/Kingsoft/office6/dicts/spellcheck/fr_FR (i.e. create the spellcheck folder too). This doesnā€™t work on my system but it is what was recommended here. Not sure if this applies to older version of WPS. For me I can only see additional languages if I place them directly in the dicts folder (without spellcheck folder!).

If you have the Flatpak version of WPS, you can also create the fr_FR folder in

~/.var/app/com.wps.Office/data/Kingsoft/office6/dicts/fr_FR/

instead of

~/.local/share/Kingsoft/office6/dicts/fr_FR/

and alter the script accordingly. I didnā€™t need to do this though because on my system ~/.local/share/Kingsoft is a symlink pointing to ~/.var/app/com.wps.Office/data/Kingsoft anyways.

If you can see all installed languages in the ā€œSet languageā€ dialog in WPS, Iā€™m pretty positive there is a way to have this symlink trick work on your system too!

Note that my dict.conf file is

[Dictionary]
DisplayName=Multilingual (symlink)
DisplayName[en_US]=Multilingual (symlink)

On the 3rd row you still see [en_US] because my DE interface is using english. If you use another language for your main interface, maybe try to change the en_US to the language code you use in your interface. Not sure if that matters though.

I'll note that with AUR, the dictionaries are installed to
/usr/lib/office6/dicts/spellcheck/

With spellcheck as you mentioned. I'll try adding just that. Nope doesn't work.

So your script takes the dictionaries from /usr/share/hunspell/ The only dictionary there is en-US so what about the others? I could take them from /usr/lib/office6/dicts/spellcheck/ and put them into /usr/lib/office6/dicts/spellcheck/fr-FR but fr-FR is already in that folder. Perhaps it's not reading the 2nd fr-FR because it's already defined in that other folder?

I'm sure there's a way to hack the files around but it could get messy with updates.

Hunspell dictionaries installed in /usr/share/hunspell depend on what langage packs are installed on your system. But you can install more if you want/need to. An alternative is to download language folders from

https://github.com/HoLuLuLu/wps-office-multilang/tree/master/wps-office-bin/opt/kingsoft/wps-office/office6/dicts/spellcheck

which should correspond to what you have in /usr/lib/office6/dicts/spellcheck/.

Please try to install the WPS-office Flatpak version without any additional language packs as this is probably what is messing things up. An additional benefit of the Flatpak version is that you can isolate WPS from the network (e.g. using Flatseal), which is a great thing if you're worried about WPS calling home in China to share some data without you noticing :wink:

It's very likely probable to make this work with the AUR version but I didn't experiment with it so far.

I'm now using an updated version of the script. I have first downloaded language folders from here and placed them in

~/.local/share/Kingsoft/office6/dicts/all

The updated script is:

#!/bin/bash
# This script allows to change the spellcheck language in WPS
# A symlink of it is created in ~/.local/bin
FR_DIR="/home/$(whoami)/.local/share/Kingsoft/office6/dicts/fr_FR"
USE_HUNSPELL="0"
if [ -z "$1" ]; then
  # If no argument is provided, return current language
  DIC_FILE=$(realpath $FR_DIR/main.dic)
  if [ $USE_HUNSPELL == "1" ]; then
    CURRENT=$(basename $DIC_FILE)
  else
    CURRENT=$(basename $(dirname $DIC_FILE))
  fi
  echo "WPS currently using language $CURRENT"
else
  if [ $USE_HUNSPELL == "1" ]; then
    # Use Hunspell dictionary in /usr/share/hunspell
    SOURCE_DIR="/usr/share/hunspell"
    DIC_FILE="$SOURCE_DIR/$1.dic"
    AFF_FILE="$SOURCE_DIR/$1.aff"
  else
    # Use dictionary available in dicts/all. These should be first downloaded from
    # https://github.com/HoLuLuLu/wps-office-multilang/tree/master/wps-office-bin/opt/kingsoft/wps-office/office6/dicts/spellcheck 
    SOURCE_DIR="/home/$(whoami)/.local/share/Kingsoft/office6/dicts/all"
    DIC_FILE="$SOURCE_DIR/$1/main.dic"
    AFF_FILE="$SOURCE_DIR/$1/main.aff"
  fi

  # If an argument is provided, check if selected language is available"
  if test -f $DIC_FILE; then
    ln -sf $DIC_FILE $FR_DIR/main.dic
    ln -sf $AFF_FILE $FR_DIR/main.aff
    echo "WPS language successfully set to $1!"
  else
    echo "ERROR: Language $1 was not found in $SOURCE_DIR. Please try again."
  fi
fi

Say you call this script wpslng. If you call it without any argument, it will return the language currently in use in WPS for spell check (you need to have a file main.dic in the ...dicts/fr_FR folder for this to run). If you want to switch to e.g. american english, type ./wpslng en_US and then (as before), select Multilingual (symling) in the "Set language" dialog in WPS. Note that in the script, you have USE_HUNSPELL="0" which means that language folders in dicts/all will be used instead of the Hunspell dictionaries installed on your system. This allows to use languages that are not in /usr/share/hunspell

Snap/Flatpack is not supported in Garuda.

That script makes more sense, not relying on the location of other files on the system nor trying to change installs apps. I copied the files from WPS all languages pack into that folder, then uninstalled WPS languages packs. Probably need to uninstall otherwise fr_FR is defined twice.

Now it works!! Great

Just checked this thread and seems like lots of different methods and steps all over. Could someone possibly give the easiest or best method and then mark it as the solution for others to see in the future to avoid any confusion? Thanks!

Instructions for Garuda Linux

Install package wps-office-all-dicts-win-languages from AUR

Run the following commands

cp -a /usr/lib/office6/dicts/spellcheck/ ~/.local/share/Kingsoft/office6/dicts/all/
mkdir ~/.local/share/Kingsoft/office6/dicts/fr_FR
nano ~/.local/share/Kingsoft/office6/dicts/fr_FR/dict.conf

Paste this content (ctrl+shift+v) and save (ctrl+x, y)

[Dictionary]
DisplayName=Multilingual (symlink)
DisplayName[en_US]=Multilingual (symlink)

Create this script in your home folder or wherever you want

nano ~/wps_spell.sh

Paste & save

#!/bin/bash
# This script allows to change the spellcheck language in WPS
# A symlink of it is created in ~/.local/bin
FR_DIR="/home/$(whoami)/.local/share/Kingsoft/office6/dicts/fr_FR"
USE_HUNSPELL="0"
if [ -z "$1" ]; then
  # If no argument is provided, return current language
  DIC_FILE=$(realpath $FR_DIR/main.dic)
  if [ $USE_HUNSPELL == "1" ]; then
    CURRENT=$(basename $DIC_FILE)
  else
    CURRENT=$(basename $(dirname $DIC_FILE))
  fi
  echo "WPS currently using language $CURRENT"
else
  if [ $USE_HUNSPELL == "1" ]; then
    # Use Hunspell dictionary in /usr/share/hunspell
    SOURCE_DIR="/usr/share/hunspell"
    DIC_FILE="$SOURCE_DIR/$1.dic"
    AFF_FILE="$SOURCE_DIR/$1.aff"
  else
    # Use dictionary available in dicts/all. These should be first downloaded from
    # https://github.com/HoLuLuLu/wps-office-multilang/tree/master/wps-office-bin/opt/kingsoft/wps-office/office6/dicts/spellcheck 
    SOURCE_DIR="/home/$(whoami)/.local/share/Kingsoft/office6/dicts/all"
    DIC_FILE="$SOURCE_DIR/$1/main.dic"
    AFF_FILE="$SOURCE_DIR/$1/main.aff"
  fi

  # If an argument is provided, check if selected language is available"
  if test -f $DIC_FILE; then
    ln -sf $DIC_FILE $FR_DIR/main.dic
    ln -sf $AFF_FILE $FR_DIR/main.aff
    echo "WPS language successfully set to $1!"
  else
    echo "ERROR: Language $1 was not found in $SOURCE_DIR. Please try again."
  fi
fi

Make executable

chmod u+x ~/wps_spell.sh

Uninstall wps-office-all-dicts-win-languages package.

To use, open terminal in home folder

./wps_spell.sh en_US to set language as en_US
./wps_spell.sh to view currently set language

In WPS Office, set language to Multilingual (symlink).

It could be useful to edit the script for ./wps_spell.sh -l to display all available languages.

5 Likes

Didn't know that Garuda doesn't support Flatpak (I'm on Manjaro). But happy that it now works also with the AUR version!

Flatpaks will of course work with Garuda, it is simply considered unsupported by the team. You are on your own if you choose that method for program installation. The distro's position is that the AUR is the preferred source for installing programs not in our preconfigured list of repos.

5 Likes

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.