Align chat spellcheck with compose spellcheck so each chat can have its own language
Categories
(Thunderbird :: Instant Messaging, enhancement)
Tracking
(thunderbird68 fixed, thunderbird69 fixed)
People
(Reporter: jorgk-bmo, Assigned: jorgk-bmo)
Details
Attachments
(1 file)
1.70 KB,
patch
|
aceman
:
review+
jorgk-bmo
:
approval-comm-beta+
|
Details | Diff | Splinter Review |
+++ This bug was initially created as a clone of Bug #1556203 +++
I noticed that chat still uses stone-age spelling while working on the bug above. Also, chatting with Richard in German always marks everything as misspelled. Changing the private chat to German changes the overall preference which is undesired.
We have the technology in the box to set individual languages on individual elements and de-couple from the global preference since TB 38.
Also see Florian's comment in bug 1556203 comment #11. Clearly, setting the language for a conversation shouldn't affect the rest of the system.
Easy port of this stuff:
https://searchfox.org/comm-central/rev/18d2a7176c129e82ade9dce1c729a0a58c095124/mail/components/compose/content/MsgComposeCommands.js#2867
https://searchfox.org/comm-central/rev/18d2a7176c129e82ade9dce1c729a0a58c095124/mail/components/compose/content/MsgComposeCommands.js#6624
https://searchfox.org/comm-central/rev/18d2a7176c129e82ade9dce1c729a0a58c095124/mail/components/compose/content/MsgComposeCommands.js#6671
Assignee | ||
Comment 1•5 years ago
|
||
Testing notes:
Install three dictionaries, select one of them in the compose/spelling settings.
Start a new conversation, language should be set to the default. Change language to something else.
Start another conversation, language should be set to the default. Change language to the third dictionary.
Switch back to the previous conversation, check that language is still what it was. Check that compose/spelling setting has not changed.
Switch to a mail tab, then back to the conversations and check the languages again.
Assignee | ||
Updated•5 years ago
|
Assignee | ||
Comment 2•5 years ago
•
|
||
OK, some background info. Back in the TB 38 days, we implemented that "mail editor mask":
https://searchfox.org/mozilla-central/search?q=eEditorMailMask&case=false®exp=false&path=EditorSpellCheck.cpp
In particular, the pref spellchecker.dictionary is NOT set when the user changes the language in this block controlled by if (!(flags & nsIPlaintextEditor::eEditorMailMask))
https://searchfox.org/mozilla-central/rev/b3b401254229f0a26f7ee625ef5f09c6c31e3949/editor/spellchecker/EditorSpellCheck.cpp#567
Now, since the users choice is not recorded in the pref, there needs to be another mechanism to communicate that change, and that's here:
https://searchfox.org/mozilla-central/search?q=spellcheck-changed&case=false®exp=false&path=
When we get that notification, we know the user changed the language, and we set the "lang" attribute on the element which lets Gecko know which dictionary to use for the spellcheck:
https://searchfox.org/mozilla-central/rev/b3b401254229f0a26f7ee625ef5f09c6c31e3949/editor/spellchecker/EditorSpellCheck.cpp#731
Looks like the code has changes since I last worked on it in 2015-2016.
It's all working in compose windows since TB 38, only that they are more complicated as they have a status display and a spelling button which need to be kept in sync, and there is also the "stand-alone" spellchecker. So the chat stuff only needs the three functional block I ported.
Comment on attachment 9072514 [details] [diff] [review] align-chat-spellcheck-with-compose.patch Review of attachment 9072514 [details] [diff] [review]: ----------------------------------------------------------------- Thanks, for the explanation. This works for me fine. I just slightly worry what other behaviour may (will) be tacked onto the Ci.nsIPlaintextEditor.eEditorMailMask flag that we might not want to chat textarea in the future.
Assignee | ||
Comment 4•5 years ago
|
||
Thanks, https://searchfox.org/mozilla-central/search?q=eEditorMailMask&case=false®exp=false&path= doesn't show anything risky and M-C wouldn't add more code controlled by eEditorMailMask
without letting us know.
Assignee | ||
Updated•5 years ago
|
Pushed by mozilla@jorgk.com:
https://hg.mozilla.org/comm-central/rev/a3afad972033
Align chat spellcheck with compose spellcheck so each chat can have its own language. r=aceman
Assignee | ||
Updated•5 years ago
|
Assignee | ||
Comment 6•5 years ago
|
||
TB 68 beta 2:
https://hg.mozilla.org/releases/comm-beta/rev/9a55685f1b24756e696c00f950ae5f00bdbbb629
Description
•