mirror of
https://github.com/Mikaela/Limnoria.git
synced 2024-11-27 05:09:23 +01:00
Unix: Add configuration variable spell.language
This commit is contained in:
parent
3ec2b166a6
commit
1c01dc2a3c
@ -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',
|
||||
|
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user