Closed Beanow closed 4 months ago
@scottnonnenberg-signal, would it be possible to implement on Signal Desktop something like the spell-check selection available on Chromium (screenshot), on Electron, and even on Firefox?
@nunesgh Are you saying that you've added languages to Chromium that your operating system doesn't know about? Can you talk more about why you've done things that way?
Small note. On Linux there is no such thing as "OS knows about languages". You simply have spell check application installed for which you can install tens of dictionaries for different languages for it on single system. Other apps can use it.
For example mentioned Electron uses hunspell engine and dictionaries (on Linux and on Windows). On my example system I can have that much different hunspell dictionaries/languages. On single system.
$ apt-cache search hunspell | grep dictionary | wc -l
85
@nunesgh Are you saying that you've added languages to Chromium that your operating system doesn't know about? Can you talk more about why you've done things that way?
@scottnonnenberg-signal, I have never enjoyed how user interfaces behave when using languages other than English, the language oftentimes they are built for. Usually what happens is a direct translation of words and sentences without considering the actual characters count available on the interface. As a result, users get an interface full of incomplete sentences cutoff with "..." in the end, particularly on menus. To get rid of translated interfaces was one of the main reasons why I learned English as a teenager.
So once I was able to have my whole system on English only, I just stopped installing language packs at all, even sometimes at the expense of spell checking. That is why I think the currently available spell-check selection on Chromium and Firefox is a really nice user experience, and it is also being adopted on other Electron-based software, e.g. Joplin.
Moreover, as @arekm mentioned, I could not find a way of making Signal Desktop acknowledge the existence of other language packs on my Linux Mint system even after installing the Portuguese one, and there is no way of selecting more than one Language, Region, or Time format at the same time.
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.
This is disingenuous.
When typing text in for example Firefox, Chrome, Chromium, Brave, Vivaldi, Thunderbird, and Libre Office, I can change the spellchecker language with a simple right click. In Libre Office I can change it even on a per paragraph basis.
Nothing like this works in Signal desktop. So whatever it is you are referring to, it sure doesn't show up by the time a user interacts with the app.
@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.
The problem is that most software systems - Ubuntu and Signal included - are written with a very monolingual mindset. The multi-language support boils down to the ability to add a second language -- and if I do this, it will install translated versions of everything and then I will be able to choose that other one single language the next time I log in.
I have many hunspell dictionaries installed. I even customised some by hand (yes really). And while it can happen that I write a message to someone in Hungarian on Signal Desktop and could very much use the help of a spellchecker, I do not want to have to log out of my session, log back in with every app and every menu being Hungarian, re-open Signal, write my message, log back out, switch back to English, log back in....
So even if the OS exists in many languages, that does not mean it is multilingual, and relying on the system language for spellchecking does not mean you support multilingual use. It means you support one single language at a time which does not necessarily have to be English.
Therefore me and many others in this thread ask, beseech, and implore you to please allow Signal Desktop to tie in to a system like hunspell in the same way as everyone else has done from Firefox to Chrome, from Element to Telegram, from Libre Office to Thunderbird to .. well all except Discord really. This is not about "ungrateful users reporting as bugs what really should be a feature request". This is people genuinely reporting a pain point in this app that is clearly common and widespread and for which there is ample precedent in other apps.
please file a new bug.
Do you really want me to do this?
What @scottnonnenberg is referring to is a recent change I made to pick up multiple locales that are configured but only ones configured at the OS level, and we now use that to "resolve" a locale for our translations. We've discussed adding user preference in the app to allow users to configure multiple locales, but there is something else we can and would need to do in the meantime.
The framework we use does allow you to configure multiple spellchecker locales, but it looks like we only use the "resolved locale" for our translations (aka the language we pick to render the UI in based on the OS selection). We could pass in multiple preferred languages there.
I will make that change and test it out before the next release.
@jamiebuilds-signal, thank you for your reply!
How would the preferred languages be selected? From the list of OS language packs installed on the system or from user's input, e.g. as in Chromium?
@nunesgh If you mean in a separate app instance of Chromium, no we would not load locales from there, we only ever pull from the operating system itself using common OS APIs. In the future we may have something in our Preferences
menu, but not at the moment.
Instructions for some common operating systems:
On various Linux distros the steps can get much more involved, and I'm not going to be able to test them all out myself, but in general we're just using what we get from g_get_language_names
on Linux as that's what our app framework uses. Which itself pulls from the LANGUAGE
environment variable
For example:
LANGUAGE=de:en_US
# Returns: "de", "en_US", "en", "C"
# Don't ask me why the default locale is "C", I have no clue
# The full list of env variables it will attempt to lookup from:
# LANGUAGE, LC_ALL, LC_MESSAGES and LANG
Another note: On macOS we use native spellchecking APIs which we cannot configure at all, but it seems to work fairly well with these instructions support.apple.com/guide/mac-help/mh26684/mac
As someone who is just reading this thread (and I'm most definitely not the only one), just wanted to thank @jamiebuilds-signal and @scottnonnenberg-signal for their work, and other contributors who fuel this thread with valuable info. :) Cheers
When I try to configure multiple languages with KDE, I get a big warning:
"Putting American English above other languages will cause undesired behavior in some applications. If you would like your system to use American English, remove all other languages."
I don't know what this warning is about, but it surely doesn't make me confident that this approach to multi-lang configuration will work as intended.
EDIT: https://bugs.kde.org/show_bug.cgi?id=465449 has some background. Looks like setting the language to en_US:de_DE
doesn't work properly since many apps don't have en_US
-- they use that as the default language, which is the C
locale.
FYI -- Multi-language Spellchecking was released in 6.14.0
Hi @jamiebuilds-signal! Thank you for your work!
FYI -- Multi-language Spellchecking was released in 6.14.0
I have installed the new version and the feature still does not work on my Linux Mint system.
Unfortunately, I think this approach for setting spellchecking on Linux is unreliable.
@nunesgh Would you mind sharing a debuglog?
@nunesgh Interesting, it seems we're getting only en
in your locales.
INFO 2023-04-12T22:24:56.284Z app.ready: preferred system locales: en-US, en
INFO 2023-04-12T22:24:56.291Z Loading preferred system locale: 'en-US'
WARN 2023-04-12T22:24:56.291Z Problem loading messages for locale 'en-US', Error: ENOENT, _locales/en-US/messages.json not found in [REDACTED]
WARN 2023-04-12T22:24:56.291Z Falling back to parent language: 'en'
...
INFO 2023-04-12T22:24:56.351Z spellcheck: user locales: ["en-US","en"]
INFO 2023-04-12T22:24:56.352Z spellcheck: available spellchecker languages: ["af","bg","ca","cs","cy","da","de","de-DE","el","en","en-AU","en-CA","en-GB","en-GB-oxendict","en-US","es","es-419","es-AR","es-ES","es-MX","es-US","et","fa","fo","fr","fr-FR","he","hi","hr","hu","hy","id","it","it-IT","ko","lt","lv","nb","nl","pl","pt","pt-BR","pt-PT","ro","ru","sh","sk","sl","sq","sr","sv","ta","tg","tr","uk","vi"]
INFO 2023-04-12T22:24:56.352Z spellcheck: setting languages to: ["en-US","en"]
If you just run locale
what is the output of that?
@RalfJung We actually don't support an en-US
specific locale either, we just fallback to en
if you set that. So you could specify it on your system with just en
@jamiebuilds-signal, here is the output for locale
:
When I run signal-desktop on Ubuntu 22.04 with the Dutch locale using LOCALE=nl signal-desktop
at the commandline
The spell checker is set
{"level":30,"time":"2023-04-29T13:00:09.749Z","msg":"spellcheck: user locales: [\"nl\"]"}
{"level":30,"time":"2023-04-29T13:00:09.750Z","msg":"spellcheck: available spellchecker languages: [\"af\",\"bg\",\"ca\",\"cs\",\"cy\",\"da\",\"de\",\"de-DE\",\"el\",\"en\",\"en-AU\",\"en-CA\",\"en-GB\",\"en-GB-oxendict\",\"en-US\",\"es\",\"es-419\",\"es-AR\",\"es-ES\",\"es-MX\",\"es-US\",\"et\",\"fa\",\"fo\",\"fr\",\"fr-FR\",\"he\",\"hi\",\"hr\",\"hu\",\"hy\",\"id\",\"it\",\"it-IT\",\"ko\",\"lt\",\"lv\",\"nb\",\"nl\",\"pl\",\"pt\",\"pt-BR\",\"pt-PT\",\"ro\",\"ru\",\"sh\",\"sk\",\"sl\",\"sq\",\"sr\",\"sv\",\"ta\",\"tg\",\"tr\",\"uk\",\"vi\"]"}
{"level":30,"time":"2023-04-29T13:00:09.750Z","msg":"spellcheck: setting languages to: [\"nl\"]"}
And the app runs with Dutch localization (windows etc. are all fine) but no spelling suggestions appear.
Using LOCALE=en signal-desktop
works correctly
~$ localectl list-locales
C.UTF-8
en_AG.UTF-8
en_AU.UTF-8
en_BW.UTF-8
en_CA.UTF-8
en_DK.UTF-8
en_GB.UTF-8
en_HK.UTF-8
en_IE.UTF-8
en_IL.UTF-8
en_IN.UTF-8
en_NG.UTF-8
en_NZ.UTF-8
en_PH.UTF-8
en_SG.UTF-8
en_US.UTF-8
en_ZA.UTF-8
en_ZM.UTF-8
en_ZW.UTF-8
nl_AW.UTF-8
nl_BE.UTF-8
nl_NL.UTF-8
~$ locale
LANG=en_US.UTF-8
LANGUAGE=en_US:en
LC_CTYPE="en_US.UTF-8"
LC_NUMERIC=nl_NL.UTF-8
LC_TIME=nl_NL.UTF-8
LC_COLLATE="en_US.UTF-8"
LC_MONETARY=nl_NL.UTF-8
LC_MESSAGES="en_US.UTF-8"
LC_PAPER=nl_NL.UTF-8
LC_NAME=nl_NL.UTF-8
LC_ADDRESS=nl_NL.UTF-8
LC_TELEPHONE=nl_NL.UTF-8
LC_MEASUREMENT=nl_NL.UTF-8
LC_IDENTIFICATION=nl_NL.UTF-8
LC_ALL=
tying spellchecking exclusively to the installed locales - as opposed to freely using any and all installed dictionaries - is a mistake. As long as that decision isn't reversed, I doubt this issue will ever really be resolved.
tying spellchecking exclusively to the installed locales - as opposed to freely using any and all installed dictionaries - is a mistake. As long as that decision isn't reversed, I doubt this issue will ever really be resolved.
This issue is marked as closed.
Yet, we still do not have decent multi-language spell checking.
I tried signal-desktop-6.16.0-1.1.x86_64
(Fedora) with LOCALE=en-GB /usr/bin/signal-desktop --use-tray-icon
and I do not have any spell checking enabled. Not one.
The flatpak version at least has one language spellchecking – I am unable to set which one, it just picked one at random. However, it does not obey .XCompose
key bindings.
I :100: get volunteer projects and the pressure the developers are under. That said, this has been an issue for 6 years, which explains the frustration we users have…
@cobordism The output from the above debuglog does show that it's pulling from installed dictionaries (it includes locales like tg
and en-GB
which are not locales we support in our translations).
...
{..."msg":"spellcheck: available spellchecker languages: [\"af\",\"bg\",\"ca\",\"cs\",\"cy\",\"da\",\"de\",\"de-DE\",\"el\",\"en\",\"en-AU\",\"en-CA\",\"en-GB\",\"en-GB-oxendict\",\"en-US\",\"es\",\"es-419\",\"es-AR\",\"es-ES\",\"es-MX\",\"es-US\",\"et\",\"fa\",\"fo\",\"fr\",\"fr-FR\",\"he\",\"hi\",\"hr\",\"hu\",\"hy\",\"id\",\"it\",\"it-IT\",\"ko\",\"lt\",\"lv\",\"nb\",\"nl\",\"pl\",\"pt\",\"pt-BR\",\"pt-PT\",\"ro\",\"ru\",\"sh\",\"sk\",\"sl\",\"sq\",\"sr\",\"sv\",\"ta\",\"tg\",\"tr\",\"uk\",\"vi\"]"}
...
I'm not sure why certain Linux distros are not showing spellchecking even when dictionaries are installed. If someone can post a full debuglog I can check for a couple different possible problems. https://support.signal.org/hc/en-us/articles/360007318591-Debug-Logs-and-Crash-Reports#desktop_debug
@jamiebuilds-signal Here it is. Signal's version is signal-desktop-6.16.0-1.1.x86_64
via Fedora. Kindly let me know if you need further information.
I feel that there are many things here:
LOCAL
as a setting for spell checker: Is this a bug, or wrong choice?Maybe we should break this into different issues? ¯\_(ツ)_/¯
$ lsb_release -a
No LSB modules are available. Distributor ID: Ubuntu Description: Ubuntu 20.04.5 LTS Release: 20.04 Codename: focal
$ locale | grep ^LANG=
LANG=en_AU.UTF-8
$ cat ~/.config/Signal/Preferences
{"browser":{"enable_spellchecking":true},"electron":{"media":{"device_id_salt":"XXXXXXXXXXXXXXXXXXX"}},"spellcheck":{"dictionaries":["en-AU","en"],"dictionary":""}}
Changing en-AU to en_AU in the above 'Preferences' file for v6.17.1 prod seems to have fixed the spell check issue for me.
"spellcheck":{"dictionaries":["en-AU","en"]
Now, if this could allow multiple dictionary entries, that would be fantastic.
Hi! Any update on this? Version 6.39.0 has brought the option of changing the whole app's language, but still nothing related to multi-languages spell check.
+1
Hi! Any update on this?
It is so disappointing that this issue is still ongoing after so many years.
For most users, multiple spellchecker locales is working today and has an option to disable it.
For anyone it's not currently working, what you can do to help is provide as much detail as possible about your operating system, language and keyboard settings, and for linux users how you install Signal, your locale environment variables, and anything unique about your setup that could affect the loading of dictionaries
And as always, please share a debuglog or there's little to no investigation that can be done.
I'm going to close this issue as this point, it should just be OS-specific bug reports.
For most users, multiple spellchecker locales is working today and has an option to disable it.
Maybe I missed it in the comments above, but can you explain how to use multi-language spellchecking in Signal? In the settings, I only see an option for the UI language, which is something different, and only allows a single language. There is no setting for spellchecking languages, as far as I can find.
If you have multiple preferred languages configured in your OS settings, we will attempt to load dictionaries for any that we support.
This configuration is OS-specific:
Settings > Time & language > Language & region > Preferred Languages > Add a language
System Settings > General > Language & Region > Preferred Languages > +
In the logs we're able to see what we loaded from your operating system, what the available spellchecker languages in your version of signal are, and what we resolved them to:
spellcheck: user locales: ["en-US","es-US"]
spellcheck: available spellchecker languages: ["af","bg","ca","cs","cy","da","de","de-DE","el","en","en-AU","en-CA","en-GB","en-GB-oxendict","en-US","es","es-419","es-AR","es-ES","es-MX","es-US","et","fa","fo","fr","fr-FR","he","hi","hr","hu","hy","id","it","it-IT","ko","lt","lv","nb","nl","pl","pt","pt-BR","pt-PT","ro","ru","sh","sk","sl","sq","sr","sv","ta","tg","tr","uk","vi"]
spellcheck: setting languages to: ["en-US","es-US"]
https://github.com/signalapp/Signal-Desktop/issues/1659#issuecomment-1490893656 said it all.
The code-path is relying on app.getPreferredSystemLanguages() which, on Linux depends on GLib's g_get_language_names which relies on LANGUAGE=xx:yy:zz
.
and it works. Eg LANGUAGE=fr:es signal-desktop
will enable two languages, assuming these locales are installed on the system.
but there is this --lang
argument:
which is casted to string:
So signal-desktop --lang=fr,es,de
won't work because (neither using :
)
$ node -e "console.log(Intl.getCanonicalLocales('en-US,fr'));"
leads to catching (and ignoring) the
RangeError: Incorrect locale information provided
For a Linux user, I'm not sure this situation is good enough:
LANGUAGE
environment variableSorry, but changing the app language is not a solution. It doesn't help if someone is talking to multiple people using different languages. At least we should be able to change the spellcheck with right-click context menu, like I'm doing right in my browser for the purpose of this message. Ideally, Signal should remember the chosen spellcheck per contact and group.
@daniel-krysiak
Sorry, but changing the app language is not a solution. It doesn't help if someone is talking to multiple people using different languages. At least we should be able to change the spellcheck with right-click context menu, like I'm doing right in my browser for the purpose of this message. Ideally, Signal should remember the chosen spellcheck per contact and group.
This is what some of us have been arguing from the start.
My personal use case is that in some channels I speak English; in others, I speak French; and in some I mix both. Currently, I can only have one spell checker. Even that is limited, as I cannot add/remove words to any dictionary. Even having both languages spell checkers enable at the same time would be good even if it could lead to confusion. However, I cannot even do that using flatpak…
This is the solution:
sudo flatpak override --env=LANGUAGE=en-GB:fr-FR org.signal.Signal
This will enable both English and French spell checking at once.
If you have multiple preferred languages configured in your OS settings, we will attempt to load dictionaries for any that we support.
This configuration is OS-specific:
* **Windows**: `Settings > Time & language > Language & region > Preferred Languages > Add a language` * **macOS**: `System Settings > General > Language & Region > Preferred Languages > +` * **Linux**: For your specific operating system, you'll need to lookup how to setup multiple languages. Sometimes there is a system setting (sometimes labelled "input sources"), other times there are scripts you can run, or environment variables you need to modify.
In the logs we're able to see what we loaded from your operating system, what the available spellchecker languages in your version of signal are, and what we resolved them to:
spellcheck: user locales: ["en-US","es-US"] spellcheck: available spellchecker languages: ["af","bg","ca","cs","cy","da","de","de-DE","el","en","en-AU","en-CA","en-GB","en-GB-oxendict","en-US","es","es-419","es-AR","es-ES","es-MX","es-US","et","fa","fo","fr","fr-FR","he","hi","hr","hu","hy","id","it","it-IT","ko","lt","lv","nb","nl","pl","pt","pt-BR","pt-PT","ro","ru","sh","sk","sl","sq","sr","sv","ta","tg","tr","uk","vi"] spellcheck: setting languages to: ["en-US","es-US"]
Thanks for the elaborate response!
KDE Plasma warns me when I'm trying to set multiple languages system-wide:
I agree that this is probably not a good solution, since the LANGUAGE
environment variable also influences the preferred language for UI translations (using GNU gettext). Apparently the problem is that many software does not have an 'explicit' English translation, rather, it's the default, so setting for example LANG="en-US:nl-NL"
causes software to get translated to Dutch (which I don't want) because it can't find the en-US
translation.
For now, I've just modified Signal's .desktop
file to set LANGUAGE="en-US:nl-NL"
for Signal specifically.
I would still prefer an setting in Signal for this, instead of Signal inferring it from the LANGUAGE
environment variable, but this works.
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:
The ability to disable spell checking.Disabling spellchecker is available: https://github.com/signalapp/Signal-Desktop/issues/1659#issuecomment-521625674Screenshots
Example of this feature in Chromium
Platform info
Operating System: Ubuntu 17.04 Browser: Electron app Signal version: 1.0.34