Attached is a beta of the Count Pages plugin. The trigger for the release is the change in calibre for handling the temporary directory on Macs. The fix for this should work and be backwardly compatible with all calibre versions and OSes. But, there are a lot more changes than this.
The other changes come largely from discussion here early last year about how to count words. At the time, I implemented a word count using the ICU method that had been added to calibre and released this as a beta. There were complaints and I never released this properly. Other changes were because of other discussions or because I was fiddling. Some have been in beta's, some haven't and I've forgotten which have. I think the German Flesch Reading Ease was, but I'm not sure. The full change list from the current released version is:
- Fix Adobe Page count on Mac machines with calibre 2.76 or later.
- Changed word count to use ICU BreakIterator. This accepts the book language, so it should be more accurate for non-English as well. Will fall back to old method if the ICU BreakIterator method cannot be loaded.
- Add option to choose between ICU word count and the old one. The default is ICU word count.
- Add callback for other plugins calling the count pages. See method call_plugin_callback in common_utils.py.
- Add language awareness for ICU word count. Uses language in the book, otherwise defaults to English.
- Added German version of Flesch Reading Ease.
- Changed tooltip in configuration dialog to show on field as well as label.
- Added localization support for dialogs.
- Change way statistics were written the metadata to reduce side effects.
I have been default word count will be the ICU method. That's right, it isn't backwardly compatible, but that's the way I am doing it. If you don't like that, uncheck the option in the configuration before doing a count.
I have also add made the plugin localizable. If anyone wants to do a translation, you can use
POEdit. This is an easy to use, free tool for translating. You need to extract the file "default.po" from the plugin file and open it POEdit, set the language and enter the translated text for each source string. POEdit shows what has and hasn't been translated. When you have done the translations, save the file and post or send it to me. And if you see something I missed, tell me.
I'll give this a few days for testing and hopefully some translations. If there are any problems, please report them here with as much detail as possible. Suggestions for improvements are also welcome, but I'll probably not do anything with them until after releasing these changes.