diff --git a/plugins/Unix/config.py b/plugins/Unix/config.py index 0da4ec10b..2b618327c 100644 --- a/plugins/Unix/config.py +++ b/plugins/Unix/config.py @@ -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', diff --git a/plugins/Unix/plugin.py b/plugins/Unix/plugin.py index 0f5a8c07c..9a18c4050 100644 --- a/plugins/Unix/plugin.py +++ b/plugins/Unix/plugin.py @@ -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(_(' 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)