Red Hat Bugzilla – Bug 880444
RFE: [WebTrans] enable spell check in code mirror editor for Firefox
Last modified: 2013-02-25 23:06:21 EST
+++ This bug was initially created as a clone of Bug #875965 +++
Description of problem:
With the newly released Zanata version 2.0 Firefox's spell check does not seem to work anymore. I experienced this on FF 3.6, Leticia confirmed this for her FF 10.0.6. The spell-check used to work on both versions with Zanata 1.7.x
Version-Release number of selected component (if applicable):
Original bug is 872384. We introduced an option to switch between Code mirror editor and plain textarea editor as short term solution.
This bug is for permanently enable spell check in code mirror editor.
--- Additional comment from Patrick Huang on 2012-11-12 18:28:50 EST ---
Comment copied from bug 872384:
Patrick Huang 2012-11-08 23:12:13 EST
did some research and below options seems promising:
description: This is a simple Java API that makes it very easy to call Google's spell checker service from Java applications.
pros: simple and easy to use
cons: calling google api means external network traffic
description: Hunspell is the spell checker of LibreOffice, OpenOffice.org, Mozilla Firefox 3 & Thunderbird, Google Chrome.
pros: lots of dictionaries
cons: written in c++ and required a JNA binding
description: pure java based spellchecker and based on most of the algorithms that aspell has
pros: pure java implementation
cons: no update since 2005 and sourceforge only have English dictionary
[reply] [-] Comment 8 Sean Flanigan 2012-11-09 02:22:43 EST
Hmm, Hunspell sounds good, but deploying Zanata could become a real nightmare if we start using JNA.
I still think a toggle is the only option that makes sense for a short-term solution, but just for completeness, I did spot these quick and dirty Hunspell ports too:
Java: http://code.google.com/p/lucene-hunspell/ (tied to Lucene for some reason)
--- Additional comment from Runa Bhattacharjee on 2012-11-26 13:17:47 EST ---
Hi, can we try to squeeze this in for the upcoming release? Thanks.
--- Additional comment from Sean Flanigan on 2012-11-26 20:17:49 EST ---
This (ie syntax highlighting editor with spell-checking) isn't the sort of thing we can squeeze in, if we want to implement it properly, and test it properly. It's far too big.
If we want to cover a decent number of languages in our own spell-checker, we pretty much have to have Hunspell, but there only seems to be one Java port of Hunspell, but it is designed for a different use case, and it is only a prototype. From what I can tell, it's quite a mess, and doesn't even have a build file.
Even if we get Hunspell working, we'll have a fair bit of UI work to integrate a spell-checker into CodeMirror. Especially if we want a pop-up suggestions features?
But they could turn out to have show-stopping problems (eg focus/event problems) when integrated into Zanata. Or cross-platform bugs. And I can't get spell-checking to work in Chrome for either of them so far...
--- Additional comment from Patrick Huang on 2012-11-26 20:45:54 EST ---
I've got spell check working in codemirror in firefox only. It's NOT cross platform (uses firefox only attributes) and doesn't (seems to) support pop up suggestion/add to dictionary etc. BUT it highlights the word in red and it uses firefox build-in spell check facility.
We can definitely squeeze this in :)
--- Additional comment from Sean Flanigan on 2012-11-26 21:14:42 EST ---
Okay, that's good. I suggest creating another bz for the Firefox-only implementation. We should provide a user option to turn it off. (Partly so that the user can turn off spell-check, and partly in case of unexpected problems.)
committed into master:
I can't see an option to turn spell-checking off in the code. Given the unusual behaviour of spell-checking in divs (eg you can't use the context menu to turn it off), it's important to be able to turn it off.
committed into master:
added option to switch on/off.
Combinations of following are tested:
"Use CodeMirror Editor" On, "Enable Spell Check" On
"Use CodeMirror Editor" Off, "Enable Spell Check" On
"Use CodeMirror Editor" On, "Enable Spell Check" Off
"Use CodeMirror Editor" Off, "Enable Spell Check" Off
VERIFIED with Zanata version 2.1-SNAPSHOT (20121204-0903)