Spell checker occasionally reverts to United States

Talk about code development, features, specific bugs, enhancements, patches, and similar things.
Forum rules
Please keep everything here strictly on-topic.
This board is meant for Pale Moon source code development related subjects only like code snippets, patches, specific bugs, git, the repositories, etc.

This is not for tech support! Please do not post tech support questions in the "Development" board!
Please make sure not to use this board for support questions. Please post issues with specific websites, extensions, etc. in the relevant boards for those topics.

Please keep things on-topic as this forum will be used for reference for Pale Moon development. Expect topics that aren't relevant as such to be moved or deleted.
xtal256
Moon lover
Moon lover
Posts: 98
Joined: 2014-06-22, 00:32
Location: here

Spell checker occasionally reverts to United States

Post by xtal256 » 2014-08-19, 23:27

I have installed the Australian dictionary and selected it as the spell check language, but on some occasions I notice it has reverted to US English.
Image

I cannot say for certain when it happens, although when I change it back it seems to stick until I restart the browser.

I have looked into this before, but I didn't find any answers. I have set the preference "spellchecker.dictionary" to "en-AU" (which, strangely, was "en-US" before I changed it, even when the spell checker was using AU), but that has not helped.

This is driving me crazy. If it's not going to be fixed soon, I'd like to at least know if or how I can remove the US language and just use AU.

User avatar
Moonchild
Project founder
Project founder
Posts: 39638
Joined: 2011-08-28, 17:27
Location: Sweden

Re: Spell checker occasionally reverts to United States

Post by Moonchild » 2014-08-20, 09:59

xtal256 wrote:I cannot say for certain when it happens, although when I change it back it seems to stick until I restart the browser.
I have looked into this before, but I didn't find any answers. I have set the preference "spellchecker.dictionary" to "en-AU" (which, strangely, was "en-US" before I changed it, even when the spell checker was using AU), but that has not helped.
Thanks for reporting this. It's indeed an intermittent problem.

I looked at the code involved, and I can see where this might go wrong - the problem is that the Mozilla code for that part only uses the pref as a fallback, not as a first choice. It tries to automatically select the spellchecker dictionary based on the language set in the context or the language specified on the element. This allows people to automatically have the correct dictionary selected if they are often visiting pages in multiple languages, but obviously interferes if you want to override this.

It's a known issue in Firefox that apparently has been left to sit unattended. See bug #717433, bug #728069 and specifically comment 2 on bug #682564 for the randomness involved, especially if the same main language (en-XX).

I'll see if I can improve this code somehow, but I'll have to research where and when exactly spellchecker.dictionary is being set. Maybe I just need a new override pref to "always use the user-set value" or something.

As a workaround, delete or rename "en-US" files in the "dictionaries" folder under the Pale Moon installation folder. That should work to remove it as an option.
"Sales hates anything that can't be turned into a confident sentence." - anonymous warehouse worker
"Why debate someone you fundamentally don't trust?" - Dario Amodei
"Seek wisdom, not knowledge. Knowledge is of the past; wisdom is of the future." -- Native American proverb
"Linux makes everything difficult." -- Lyceus Anubite

xtal256
Moon lover
Moon lover
Posts: 98
Joined: 2014-06-22, 00:32
Location: here

Re: Spell checker occasionally reverts to United States

Post by xtal256 » 2014-08-21, 10:07

Moonchild wrote:It's a known issue in Firefox that apparently has been left to sit unattended.
Why does that not surprise me?

Oh well, thanks for at least looking at this, and rather quickly too. That's more than I can say about most other open-source projects.

User avatar
Antonius32
Add-ons Team
Add-ons Team
Posts: 695
Joined: 2014-05-25, 11:18
Location: Netherlands

Re: Spell checker occasionally reverts to United States

Post by Antonius32 » 2014-08-22, 20:17

So it's not just me.. Good to know that it's being looked into!

spiralofhope

[SOLVED] Spell checker occasionally reverts to United States

Post by spiralofhope » 2015-06-13, 03:19

SOLVED

TL;DR

- Pale Moon 25.5.0 (thank you!)
- British English Dictionary (Forked by Marco Pinto) 2.25
- about:config - spellchecker.dictionary.override;en_GB

Long-form solution

25.5.0 introduces the fix to this problem. Thank you!
Added a preference for always preferring a certain dictionary language.
To use this, create a new preference spellchecker.dictionary.override (string) and set it to your language code.
The british-english addon I used was British English Dictionary (Forked by Marco Pinto) 2.25

In about:config, add spellchecker.dictionary.override with the text en_GB


----

This issue still exists in vanilla Firefox:

- Bug 1073827 - Spellchecker fails to honour/remember user's choice of language/dictionary
- Bug 1073840 - Pref: Always honour setting of spellchecker language/dictionary in user prefs, regardless of lang attribute or Content-Language header

The following solution is impossible, since that directory and those files are no longer present.
delete or rename "en-US" files in the "dictionaries" folder under the Pale Moon installation folder.
.. but who cares about all that Firefox bs. Pale Moon has an actual solution.

spiralofhope

Re: Spell checker occasionally reverts to United States

Post by spiralofhope » 2015-06-13, 03:42

I created a screenshot walkthrough of the solution:

http://blog.spiralofhope.com/?p=6792

moderator, let me know if I shouldn't link to my blong and should instead upload the images to a third-party host and re-create the whole thing here.

BernardZ

Re: Spell checker occasionally reverts to United States

Post by BernardZ » 2015-06-15, 07:28

What Australian dictionary do you recommend?

Furthermore I would like a switch to go from US to Australian dictionaries and back again. The reason for this, when I am on Australian sites, I like to use Australian English and when I am on US sites, I like to use US English. I think it needs a switch as some Australian sites are hosted in the US, and some US sites are shadowed in Australia, also some sites like the Wikipedia use the local English on different pages.

lyceus

Re: Spell checker occasionally reverts to United States

Post by lyceus » 2015-06-16, 02:38

Uh oh! It's true, even if I have the override to es_MX dictionary I am set again in English es_ES. :wtf: