2011/5/29 Josip <josip@pisoj.com>
On 28.05.2011 22:31, Peter Landgren wrote:
> Hi Windows people,
>
> I have been trying to fix spell checking for Swedish (or any other language) in Gramps 3.3.
> I started with Gramps 3.2.6 and got that OK.
> See: http://www.gramps-project.org/bugs/view.php?id=3866
>
> I must add sv_SE.aff and se_SE.dic from the Open Office spell catalog
> (C:\Program\OpenOffice.org 3\share\uno_packages\cache\uno_packages\32.tmp_\dict-sv.oxt\) to:
> C:\Python26\Lib\site-packages\enchant\share\enchant\myspell>
> in order to get Swedish spelling working.
>

You need dictionary for yours language if you wont spell-check to work.
It is explained on wiki.

> Note:
> 1. enchant must be installed
> 2. Aspell is NOT installed.
>

OpenOffice uses myspell so aspell is not needed (although it can be used
if you like to use aspell dicts)


> Now I have spell checking working in both 3.2.6 and 3.3.0 for Windows XP.
> Remains to test in Windows 7.
>
> Note. In 3.3.0 I had to fix Spell.py
>
> Index: Spell.py
> ===================================================================
> --- Spell.py (revision 17588)
> +++ Spell.py (arbetskopia)
> @@ -34,7 +34,7 @@
>   #-------------------------------------------------------------------------
>   from gen.ggettext import gettext as _
>   import locale
> -
> +import constfunc
>   #-------------------------------------------------------------------------
>   #
>   # Set up logging
> @@ -51,6 +51,8 @@
>   import gtk
>
>   try:
> + if constfunc.win():
> + import enchant
>       import gtkspell
>       HAVE_GTKSPELL = True
>   except ImportError:
>
> ============================================================================
> This is one way of fixing spell checking in Windows XP.
> There might be other ways.
>

The recent version i try is 3.3.0beta in which spellcheck work fine.

Now i see some mention of removing enchant in localisation patch so i
wonder why is that done.
GtkSpell (so PyGtKSpell also) is dependant of Enchant library, so it
must be PyEnchant they mention (as your code show) but it is just small
pure python (ctypes) extension module so what is problem in keeping it
included.

PyEnchant allow as in the past to fix problem with broken dicts engines
(hebrew and turkish ones) as gtkspell does not expose any functions to
deal with them. It is also been suggested to replace (py)gtkspell with
pyenchant entirely.

We used pyenchant only to build a list of installed languages, but gramps spellcheck has always been 100% using gtkspell.
I looked into replacing gtkspell with the pyenchant, and it would be less usable if we don't implement it by ourselves as gtkspell. (no red wiggle underline but instead you need to use a toolbar button which then lists words with problems)

We received a patch so as not to need python-enchant anymore for the list of languages. It works in ubuntu 10.04 -11-04 and Mac, so the old Turkish bug is gone at least a year.
If we still need python-enchant for windows, it should come from the windows developers as a patch checking against windows to import it.

Benny

--
Josip

------------------------------------------------------------------------------
vRanger cuts backup time in half-while increasing security.
With the market-leading solution for virtual backup and recovery,
you get blazing-fast, flexible, and affordable data protection.
Download your free trial now.
http://p.sf.net/sfu/quest-d2dcopy1
_______________________________________________
Gramps-devel mailing list
Gramps-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gramps-devel