View Single Post
Old 07-18-2026, 07:43 AM   #618
KevinH
Sigil Developer
KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.
 
Posts: 9,822
Karma: 7500000
Join Date: Nov 2009
Device: many
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.

Last edited by KevinH; 07-18-2026 at 07:49 AM.
KevinH is online now   Reply With Quote