signalapp / Signal-Desktop

A private messenger for Windows, macOS, and Linux.
https://signal.org/download
GNU Affero General Public License v3.0
14.5k stars 2.63k forks source link

Support Multiple Spell Check Locales / Option To Disable Spell Checker #1659

Closed Beanow closed 4 months ago

Beanow commented 6 years ago

Description

Currently js/spell_check.js detects and initializes a single locale.

When you speak different languages depending on the contact / situation, being able to switch is an important feature.

Please add:

Edit https://github.com/WhisperSystems/Signal-Desktop/issues/1659#issuecomment-341287034 / https://github.com/WhisperSystems/Signal-Desktop/issues/1659#issuecomment-341457661:

Screenshots

image Example of this feature in Chromium

Platform info

Operating System: Ubuntu 17.04 Browser: Electron app Signal version: 1.0.34

AGlezB commented 5 years ago

Personally I only use spell checking when writing documents o in some emails and even then I usually disable it. Don't even ask me about autocorrect. That is one feature that should not be on by default. As far as I'm concerned spellchecking is only trully useful when I'm writing in a language I'm not fluent in because it will help me convey to the other person what I actually wanted to say.

eligt commented 5 years ago

@rozmansi well, you need both people to be multilingual in the same languages - in that case speaking in both is quite frequent in my experience. Other one person helping the other get more proficient, or if both are proficient, as I mentioned, sometimes certain concepts, especially jokes, are better conveyed in one language over another.

kierun commented 5 years ago

@AGlezB It must be nice not to be dyslexic… Without spell checker, understanding me in writing is harder. And this is not about autocorrect which is a fine example of what goes wrong with AI and indeed has no place in Signal.

@eligt Indeed. I even ended up speaking in three languages to the same person. But two is more common. ☺

ghost commented 5 years ago

What @rozmansi is saying to you all is Git Gud (at writing:)

rozmansi commented 5 years ago

@eligt, I get your point but I am still not convinced. Two of the languages I speak are very similar. Using both spell checkers would void the purpose of spell checking.

Each conversation should support a configurable list of languages. That would cover all cases: you go list "en, fr". I'll put "en" only to the list.

@kierun Congratulations on your thumb up consistency. :)

AGlezB commented 5 years ago

@kierun Spellcheking is a feature which --as it is currently implemented-- does not satisfy the needs of some users. That is why this issue got submitted in the first place. I'm one of those users so for most of my use cases I'd rather disable it than deal with the drawbacks. Off topic: And yes, it is nice belonging to 93 to 97 percent of the population according to Wikipedia. If you need a wheelchair because you have no legs then use the wheelchair. If your wheelchair cannot climb stairs then submit an issue to the manufacturer or just buy a different one which can.

kierun commented 5 years ago

Each conversation should support a configurable list of languages. That would cover all cases: you go list "en, fr". I'll put "en" only to the list.

That is indeed a good solution. Of course, the more languages one uses, the slower it will be. However, that is expected and not a problem.

@kierun Congratulations on your thumb up consistency. :)

¯\(ツ)/¯ I really mean no offence by it and I do appreciate being taken to account on my opinions. If those cannot survive criticism then they are not worth the paper they are printed on. And the irony of those words on a digital medium is not lost.

kierun commented 5 years ago

@AGlezB I am not advocating having spell check on all the time. I am very happy for it to be a on/off settable thing. This is good design. If it is on, I would like it to have multiple settable languages. I really do not care whether it is per chat or global.

If spellchecker is off, then that feature matters not: it does not affect your work flow at all. Why do you care? Or am I missing something in what you are saying?

AGlezB commented 5 years ago

@AGlezB I am not advocating having spell check on all the time. I am very happy for it to be a on/off settable thing. This is good design. If it is on, I would like it to have multiple settable languages. I really do not care whether it is per chat or global.

If spellchecker is off, then that feature matters not: it does not affect your work flow at all. Why do you care? Or am I missing something in what you are saying?

Not at all. Like I said over a year ago I'm perfectly happy with the option to disable it.

rozmansi commented 5 years ago

Each conversation should support a configurable list of languages. That would cover all cases: you go list "en, fr". I'll put "en" only to the list.

And of course, there are many people like @AGlezB that would prefer to have the list of languages set to "" (i.e. no spell checking).

But IMHO, the list of languages should be configurable per-conversation - much like the conversation colour - with a global default.

KwadroNaut commented 5 years ago

@eligt I am multilingual too, but I usually speak to the same person in one language only.

We use and change languages several times a day. Discuss health issues in language A, exchange a recipe in language B and talk about family in language C. Or with work colleagues we'll use 3-4 languages as well, a cake doesn't get polluted because you mix sugar, eggs and flower… Guess language, change language(s), disable spell check, just like in chromium, serves almost everyone (guessing sometimes goes wrong).

benvantende commented 5 years ago

As of now on linux I solved in this way:

quit signal. from root type: mv /opt/Signal/resources/app.asar.unpacked/node_modules/spellchecker /opt/Signal/resources/app.asar.unpacked/node_modules/spellchecker.disabled then restart signal.

Perfect solution with Kubuntu 19.04. Thanks!

Beanow commented 5 years ago

@benvantende Disabling spellcheck is available in the preferences screen: image File -> Preferences; Enable spell check of text entered in message composition box


From the recent discussion, I think it's safe to conclude spellcheck preferences are both personal and situational. Let's not be opinionated about it and allow people to choose from several options we could reasonably implement.

The suggestion of providing per-contact settings may be tricky to implement though, as this would create a new type of privacy concern. Associating a contact with spellcheck languages reveals which languages this contact is likely to speak. Conversely having no explicit language set for a contact can be an indicator of how often you talk to them, or make it less likely they are multi-lingual.

So I think such a per-contact spellcheck preference should be encrypted like any other personal information. As a nice bonus, using existing per-contact settings (like their colour) would allow this to be synced across devices. Still this means work would need to be done on the contact model level, creating new attack vectors, only to support this feature on desktop.

KwadroNaut commented 5 years ago

Maybe the per-contact setting should be a seperate issue, this wasn't part of the original request.

buzo-ffm commented 5 years ago

Indeed, the most important thing would be to be able to set the language (or to disable checking) in the first place! Everything on top of that should definitely be a separate issue.

RalfJung commented 5 years ago

As stated several times above, disabling checking is possible in the preferences these days.

Querulous commented 5 years ago

The suggestion of providing per-contact settings may be tricky to implement though, as this would create a new type of privacy concern. Associating a contact with spellcheck languages reveals which languages this contact is likely to speak. Conversely having no explicit language set for a contact can be an indicator of how often you talk to them, or make it less likely they are multi-lingual.

@Beanow I think it should be stored only locally. Let say there would be one global setting for all conversations and you could override it in any conversation. This would be good balance between privacy and convenience.

arekm commented 4 years ago

In MacOS there is a system setting for spell checking (system preferences -> keyboard -> text). Signal could by default inherit these settings and not even have own settings for that. And you can set preferred (multiple) languages there.

neur0manc commented 3 years ago

Is there any news on this?

hashworks commented 3 years ago

While the application log shows multiple available languages it always chooses en-US for me:

spellcheck: available spellchecker languages:  [\"af\",\"bg\",\"ca\",\"cs\",\"cy\",\"da\",\"de\",\"el\",\"en-AU\",\"en-CA\",\"en-GB\",\"en-US\",\"es\",\"es-419\",\"es-AR\",\"es-ES\",\"es-MX\",\"es-US\",\"et\",\"fa\",\"fo\",\"fr\",\"he\",\"hi\",\"hr\",\"hu\",\"hy\",\"id\",\"it\",\"ko\",\"lt\",\"lv\",\"nb\",\"nl\",\"pl\",\"pt-BR\",\"pt-PT\",\"ro\",\"ru\",\"sh\",\"sk\",\"sl\",\"sq\",\"sr\",\"sv\",\"ta\",\"tg\",\"tr\",\"uk\",\"vi\"]
spellcheck: setting languages to:  [\"en-US\"]

This also happens when I adjust the languages in .config/Signal/Preferences to ["de"], it always overrides that setting with en-US.

louisgag commented 3 years ago

I have the same behavior as pointed out by @hashworks using Ubuntu 20.04. The only way I manage to change the spellcheck language is by running signal using as command such as LC_ALL=de signal-desktop but that still only allows one language per session...

v0lta commented 3 years ago

I am also on 20.04 the ability to choose the dictionary would be really nice!

danielkrysiak commented 3 years ago

Workaround, for ones who have their systems setup in one language (like English), but usually talk to people in a different one. Signal is taking the language setting from LANG environment variable, so you can switch it by starting Signal like this: export LANG=pl_PL.UTF-8 && signal-desktop

KwadroNaut commented 3 years ago

Workaround, for ones who have their systems setup in one language (like English), but usually talk to people in a different one. Signal is taking the language setting from LANG environment variable, so you can switch it by starting Signal like this: export LANG=pl_PL.UTF-8 && signal-desktop

Altough it will work for some, restarting signal with different locales every time you want to write to someone else is not a workable solution to the actual problem.

Toreno96 commented 3 years ago

What's the status of the issue?

I see the Electron's SpellChecker supports multiple spellchecker locales, so it's just a matter of allowing the user to choose from the list of available locales.

Alternatively, Signal could respect the system Hunspell dictionaries. I have both en_US and pl_PL installed:

$ hunspell -D
…
AVAILABLE DICTIONARIES (path is not mandatory for -d option):
/usr/share/hunspell/en_US-large
/usr/share/hunspell/pl_PL
/usr/share/hunspell/en_US
/usr/share/myspell/dicts/en_US-large
/usr/share/myspell/dicts/pl_PL
/usr/share/myspell/dicts/en_US

So I would expect that Signal uses both dictionaries at once by default.

StanislavKoncebovski commented 3 years ago

By looking at the C:\Users\\AppData\Roaming\Signal folder (on Windows), you find a "Dictionaries" subfolder there, which is empty. What is the purpose of that folder? Can one load a dictionary in it? If yes, of what kind? The lack of spell check in languages other than English is a major drawback of Signal, should be fixed ASAP.

DeathOfBalance commented 3 years ago

How is this still not a thing? Seems like the fix can already be found in the comments, but it has to be applied every time one restarts Signal...

kierun commented 3 years ago

While I do understand the frustration that this issue is causing, please refrain demanding a fix from the developers. They are busy people and yelling at them is counter productive.

If you are able to, please open a PR with the fix.

If you are willing, offer your help as a tester. FYI, I am more than happy to test stuff on Linux.

hcsch commented 3 years ago

As far as I can tell there does not seem to be an NPM package that provides multi-language locale detection (e.g. by picking up the array of desired languages from an environment variable like LANGUAGE) and the currently used os-locale only returns the single local that is in or equivalent to what LC_MESSAGES is on Linux. As such, probably the only way for multi-language spellchecking in one session would be to provide a UI to select from the dictionaries present in the DICPATH (or similar for non-Linux OSes).

Ideally this would probably be with checkboxes, rather than radio buttons as it can be desirable to have multiple language dictionaries active at the same time. More specifically, the use case of English + mother tongue is probably rather common (with the many anglicisms that are nowadays common, at least in the languages and for the topics I frequent). It may also be a good idea to consider something like https://github.com/projectfluent/fluent.js/tree/master/fluent-langneg for language negotiation based on what is available and requested, as opposed to simple substring matching, but that is perhaps worthy of another issue, or not all that important at the moment.

A quick fix might be to offer a manual override for the languages set here, in the form of an environment variable: https://github.com/signalapp/Signal-Desktop/blob/dcb5bb672635c4b29a51adec8a5658e3834ec8fc/app/spell_check.ts#L49 Something like SIGNAL_SPELLCHECK="en_US:de_DE" (matching the format for LANGUAGE) perhaps (edit: or a similarly simple config field with an array of locale ID strings, not necessarily exposed through the UI at first). Would such a quick fix be accepted as a PR? (this seems easy enough to implement, whereas a UI change is probably more involved and would require more knowledge of this project's structure) This really would only be a quick fix though, as for proper multi-language support the ability to change the languages used on-the-fly through a context menu on the text input is probably necessary.

tgy commented 3 years ago

@josh-signal @EvanHahn-Signal @scottnonnenberg-signal @indutny-signal

Is any one of you guys willing to work on solving this issue? It seems quite straigthforward: a 3 years-old hanging fruit!

Would you like us to open a PR? Talk to us! Thanks

tgy commented 2 years ago

Why was this closed?

josh-signal commented 2 years ago

@tgy Please start a thread in the feature requests section of our community forums and we can discuss there. For what it's worth we already have an option to disable spellcheck so this would only be for multiple language support which would require design resources.

kierun commented 2 years ago

@tgy Please start a thread in the feature requests section of our community forums and we can discuss there. For what it's worth we already have an option to disable spellcheck so this would only be for multiple language support which would require design resources.

I opened a topic there but it is awaiting moderator approval. I will comment here with the link, when/if it gets approved.

kierun commented 2 years ago

https://community.signalusers.org/t/multiple-languages-for-spell-checker/20205

Not mine (it was marked as a duplicate which is fair)

RobinFrcd commented 2 years ago

For people using Flatpak, this could be a temporary fix: flatpak override --user --env=LANGUAGE=fr_FR.UTF-8 org.signal.Signal

gdurieux commented 2 years ago

https://github.com/signalapp/Signal-Desktop/issues/1659#issuecomment-821100389 Workaround, for ones who have their systems setup in one language (like English), but usually talk to people in a different one. Signal is taking the language setting from LANG environment variable, so you can switch it by starting Signal like this: export LANG=pl_PL.UTF-8 && signal-desktop

It seems setting "LANGUAGE" instead of "LANG" is now required on my system.

cobordism commented 2 years ago

There should be a way too choose between the installed hunspell dictionaries - just like in every other app.

It is very common for people to use apps in English mode but communicate with people using several other languages. Not everyone is as monolinugal as these solutions suggest. We don't want to switch the language of the signal app from one fixed language to another fixed language. We want to be able to switch between them fluently.

Hunspell allows this. Apps that use hunspell allow this too - firefox, thunderbird, libreoffice, ... signal should too.

In fact, I'd label this a bug, not a feature request. Bug: "In a system with multiple installed dictionaries, signal app only recognises one." https://github.com/signalapp/Signal-Desktop/blob/main/app/spell_check.ts#L46= -- it is hard coded to choose the spellchecker language corresponding to the locale.

I've never coded electron or typescript/JS in my life, but I can imagine we'd need to add to spell_check.ts at like line ~150 something that looks like:

template.push({ type: 'separator' }); 
template.push({ label: messages.editMenuChangeLanguage.message });
template.push(
  ...session.availableSpellCheckerLanguages.map(label => ({
    label,
    click: () => {
      session.setSpellCheckerLanguages(label);
    },
  }))
);
peteruithoven commented 2 years ago

@RobinFrcd any change you want to update your comment to use LANGUAGE? Like @gdurieux pointed out.

So for example changing spell check to Dutch works using:

flatpak override --user --env=LANGUAGE=nl_NL.UTF-8 org.signal.Signal

(When installed as flatpak)

cobordism commented 2 years ago

@RobinFrcd any change you want to update your comment to use LANGUAGE? Like @gdurieux pointed out.

So for example changing spell check to Dutch works using:

flatpak override --user --env=LANGUAGE=nl_NL.UTF-8 org.signal.Signal

(When installed as flatpak)

But you would still have to do this every single time you change language, right? So if you are chatting with one person in Dutch and another in English, having a spellchecker in both is not really feasible.

kierun commented 2 years ago

But you would still have to do this every single time you change language, right? So if you are chatting with one person in Dutch and another in English, having a spellchecker in both is not really feasible.

And the problem is even worst if you speak two (or more) languages on the same chat… ¯\_(ツ)_/¯

This is definitely a bug.

peteruithoven commented 2 years ago

But you would still have to do this every single time you change language, right?

Yes, but at least this is a workaround to customize the language.

This is definitely a bug.

A feature not being there isn't a bug... Having a language selector, that allows selecting one of more language is a new feature.

Overall please try to use emoji's instead of spamming everybody that's subscribed with new messages.

kierun commented 2 years ago

Bug… Feature… Whatever. I would be really nice if Signal had the ability to set one or more spell checking language per channel/chat.

pm98zz-c commented 1 year ago

Not a "solution", but for anyone stumbling on this: a possible workaround for multi language support (Linux) is to disable spellcheck in signal and use https://github.com/mike-fabian/ibus-typing-booster as input.

nunesgh commented 1 year ago

This feature request is still unaddressed after more than five years... Not providing this feature has been a huge drawback on Signal for Desktop.

scottnonnenberg-signal commented 1 year ago

Just to clear up an remaining confusion here, current versions of Signal Desktop are set up to handle multiple spell-check locales, as taken from the system. The option to disable spell check overall also exists.

If you are having trouble setting up spell-check as desired on your machine, please file a new bug.

kees-closed commented 1 year ago

Just to clear up an remaining confusion here, current versions of Signal Desktop are set up to handle multiple spell-check locales, as taken from the system. The option to disable spell check overall also exists.

If you are having trouble setting up spell-check as desired on your machine, please file a new bug.

That's not really true. Because Signal decided to only support Debian based distributions, while there are multi platform solutions like Flatpak. I have multiple locales installed on my Fedora workstation, but the Signal app doesn't find them. Only when using e.g. flatpak override --user --env=LANGUAGE=nl_NL.UTF-8 org.signal.Signal. But then I don't have English spell check anymore...

If Signal would release a mature and officially supported Flatpak version with all intended functionality, then this issue and some others can be closed.

Multi language really doesn't work! There is just one language, that's the one from your system. I've also configured Flatpak to include multiple languages, but the Signal app only shows English, which is the default language of my OS.

$ flatpak config
languages: *unset* (default: en;nl)
extra-languages: nl_NL.UTF-8

But the above shouldn't even be needed. Element for example can perfectly fine handle multiple languages (also through Flatpak).

louisgag commented 1 year ago

I agree. And that "one language per instance" behavior is also the case for Ubuntu (and I assume Debian) signal.

kierun commented 1 year ago

@scottnonnenberg

Just to clear up an remaining confusion here, current versions of Signal Desktop are set up to handle multiple spell-check locales, as taken from the system.

Where is the documentation for this?

screenshot

This is the only option I can see on Signal Desktop (6.7.0, the Fedora installed one).

nunesgh commented 1 year ago

Just to clear up an remaining confusion here, current versions of Signal Desktop are set up to handle multiple spell-check locales, as taken from the system. The option to disable spell check overall also exists.

@scottnonnenberg-signal, thank you for your reply!

Why was the choice made to take the locales from the system, instead of allowing users to manually select them directly on Signal?

For instance, my system's language and locale are both set to English only, but that is not the only language I use on a daily basis, including on Signal. So in the end I had to completely disable the Signal Desktop spell-check to remove all the annoying red squiggles for any input in a language other than English. This is not a good user experience.

scottnonnenberg-signal commented 1 year ago

@nunesgh The thought was that you could choose that secondary language at the OS level, and Desktop would pick it up and have spellcheck that worked for both languages.