psi-im / psi

XMPP client
https://psi-im.org/
Other
402 stars 123 forks source link

Impossible to choose spell check language #114

Closed fpiecka closed 6 years ago

fpiecka commented 10 years ago

Psi uses the default language from aspell configuration. However people often use a different language for different programs and sometimes it is impractical to set the default systemwide.

It would be beneficial to add support for spell check language selection to options.

A possibility to change language via right click in the messaging window would be even better...

wadealer commented 10 years ago

Try set language with environment variable LANG

GreenLunar commented 9 years ago

I use Psi 0.15 on Salix 14.1. Psi properly indicates on spelling mistakes in English but does not in Hebrew; in Hebrew, Psi always indicates that word is misspelled.

Try set language with environment variable LANG

Executing $ LANG=he_IL.utf8 psi makes Psi to use Hebrew spell checker successfully, but Psi fails to use English spell checker.

Related: #43

See http://endl.ch/content/psi-spell-checking-multiple-languages https://bugzilla.redhat.com/show_bug.cgi?id=854324

GreenLunar commented 9 years ago
Psi spell-checking for multiple languages
Submitted by NDL on 12 October, 2007 - 13:27

Simple patch for Psi 0.11-0.13 which adds support for multiple languages in its spell-checking engine.

Basically, the patch allows you to select one or several different languages - and, correspondingly, enable appropriate dictionaries for spell-checking.

When checking the word, the aspell engine will enumerate all enabled dictionaries and will consider the word to be OK if it is matched by at least one dictionary.

Of course, theoretically this approach is completely wrong, as it may easily accept the words you did not want to be accepted by accidentally matching them in the dictionary of the language you aren’t actually typing this word in. The cleaner solution would be to try guessing your current input language - for example, by getting info about keyboard layout, or whatever.

However, as one may notice, even Microsoft with their Office suite wasn’t able to solve this task in the “right” way to make this detection 100% reliable, and I have no reasons to believe I can do it better.

Therefore, I stick to this “wrong, but simple” approach - and it seems that for most practical cases it works OK, especially if languages you use seriously differ - for example, have different alphabet.

The other issue could be that this approach is not really CPU-efficient, but in practice you’re unlikely to enable more than several languages simultaneously - therefore, I had no speed problems so far, and I doubt it becomes an issue for all but extreme usage scenarios.

ndl commented 9 years ago

Hi,

I've switched to Vacuum (http://www.vacuum-im.org/) quite some time ago and, therefore, do not follow Psi development anymore - hence don't have corresponding patches for any of the recent versions of Psi. Sorry about that :-(

IIRC there was not that much code involved, though, so porting / re-implementing them shouldn't be very difficult.

On 2015-09-16 13:41, GreenLunar wrote:

@ndl [1] PING!

Please join to this thread.

Reply to this email directly or view it on GitHub [2].

Good luck! Alexander

Links:

[1] https://github.com/ndl [2] https://github.com/psi-im/psi/issues/114#issuecomment-140715462

GreenLunar commented 9 years ago

Does Vacuum have a spell checker as described?

wadealer commented 9 years ago

GreenLunar, we already have this patches at psi-plus. One day psi will has it to :)

The-Judge commented 7 years ago

Sorry for writing to such an old thread again; I'm using psi-plus (v0.16.330) and I cannot choose from several / multiple languages. I can only (de-)activate spell checking. Have these patches become removed again?

tehnick commented 7 years ago

@The-Judge It is recommended to use the latest available release of Psi+: 1.2.100. See https://github.com/psi-plus/main/issues/695 for details.

tehnick commented 7 years ago

@Ri0n Is it time to move these patches to Psi? They are well tested.

tehnick commented 7 years ago

@The-Judge As for old Psi and Psi+ versions you may try to choose languages in advanced settings:

Settings dialog --> Advanced --> options --> ui --> spell-check --> langs (use short language names and comma as a separator, for example "ru,en")

As far as I remember if you build Psi/Psi+ with aspell you may choose only two dictionaries simultaneously. With hunspell you may use more than 2 languages, but there were a bug (see link above).

Ri0n commented 7 years ago

@tehnick, sure. we should apply them

The-Judge commented 7 years ago

Cool, thanks for the input! It works for me now with the latest version!

tehnick commented 6 years ago

bfbee1138e8ff551537f465addacd469d3101279 b4b2f07d27d108cb93287c6148565d83d6505df8

https://github.com/psi-im/libpsi/commit/699f59988a24d128eda01bac6afbace1d2ab7486