First, the path to the dictionary dirs is already available to the plugins see dictionary_dirs so no reason to hard code them. All available spellcheck languages can be gathered from those dirs.
Code:
class BookContainer(object):
def __init__(self, wrapper, debug=False):
self._debug = debug
self._w = wrapper
self.qp = QuickXHTMLParser()
self.hspell = HunspellChecker(wrapper.get_hunspell_path())
self.dictionary_dirs = wrapper.get_dictionary_dirs()
self._prefs_store = JSONPrefs(wrapper.plugin_dir, wrapper.plugin_name)
Second, wouldn't it be better to pick the dictionaries to be used directly based on the lang or xml:lang of the xhtml actually being processed and not based on Sigil current settings?
Extracting the primary language from the html tag should be trivial.
If that does not work for you let me know and we can extend the set of information passed to the plugin even further but it is already pretty long now.
Please give that a try first.