Firefox's spell check defaulting (and reverting) to the wrong language

11

1

I'm using Firefox (v. 26 for Ubuntu). I'm in the U.S., and I keep setting the spell check to U.S. English (right click on a word marked as incorrectly spelled, choose Languages, then the correct one). It briefly remembers, but after an hour or so (even within the same session) it reverts to Canadian English.

I'm a web developer and am fine with hacking about:config, but although I've set spellchecker.dictionary to en_US, it doesn't seem to stick around.

Is there any other setting I'm missing?

EmmyS

Posted 2013-12-14T19:52:54.613

Reputation: 1 693

Does anyone have a working solution for this issue yet? I'm stuck with swedish spellcheck. – Shardj – 2019-08-28T15:57:49.283

Ideally, intl.accept_languages, and general.useragent.locale would be en-US too. Also, if the current Firefox edition is a different one, you could try installing the en-US edition. Otherwise if there are extra dictionaries other than the default builtin corresponding to en-US, try disabling/removing them via Tools (Alt + T) > Add-ons.

– vWil – 2013-12-17T16:27:38.573

Thanks; I'll try these suggestions when I get home tonight. – EmmyS – 2013-12-17T19:45:34.773

Well, I set both of those config properties to en-US and restarted with high hopes. No luck; still insists I'm Canadian. I guess I'll try disabling them and see what happens. EDIT: no can do. The only languages listed there are South African and Great British English. Canadian isn't even a choice. How would I know if it's not a US English edition of Firefox. About only shows that it's the version created specifically for Ubuntu. – EmmyS – 2013-12-18T02:08:34.967

Right-click general.useragent.locale and Reset to revert to, and reveal the original locale (Fx) info. If Firefox was installed via the OS tools then usually it would be equivalent to the current OS language/internalization settings unless a different Firefox edition was explicitly chosen. You can view the current OS locale details by entering locale in the terminal. Also, can you please check if this happens in a new Firefox profile.

– vWil – 2013-12-18T14:01:18.317

Reset is grayed out, so I have to assume that it's never been changed. Per locale, Ubuntu knows that I'm in the U.S. And I've never had any other location-based issues (i.e. time zones, etc.) It's only ever been a problem with the FF spellchecker. And yes, it happens with new FF profiles as well. – EmmyS – 2013-12-19T03:52:57.077

Grayed out means it's the default (en-US??) edition. So in a new profile there would only be the builtin US English dictionary, unless the particular Ubuntu edition also includes other dictionaries. Are other dictionaries being listed in the right-click menu of the new profile? If not then it would be the default US English. Also, please check Tools > Add-ons of the new profile to see if any distro-specific extensions etc. are being automatically installed. – vWil – 2013-12-19T15:15:49.013

Dictionaries, spellchecker.dictionary – vWil – 2013-12-19T15:32:10.983

Thanks for following up, @vWil. I've been out of town. Yes, there are other dictionaries being listed in the right click menu of the new profile. There are no add-ons installed. I may just completely uninstall it using the software center and then download a new version directly from FF's site. – EmmyS – 2013-12-26T15:15:36.657

Answers

1

I have a workaround that works for me, but it involves modifying system myspell libraries.

On Ubuntu, this solution appears to work: Askubuntu.com: How can I change Firefox's default dictionary

But somebody may not be using Ubuntu, like myself. I'm using Gentoo, and at this time, all the en_* variations are part of the same package, app-dicts/myspell-en

So my solution is to just delete the ones I've no use for:

cd /usr/share/myspell
ls -lah

 

total 25M
drwxr-xr-x   2 root root 4.0K Apr 17 11:25 .
drwxr-xr-x 438 root root  16K Apr 12 19:27 ..
-rw-r--r--   1 root root  306 Apr 17 11:25 dictionary.lst.en
-rw-r--r--   1 root root  37K Apr 17 11:25 en_AU.aff
-rw-r--r--   1 root root 552K Apr 17 11:25 en_AU.dic
-rw-r--r--   1 root root 1.8K Apr 17 11:25 en_CA.aff
-rw-r--r--   1 root root 683K Apr 17 11:25 en_CA.dic
-rw-r--r--   1 root root  27K Apr 17 11:25 en_GB-oed.aff
-rw-r--r--   1 root root 513K Apr 17 11:25 en_GB-oed.dic
-rw-r--r--   1 root root  27K Apr 17 11:25 en_GB.aff
-rw-r--r--   1 root root 515K Apr 17 11:25 en_GB.dic
-rw-r--r--   1 root root  28K Apr 17 11:25 en_NZ.aff
-rw-r--r--   1 root root 524K Apr 17 11:25 en_NZ.dic
-rw-r--r--   1 root root 3.0K Apr 17 11:25 en_US.aff
-rw-r--r--   1 root root 680K Apr 17 11:25 en_US.dic
-rw-r--r--   1 root root  27K Apr 17 11:25 en_ZA.aff
-rw-r--r--   1 root root 577K Apr 17 11:25 en_ZA.dic
-rw-r--r--   1 root root  78K Apr 17 11:25 hyph_en_GB.dic
-rw-r--r--   1 root root  18M Apr 17 11:25 th_en_US_v2.dat
-rw-r--r--   1 root root 3.0M Apr 17 11:25 th_en_US_v2.idx

 

rm en_AU.*
rm en_CA*
rm en_ZA*
ls -lah

 

total 23M
drwxr-xr-x   2 root root 4.0K Apr 17 11:31 .
drwxr-xr-x 438 root root  16K Apr 12 19:27 ..
-rw-r--r--   1 root root  306 Apr 17 11:25 dictionary.lst.en
-rw-r--r--   1 root root  27K Apr 17 11:25 en_GB-oed.aff
-rw-r--r--   1 root root 513K Apr 17 11:25 en_GB-oed.dic
-rw-r--r--   1 root root  27K Apr 17 11:25 en_GB.aff
-rw-r--r--   1 root root 515K Apr 17 11:25 en_GB.dic
-rw-r--r--   1 root root  28K Apr 17 11:25 en_NZ.aff
-rw-r--r--   1 root root 524K Apr 17 11:25 en_NZ.dic
-rw-r--r--   1 root root 3.0K Apr 17 11:25 en_US.aff
-rw-r--r--   1 root root 680K Apr 17 11:25 en_US.dic
-rw-r--r--   1 root root  78K Apr 17 11:25 hyph_en_GB.dic
-rw-r--r--   1 root root  18M Apr 17 11:25 th_en_US_v2.dat
-rw-r--r--   1 root root 3.0M Apr 17 11:25 th_en_US_v2.idx

And then remove the unwanted lines from dictionary.lst.en

Note: No ZA/CA/AU

# Autogenerated by app-dicts/myspell-en-20081002
DICT en GB en_GB
DICT en US en_US
DICT en NZ en_NZ
DICT en GB en_GB-oed
HYPH en US hyph_en_GB
HYPH en GB hyph_en_GB
THES en US th_en_US_v2
THES en GB th_en_US_v2

And after doing that and restarting Firefox, my menu is as follows:

Screenshot of my language menu showing US and GB and NZ with NZ at the top and no CA/AU

And this is adequate for me, gives me the language default I want, but the others are still there if I desperately need them.

(Though I've still to work out what governs the sort order, if I could work that out I could just rig the default to come first.)

Kent Fredric

Posted 2013-12-14T19:52:54.613

Reputation: 1 446

1

Check to see if you have an "hunspell-en" package installed. Firefox will make use of any Hunspell dictionaries that are installed. These dictionaries are also used by LibreOffice however, so the solution is not as simple as just removing the package. Firefox looks in /usr/share/hunspell for dictionaries, so any ones that you do not want Firefox to use will need to be removed from there. On my laptop (running Arch Linux), most of the dictionaries in /usr/share/hunspell were just symlinks, so they can be safely removed without actually removing the dictionary itself.

However, keep in mind that this is not a permanent solution, since an upgrade to the package will just put those files/symlinks back into place.

Ultimately, I solved the problem by installing the hunspell-en-base package from the AUR, which is a stripped-down package containing just the en_US dictionary.

Erik

Posted 2013-12-14T19:52:54.613

Reputation: 11

That does indeed influence Firefox under GNU/Linux (FF 39 on Ubuntu tested). However, putting a value into spellchecker.dictionary does seem to override the hunspell* packages. I wonder if some add-on is resetting the preferences occasionally. – Cedric Knight – 2015-07-21T15:40:00.333

1

Firefox seems to randomly use any one of the installed dictionaries. Several English dictionaries get installed by default in Ubuntu. The solution is to remove all but the US English dictionary using apt-get.

From How can I change Firefox's default dictionary?, Insperatus posted this useful command:

sudo apt-get remove myspell-en-au myspell-en-gb myspell-en-za hunspell-en-ca && sudo apt-get install myspell-en-us

Before:

firefox spelling language before removal

After:

firefox spelling language after removal

Stephen Ostermiller

Posted 2013-12-14T19:52:54.613

Reputation: 437