Update: We had to pull these changes out of Firefox 4 because of some regressions that they caused. We will revisit this issue after Firefox 4, and will hopefully deliver this set of fixes in the next version of Firefox.
I landed a patch today which changes the Firefox 4 built-in spell checker in two important ways:
- Firefox 4 will be able to correctly spell check words containing hyphens, such as the English word "scot-free".
- Firefox 4 will be able to correctly spell check words up to 130 letters long.
Here is the slightly longer version of what changed. Before this change, when Firefox saw a word such as "scot-free", it would break it into two words, "scot" and "free", and pass each of them to Hunspell (which is the spell checking engine we use) to see if they are correctly spelled or not. So, even though the word was correctly spelled, Hunspell would not have any way to know that, because all it saw was Firefox asking it whether "scot" is correctly spelled, and whether "free" is correctly spelled. The result was that "scot" was underlined as incorrectly spelled.
After this change, Firefox would pass the entire word, "scot-free" to Hunspell, which would enable Hunspell to recognize the whole word, and make the correct decision about its spelling. This is especially important for the languages which use the hyphen character as part of the non-compound words frequently.
Also, previously, Firefox would automatically mark any word with more than 64 letters as being incorrectly spelled. This is a problem for languages which tend to have words much longer than that, such as German and Swedish, to name a few. The new limit is 130 letters. This new limit might also not be enough for some words in some languages. We plan to remove this limit entirely in future Firefox versions.
If you’re a localizer, or a dictionary author, there shouldn’t be any need for you to change the dictionary files for your language. However, it would be great if you can test Firefox 4 nightlies starting from tomorrow with your languages to verify that it correctly recognizes long words in your language, or those words which have a hyphen in them (and are not compound words). Keep in mind that these changes will only affect your language if the dictionary is capable of recognizing those words. If you see any issues with this, please file a bug to let us know.
For the gory details, the curious reader can read bug 355178.