mirror of
https://github.com/Mikaela/Limnoria.git
synced 2025-02-18 14:40:51 +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
|
registry.String(utils.findBinaryInPath('aspell') or
|
||||||
utils.findBinaryInPath('ispell') or '', _("""Determines
|
utils.findBinaryInPath('ispell') or '', _("""Determines
|
||||||
what command will be called for the spell command.""")))
|
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.registerGroup(Unix, 'wtf')
|
||||||
conf.registerGlobalValue(Unix.wtf, 'command',
|
conf.registerGlobalValue(Unix.wtf, 'command',
|
||||||
|
@ -143,11 +143,12 @@ class Unix(callbacks.Plugin):
|
|||||||
'is installed, reconfigure '
|
'is installed, reconfigure '
|
||||||
'supybot.plugins.Unix.spell.command appropriately.'),
|
'supybot.plugins.Unix.spell.command appropriately.'),
|
||||||
Raise=True)
|
Raise=True)
|
||||||
|
spellLang = self.registryValue('spell.language') or 'en'
|
||||||
if word and not word[0].isalpha():
|
if word and not word[0].isalpha():
|
||||||
irc.error(_('<word> must begin with an alphabet character.'))
|
irc.error(_('<word> must begin with an alphabet character.'))
|
||||||
return
|
return
|
||||||
try:
|
try:
|
||||||
inst = subprocess.Popen([spellCmd, '-a'], close_fds=True,
|
inst = subprocess.Popen([spellCmd, '-l', spellLang, '-a'], close_fds=True,
|
||||||
stdout=subprocess.PIPE,
|
stdout=subprocess.PIPE,
|
||||||
stderr=subprocess.PIPE,
|
stderr=subprocess.PIPE,
|
||||||
stdin=subprocess.PIPE)
|
stdin=subprocess.PIPE)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user