remove our own list of available spelling language. gtkspell already adds one. Fixes #7408

This commit is contained in:
Yann Leboulanger 2013-08-13 18:27:17 +02:00
parent 89d0ec58f4
commit b46a56953d
1 changed files with 0 additions and 43 deletions

View File

@ -83,36 +83,6 @@ if dbus_support.supported:
import dbus import dbus
import remote_control import remote_control
# the next script, executed in the "po" directory,
# generates the following list.
##!/bin/sh
#LANG=$(for i in *.po; do j=${i/.po/}; echo -n "_('"$j"')":" '"$j"', " ; done)
#echo "{_('en'):'en'",$LANG"}"
langs = {_('English'): 'en', _('Belarusian'): 'be', _('Bulgarian'): 'bg',
_('Breton'): 'br', _('Czech'): 'cs', _('German'): 'de',
_('Greek'): 'el', _('British'): 'en_GB', _('Esperanto'): 'eo',
_('Spanish'): 'es', _('Basque'): 'eu', _('French'): 'fr',
_('Croatian'): 'hr', _('Italian'): 'it', _('Norwegian (b)'): 'nb',
_('Dutch'): 'nl', _('Norwegian'): 'no', _('Polish'): 'pl',
_('Portuguese'): 'pt', _('Brazilian Portuguese'): 'pt_BR',
_('Russian'): 'ru', _('Serbian'): 'sr', _('Slovak'): 'sk',
_('Swedish'): 'sv', _('Chinese (Ch)'): 'zh_CN', _('Hebrew'): 'he'}
if gajim.config.get('use_speller') and HAS_GTK_SPELL:
# loop removing non-existent dictionaries
# iterating on a copy
tv = Gtk.TextView()
spell = gtkspell.Spell(tv)
for lang in dict(langs):
try:
spell.set_language(langs[lang])
except OSError:
del langs[lang]
if spell:
spell.detach()
del tv
################################################################################ ################################################################################
class ChatControlBase(MessageControl, ChatCommandProcessor, CommandTools): class ChatControlBase(MessageControl, ChatCommandProcessor, CommandTools):
""" """
@ -593,19 +563,6 @@ class ChatControlBase(MessageControl, ChatCommandProcessor, CommandTools):
id_ = item.connect('activate', self.msg_textview.clear) id_ = item.connect('activate', self.msg_textview.clear)
self.handlers[id_] = item self.handlers[id_] = item
if gajim.config.get('use_speller') and HAS_GTK_SPELL:
item = Gtk.MenuItem(_('Spelling language'))
menu.prepend(item)
submenu = Gtk.Menu()
item.set_submenu(submenu)
for lang in sorted(langs):
item = Gtk.CheckMenuItem(lang)
if langs[lang] == self.msg_textview.lang:
item.set_active(True)
submenu.append(item)
id_ = item.connect('activate', _on_select_dictionary, langs[lang])
self.handlers[id_] = item
menu.show_all() menu.show_all()
def on_quote(self, widget, text): def on_quote(self, widget, text):