-
Notifications
You must be signed in to change notification settings - Fork 71
Install spell checking on windows
The procedure below is from a discussion comment by @cantosciaran, using gtkspell to enable spell-checking in Zim on Windows. In subsequent testing it was proved that this method works for both portable and non-portable installations of Zim.
The Zim root directory is referred to as c:\zim below, but will differ depending on where you have Zim installed. e.g. a portable install could be in c:\zim whereas a non-portable install is most likely in C:\Program Files\Zim Desktop Wiki
-
Install Python, version v3.11 (e.g. 3.11.8). From testing, v3.12 won't work.
-
Install pygi-aio-3.24.1-rev1-setup. This provides the files for Zim spellcheck support.
- default path -> should be the \python311\lib\site-packages folder of your install -> Next
- Packages:
- GNOME/Freedesktop libraries: base packages -> Next
- Non-GNOME libraries: GTKSpell 3.0.3 -> Next
- Dev packages: none -> Next
- confirm &tc. -> Next
-
Install pyenchant: Open CMD - go to your Python3.11\scripts folder and run:
pip install pyenchant
. This provides the dictionary files. -
Copy specific (or all) dictionary files to your Zim install folder. For any single language, both an .aff and .dic file are required:
- From: \Python311\Lib\site-packages\enchant\data\mingw64\share\enchant\hunspell
- To: the share\enchant\myspell folder of your Zim install e.g. c:\zim\share\enchant\myspell. It is likely you will need to create the enchant\myspell folders.
-
Copy the requisite files for Spellcheck support to your Zim install folder: libenchant-1.dll, libgtkspell3-3-0.dll, libstdc++.dll
- From: \Python311\Lib\site-packages\gnome
- To: the root of your Zim install e.g. c:\zim
-
Copy folders: enchant, girepository-1.0
- From: \Python311\Lib\site-packages\gnome\lib
- To: the lib folder in your Zim install e.g. c:\zim\lib
-
Launch Zim -> Edit -> Preferences -> Plugins -> Spell Checker
- Check the box to enable
- Click the Properties button: Set your dictionary language (whatever code matches your language in the dictionaries you copied, e.g.
en-IE
), or edit your environ.ini to set your # Interface language
-
use Tools -> Check spelling (or F7) to enable/disable.
-
If desired, uninstall pygi-aio and python if you don't need them for anything else.
From mailing list message by Nathan King:
Here is the closest thing to an idiots guide I can offer. This requires running Zim from source. I know this works with Zim 0.60 on Windows XP 32 bit and 64 bit but you must use 32 bit python. I do not know if this works for Windows 7. According to Jeff this is working with a Windows 7, 64 bit.
-
Download and install the following.
- python 2.6.6 (32 bit) - http://www.python.org/ftp/python/2.6.6/python-2.6.6.msi
- pyGTK-all-in-one GTK2.22 - http://ftp.gnome.org/pub/GNOME/binaries/win32/pygtk/2.22/pygtk-all-in-one-2.22.6.win32-py2.6.msi
- pyenchant-1.5.3 - http://pypi.python.org/packages/any/p/pyenchant/pyenchant-1.5.3.win32.exe
- PyGTKSpell-2.25.3 - http://gramps-project.org/wiki/images/f/ff/PyGTKSpell-2.25.3.win32-py2.6.zip
-
Download and extract the latest zim src(June 2013, using 0.60, I extracted to C:\Program Files (x86)\zim-0.60):
-
Create a copy of [zim_root]\zim.pyand rename the copy to [zim_root]\zim.pyw(the .pyw extension allows launching without a shell).
-
Do one of the following: a. add the installed location of Enchant to the windows path. eg: C:\Python26\Lib\site-packages\enchant (this is my preferred option) or b. Edit [zim_root]\zim.pyw, add import enchant at the top with the other imports
-
Start zim using [zim_root]\zim.pyw --standalone (January 2013, starting with 0.58 the --standalone tag is required)
Here are a couple additional tips that helped Jeff
Use "en_US" for United States English. The dictionaries are part of the Enchant install and should be someplace like: C:\Python26\Lib\site-packages\enchant\share\enchant\myspell There should be several .dic files and .aff files. The Zim configuration uses the name (without the file extension) of the .dic files.
To get Zim to run from the source code without also having a DOS window open you need to use the .pyw extension however, to get Zim to start from the .pyw you need to include "--standalone" in the start command. The easiest way to do this is to create a windows shortcut and in the Target field include the --standalone argument. For example my shortcut has target (quotes included): "C:\Program Files (x86)\zim-0.60\zim.pyw" --standalone