13 Adding a Spellcheck Language Dictionary to Manuskript
TheShadowOfHassen edited this page 2024-01-09 11:31:37 -05:00

The spellcheck feature of manuskript is provided by the PyEnchant package. Additional language dictionaries can be added to Manuskript to enable spell check to work with other languages.

Following are instructions to add dictionaries based on which Operating System you use.

GNU/Linux

Note: At the moment, you cannot add additional language dictionaries to the Flatpak or Snap releases

Identify the language code and install the dictionary package.

Debian based (Debian, Ubuntu, Mint, etc.)

  1. Search for desired language dictionary (e.g. Brazilian Portuguese)

    apt-cache search aspell | grep -i portuguese
    

    Sample output:

    aspell-pt - Portuguese dictionaries for GNU Aspell (old package)
    aspell-pt-br - Brazilian Portuguese dictionary for GNU Aspell
    aspell-pt-pt - European Portuguese dictionary for GNU Aspell
    
  2. Install the desired language dictionary package:

    sudo apt install aspell-pt-br
    

Fedora based (Fedora, CentOS, etc)

  1. Search for desired language dictionary (e.g. Spanish)

    su -c "dnf search aspell | grep -i spanish"
    

    Sample output:

    aspell-es.x86_64 : Spanish dictionaries for Aspell
    
  2. Install the desired language dictionary package:

    su -c "dnf install aspell-es"
    

Windows

These instructions assume you are using the Windows binary package which is built using PyInstaller. The default dictionary languages installed are shown in the following screen shot:

manuskript-windows-default-dictionaries

With the Windows PyInstaller package, the enchant dictionary files are stored under the "manuskript/enchant/data/mingw32/share/enchant/hunspell/" directory. The dictionary files have a pair of names: *.aff and *.dic

  1. Locate the desired language at the following link: LibreOffice dictionaries.

  2. Download the two files *.aff and *.dic for the desired language.

    For example, for Hebrew there is the he_IL directory which contains the he_IL.aff and he_IL.dic files.

    Be sure to download the raw or plain content of the file. With a web browser right-click on plain and choose Save link as or Save target as.

    Spellcheck Language Plain File Download

  3. Copy these two files to the "manuskript/enchant/data/mingw32/share/enchant/hunspell/" directory where you unzipped manuskript.

  4. Now when you run manuskript.exe the Hebrew dictionaries are available under the Tools -> Dictionary menu.

    manuskript-windows-added-hebrew-dictionary

Mac OS X

Follow the same process that is explained in the Windows section.

Note for M1/M2 Macs: pyenchant is a wrapper for the C library "enchant" which also has to be installed, you might be experiencing issues with installing/getting it to work on an M chip Mac. Full description of the issue and potential solutions can be found here: https://github.com/pyenchant/pyenchant/issues/265

Troubleshooting

If all words are marked as incorrect (Windows)

Please make sure you downloaded plain versions of dictionary files. As the docs stated: With a web browser right-click on plain and choose Save link as or Save target as.

Language Tool

Language tool is a powerful open source grammar checker. Manuskript uses the python module language-tool-python which can be found here: https://pypi.org/project/language-tool-python/

Installing

At the moment there isn't any way to add LanguageTool to the binaries.(Windows exe, Mac binary, flatpak, and snap) If you are using source or installed manuskript using your linux distribution's package manager(or the offered up-to-date packages), it should be easy.

Open your terminal and run:

pip install language-tool-python

If this runs errors, check if pip has a different way to install packages on your system. Or if you are on Linux, some distributions don't come with pip installed.

Once pip reports the package installed, close all instances of manuskript and run manuskript. It will take a while to launch because language-tool-python is downloading the language tool package. When the start-up window appears, the installation is successful. You can select LanguageTool from the dictionary pane as it says above.