Unix: Add configuration variable spell.language

This commit is contained in:
nyuszika7h 2011-12-22 22:21:20 +01:00
parent 3ec2b166a6
commit 1c01dc2a3c
2 changed files with 5 additions and 1 deletions

View File

@ -81,6 +81,9 @@ conf.registerGlobalValue(Unix.spell, 'command',
registry.String(utils.findBinaryInPath('aspell') or
utils.findBinaryInPath('ispell') or '', _("""Determines
what command will be called for the spell command.""")))
conf.registerGlobalValue(Unix.spell, 'language',
registry.String('en', _("""Determines what aspell dictionary will be used
for spell checking.""")))
conf.registerGroup(Unix, 'wtf')
conf.registerGlobalValue(Unix.wtf, 'command',

View File

@ -143,11 +143,12 @@ class Unix(callbacks.Plugin):
'is installed, reconfigure '
'supybot.plugins.Unix.spell.command appropriately.'),
Raise=True)
spellLang = self.registryValue('spell.language') or 'en'
if word and not word[0].isalpha():
irc.error(_('<word> must begin with an alphabet character.'))
return
try:
inst = subprocess.Popen([spellCmd, '-a'], close_fds=True,
inst = subprocess.Popen([spellCmd, '-l', spellLang, '-a'], close_fds=True,
stdout=subprocess.PIPE,
stderr=subprocess.PIPE,
stdin=subprocess.PIPE)