Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Sigil > Plugins

Notices

Reply
 
Thread Tools Search this Thread
Old 04-20-2026, 08:28 AM   #616
DiapDealer
Grand Sorcerer
DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.
 
DiapDealer's Avatar
 
Posts: 29,614
Karma: 212299010
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
Quote:
Originally Posted by Jaco View Post
I think this plugin could be useful.

My collection of clips is so large that if something goes wrong and I lose them, I'm in trouble. This plugin backs up and restores clips. I've put it here because I'm not sure where else to upload it. It's available in Spanish and English, and you're free to improve anything that's wrong. I've never programmed before.

Enjoy it!
Correct me if I'm wrong, but haven't we already determined that the export (and loading) of clips is already a part of Sigil's built-in feature set? We mentioned that when you asked about this in the new feature requests thread, I believe.
DiapDealer is offline   Reply With Quote
Old 07-18-2026, 06:24 AM   #617
Doitsu
Grand Sorcerer
Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.
 
Doitsu's Avatar
 
Posts: 5,857
Karma: 24222221
Join Date: Dec 2010
Device: Kindle PW2
It would be helpful if someone added new functions to bk.hspell that allow the user to load the primary and secondary spellcheck dictionaries.

So far, the only method to get these paths is to parse sigil_v6.ini.

For example, you could add loadPrimaryDictionary and loadSecondaryDictionary methods to bk.hspell.

If en-US is the primary spellcheck dictinary.:

Code:
bk.hspell.loadPrimaryDictionary()
would be the equivalent of:
Code:
aff_file = r"C:\Program Files\Sigil\hunspell_dictionaries\en_US.aff"
dic_file = r"C:\Program Files\Sigil\hunspell_dictionaries\en_US.dic"
bk.hspell.loadDictionary(aff_file, dic_file)
Doitsu is offline   Reply With Quote
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 offline   Reply With Quote
Old 07-18-2026, 10:40 AM   #619
Doitsu
Grand Sorcerer
Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.
 
Doitsu's Avatar
 
Posts: 5,857
Karma: 24222221
Join Date: Dec 2010
Device: Kindle PW2
Quote:
Originally Posted by KevinH View Post
First, the path to the dictionary dirs is already available to the plugins see dictionary_dirs so no reason to hard code them.
I'm aware of this fact. I wasn't asking about the dictionary dirs. I wanted to know if was possible to get the paths to the dictionaries selected as primary and secondary dictionaries.

Quote:
Originally Posted by KevinH View Post
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?
Using the (X)HTML language attributes is not a reliable method, because not all epubs have them and primary and secondary dictionaries can be selected from the program and user folders.

Quote:
Originally Posted by KevinH View Post
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.
Apparenlty, I underestimated the difficulty of implementing this request. I'll simply continue using my current .ini based method. I.e., retrieving dictionary_name and secondary_dictionary_name from sigil_v6.ini.
Doitsu is offline   Reply With Quote
Old 07-18-2026, 11:19 AM   #620
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
No, you misunderstand. It is not difficult, but if the xhtml files do not have lang or xml:lang, then surely the opf can be used to get the language of the text (both primary and secondary from existing dc:language metadata tags) as needed.

So my reluctance is to change a long standing api for something that can be extracted locally from the epub itself and be more accurate that what the user defaulted to.

That is what is done inside Sigil when a full spellcheck dialog is used. It uses the actual language tags and fallsback to the opf. Only the on the fly red-squiggly spellcheck version uses primary and secondary for pure speed.

I would be happy to create a python snippet to use the opf to determine primary and secondary languages which when combined with the dictionary_dirs list if that would help instead.

I am just loathe to change a minimalist interface (designed that way on purpose) to add things that can be derived in better ways inside the plugin (and I do not mean parsing the sigil ini files here).

If not, then let me know and I will add that requested interface when I get some free time and it will be available in a future version of Sigil.

But it kind of defeats that minimalist design approach to interface to a plugin which is why I was so hesitant.

Last edited by KevinH; 07-18-2026 at 11:47 AM.
KevinH is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Loading Plugin in development Sladd Development 6 06-17-2014 06:57 PM
Question for plugin development gurus DiapDealer Plugins 2 02-04-2012 11:33 PM
DR800 Plugin development for DR800/DR1000 yuri_b iRex Developer's Corner 0 09-18-2010 09:46 AM
Device plugin development reader42 Plugins 10 03-29-2010 12:39 PM
Calibre plugin development - Newbie problems minstrel Plugins 5 04-12-2009 12:44 PM


All times are GMT -4. The time now is 03:26 AM.


MobileRead.com is a privately owned, operated and funded community.