diff --git a/src/chat_control.py b/src/chat_control.py index 0d5963dec..313377318 100644 --- a/src/chat_control.py +++ b/src/chat_control.py @@ -157,7 +157,10 @@ class ChatControlBase(MessageControl): # Attach speller if gajim.config.get('use_speller') and HAS_GTK_SPELL: try: - gtkspell.Spell(self.msg_textview) + spell = gtkspell.Spell(self.msg_textview) + lang = gajim.config.get('speller_language') + if lang: + spell.set_language(lang) except gobject.GError, msg: #FIXME: add a ui for this use spell.set_language() dialogs.ErrorDialog(unicode(msg), _('If that is not your language ' diff --git a/src/common/config.py b/src/common/config.py index b58cc2bd9..1e3e96a50 100644 --- a/src/common/config.py +++ b/src/common/config.py @@ -80,6 +80,7 @@ class Config: 'mergeaccounts': [ opt_bool, False, '', True ], 'sort_by_show': [ opt_bool, True, '', True ], 'use_speller': [ opt_bool, False, ], + 'speller_language': [ opt_str, '', _('Language used by speller')], 'print_time': [ opt_str, 'always', _('\'always\' - print time for every message.\n\'sometimes\' - print time every print_ichat_every_foo_minutes minute.\n\'never\' - never print time.')], 'print_time_fuzzy': [ opt_int, 0, _('Value of fuzziness from 1 to 4 or 0 to disable fuzzyclock. 1 is the most precise clock, 4 the less precise one.') ], 'emoticons_theme': [opt_str, 'static', '', True ], diff --git a/src/dialogs.py b/src/dialogs.py index 3cad55e7e..64edef198 100644 --- a/src/dialogs.py +++ b/src/dialogs.py @@ -1298,10 +1298,13 @@ class SingleMessageWindow: if gajim.config.get('use_speller') and HAS_GTK_SPELL and action == 'send': try: - gtkspell.Spell(self.conversation_textview.tv) - gtkspell.Spell(self.message_textview) + spell1 = gtkspell.Spell(self.conversation_textview.tv) + spell2 = gtkspell.Spell(self.message_textview) + lang = gajim.config.get('speller_language') + if lang: + spell1.set_language(lang) + spell2.set_language(lang) except gobject.GError, msg: - #FIXME: add a ui for this use spell.set_language() ErrorDialog(unicode(msg), _('If that is not your language for which you want to highlight misspelled words, then please set your $LANG as appropriate. Eg. for French do export LANG=fr_FR or export LANG=fr_FR.UTF-8 in ~/.bash_profile or to make it global in /etc/profile.\n\nHighlighting misspelled words feature will not be used')) gajim.config.set('use_speller', False)