Open Bug 1402822 Opened 3 years ago Updated 3 days ago

Spellchecker needs to allow multiple language dictionaries at the same time

Categories

(Core :: Spelling checker, enhancement, P3)

enhancement

Tracking

()

Tracking Status
firefox58 --- affected

People

(Reporter: BenB, Unassigned)

References

(Blocks 1 open bug)

Details

(Keywords: parity-chrome, Whiteboard: Please, no comments unrelated to implementation)

Attachments

(1 file)

Problem:
I routinely write emails in 3 different languages. They are all mixed: one email in English, another in German, and some in French. In some cases, I even write 2 different languages to the same person, depending on who else is or was involved in the thread, or depending on the subject.

Importance:
The problem arises for all users who speak several languages. E.g. they speak their local language with their friends, and English with international correspondents. In other words, this bug is important for all international communication (unless your native language happens to be English).

Non-solutions:
I cannot specify the language for each email. That costs too much time, and I'll rather ignore the spell-checker altogether.

Solution:
The only solution is to once - as a configuration - select a number of languages that I know how to write, and then to allow all words in these languages.

This is what Android keyboard does as well.

Out of scope:
If we can automatically detect the language that the user writes, that would be nice, but that would be another bug, an enhancement on top of this bug here.

Etiquette:
*****************************************************
*** Comments from end-users are not allowed here. ***
*****************************************************
These should be posted in bug 69687 instead, as they would be distracting here. Thanks for your understanding. This is an engineering implementation bug. But if you are waiting for this feature and want it to be implemented fast, please vote for this bug here.
How does this differ from bug 481884 that you haven't touched since 2014?

(In reply to Ben Bucksch (:BenB) from comment #0)
> If we can automatically detect the language that the user writes, that would
> be nice, but that would be another bug

Bug 1203024

> *** Comments from end-users are not allowed here. ***

You can ask someone with the right privileges to restrict comments.
Flags: needinfo?(ben.bucksch)
Whiteboard: Please, no comments unrelated to implementation
Flags: needinfo?(ben.bucksch)
Duplicate of this bug: 481884
Duplicate of this bug: 557621
Duplicate of this bug: 693831
> Duplicate of this bug: 481884

Is the older bug duplicate newer? Okay...
Depends on: 481884
Duplicate of this bug: 481884
Priority: -- → P3

Chrome has option "All your languages" (combined): https://bugzilla.mozilla.org/attachment.cgi?id=8845416
Chrome puts different language suggestions together: https://bugzilla.mozilla.org/attachment.cgi?id=9075388

So, Chrome fixed exactly this bug here, in the same way as suggested here.

This is arguably the correct solution. I often mix words from other languages in a sentence.
This is also the easiest solution, because you don't need a complicated and error-prone language detection. You simply make the dictionary the super set of all the languages (typically 2 or 3) that the user selected.

Keywords: parity-chrome

My current work-around is adding ~100K of the most common words from my native dictionary to the 'persdict.dat' file (within your Firefox profile folder). Works OK without any noticeable performance penalty, but I (and probably many others) would definitely love to see multi-language spell checking in Firefox. This is a feature Chrome has since 47.

Hello, I'd like to work on this bug. I've already developed a possible solution and would like some feedback.

Can someone assign this bug to me and guide me through the patch process?

Carlo: Happy to do that! I've assigned the bug to you.
In case you stop working on it, without the fix actually landing in the code tree, please unassign the bug again.
If you have a patch, be sure to ask for review while you attach the patch. The dropdrown should normally suggest appropriate reviewers.
I've also sent you a welcome message with some additional help.

Assignee: nobody → vespacarlo
Status: NEW → ASSIGNED

You can ask any question related to patch submission / etc in https://chat.mozilla.org/#/room/#introduction:mozilla.org

There are other links in the topic of that channel which you may find helpful.

Hi, I'd just like to add my vote to please fix this issue. Technically it's a feature request, but it's a feature that is sorely missed by many, many people around the world.

Actually, Chrome's solution to this is quite elegant: the spellcheck language is set not by a radio button, but by check boxes, and apparently, the browser simply "combines" all selected languages when spellchecking (rather than spellchecking only in the 1 selected language).

(In reply to cOgnaut from comment #13)

Actually, Chrome's solution to this is quite elegant: the spellcheck language is set not by a radio button, but by check boxes, and apparently, the browser simply "combines" all selected languages when spellchecking (rather than spellchecking only in the 1 selected language).

This is what I implemented, but I have been really busy recently and don't have the time to actually finish working on it, for now.
Especially because on my macbook it takes ages to compile.

I hope to get some free time to finally finish the patch and post it here for review.

This is what I implemented

Can you share the code, please?

Assignee: vespacarlo → nobody
Status: ASSIGNED → NEW

Here it is. This is after a git pull --rebase.
Unfortunately, mach tells me there's something in my tree that doesn't let it compile, so I don't even know if it compiles now. I would have to checkout everything again from scratch and run a full compile, but it would take hours.

The code worked when I wrote it, the patch was missing a couple of failing tests to be fixed and general polishing / splitting in multiple smaller commits.

The result was that the dictionary selection menu was not a radio group anymore but a multiple select and misspelling suggestions would come out in round robin for each message, because hunspell doesn't return a score to sort by.

You need to log in before you can comment on or make changes to this bug.