Register Guidelines E-Books Today's Posts Search

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

Notices

Reply
 
Thread Tools Search this Thread
Old 09-03-2017, 04:31 AM   #331
schnesim
Member
schnesim began at the beginning.
 
Posts: 21
Karma: 10
Join Date: Aug 2017
Device: Kindle 2. Gen
I did the German translation. Although it's still not possible to import any as I get still the message that it didn't find any annotations.
Might this be due to that I didn't see any text to translate which corresponds to keywords in the "my clippings" file? For instance there was no "- Highlight Pos. xxx", or "Added at Friday...."?

Furthermore I found the following spots which didn't show up in the default.mo or did show up but still showed the english text in calibre:
  • The error message telling me it didn't find any annotations
  • The menu when clicking the Annotations button in calibre (except for the about)
  • The loading dialogs when trying to fetch annotations
  • Also the customize dialog (see attachment, except for the Cancel button)
Attached Thumbnails
Click image for larger version

Name:	annotations1.jpg
Views:	237
Size:	131.9 KB
ID:	158815  
schnesim is offline   Reply With Quote
Old 09-03-2017, 06:03 AM   #332
davidfor
Grand Sorcerer
davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.
 
Posts: 24,907
Karma: 47303748
Join Date: Jul 2011
Location: Sydney, Australia
Device: Kobo:Touch,Glo, AuraH2O, GloHD,AuraONE, ClaraHD, Libra H2O; tolinoepos
Quote:
Originally Posted by schnesim View Post
I did the German translation. Although it's still not possible to import any as I get still the message that it didn't find any annotations.
Might this be due to that I didn't see any text to translate which corresponds to keywords in the "my clippings" file? For instance there was no "- Highlight Pos. xxx", or "Added at Friday...."?
Are you saying that you couldn't import annotations from a Kindle set to German before?

The code for handling the clippings file already has entries for different languages. The strings it is looking for for German are:

Code:
    "Ihre Markierung": ('de', 'highlight'),
    "Ihre Notiz":      ('de', 'note'),
    "Ihr Lesezeichen": ('de', 'bookmark'),

    'de': (r"\sPosition\s*%s",),

    'de': (r"\sSeite\s*%s",),
The first three are used to determine the language and which type of highlight. The others are to parse the location and page.

As far a I know this works for Kindles and German. It should be independent of these translations. Something else must be going on and I probably need a debug log to see.
Quote:
Furthermore I found the following spots which didn't show up in the default.mo or did show up but still showed the english text in calibre:
  • The error message telling me it didn't find any annotations
  • The menu when clicking the Annotations button in calibre (except for the about)
  • The loading dialogs when trying to fetch annotations
  • Also the customize dialog (see attachment, except for the Cancel button)
I think you must be doing something wrong. I haven't actually tested the first one, as I would need to clear the annotations. But, when I use dsestero's Italian translation, I get all of the others in Italian. Attached is the config screen. You did reinstall the plugin and restart calibre? And if you could post your .po file, then I can check it here in case there is an error in the file.
Attached Thumbnails
Click image for larger version

Name:	AnnotationsConfig-Italian.png
Views:	248
Size:	16.5 KB
ID:	158816  
davidfor is offline   Reply With Quote
Advert
Old 09-03-2017, 08:09 AM   #333
schnesim
Member
schnesim began at the beginning.
 
Posts: 21
Karma: 10
Join Date: Aug 2017
Device: Kindle 2. Gen
Ok, I think I understand now, why the import fails. The keywords in my "My Clippings" are actually different than the ones you quoted. Amazon must've changed them sometime.

An entry for a bookmark in mine looks like this
Quote:
Kulturgeschichte der Neuzeit (German Edition) (Egon Friedell)
- Lesezeichen Pos. 6189 | Hinzugefügt am Dienstag, 13. Mai 2014 6.44 Uhr GMT+01:01


==========
And this is a highlight
Quote:
Kulturgeschichte der Neuzeit (German Edition) (Egon Friedell)
- Markierung Pos. 6929-30 | Hinzugefügt am Dienstag, 20. Mai 2014 16.43 Uhr GMT+01:01

Auch in ihrer Form sind sie nur zur Erhöhung des Lebensprunks und der Daseinsfreude gedacht, als farbenglühende Dekorationsstücke,
==========
another highlight with slight difference
Quote:
Is It Really Too Much To Ask?: The World According to Clarkson Volume 5 (World According to Clarkson 5) (Jeremy Clarkson)
- Markierung auf Seite 314 | Pos. 3719 | Hinzugefügt am Sonntag, 7. Dezember 2014 22.30 Uhr GMT+01:01

Matterhorn, is by far the best book I’ve ever read.
==========
And finally a note
Quote:
Kulturgeschichte der Neuzeit (German Edition) (Egon Friedell)
- Notiz Pos. 21054 | Hinzugefügt am Freitag, 24. Oktober 2014 16.07 Uhr GMT+01:01

This is a note
==========
In each case "Ihre" is missing. And also "Position" got abbreviated to "Pos.".

I think an option in the plugin, where one can define a template for what to look for would be really beneficial.

I added the German .mo file. Some quote got autocorrected to the wrong kind of quote. I fixed it, but this wasn't the issue. So hopefully you can spot my mistake.

EDIT
The forum doesn't allow to upload my mo file. Says "invalid file" so you can find it here: http://ul.to/nz9e5ilg

EDIT2
Silly me, the forum clearly says it only allows certain suffixes. That's why the upload failed.

Last edited by schnesim; 09-03-2017 at 08:13 AM.
schnesim is offline   Reply With Quote
Old 09-03-2017, 09:58 AM   #334
dsestero
Enthusiast
dsestero began at the beginning.
 
Posts: 36
Karma: 10
Join Date: Aug 2017
Location: Aosta (Italy)
Device: Kindle Voyage
I confirm I can not get any annotations from the books if my Kindle is configured with language italian. I only get the annotations made when Kindle is configured with English language.

I think the same problem highlighted by schnesim applies and I think his proposal to add an option where one can define a template for what to look for would be a nice solution.

Furthermore, I confirm the error 'Confidence is not in the list' is still present.

Thank you,

Dario
dsestero is offline   Reply With Quote
Old 09-03-2017, 10:13 AM   #335
davidfor
Grand Sorcerer
davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.
 
Posts: 24,907
Karma: 47303748
Join Date: Jul 2011
Location: Sydney, Australia
Device: Kobo:Touch,Glo, AuraH2O, GloHD,AuraONE, ClaraHD, Libra H2O; tolinoepos
Quote:
Originally Posted by schnesim View Post
Ok, I think I understand now, why the import fails. The keywords in my "My Clippings" are actually different than the ones you quoted. Amazon must've changed them sometime.

An entry for a bookmark in mine looks like this


And this is a highlight

another highlight with slight difference


And finally a note


In each case "Ihre" is missing. And also "Position" got abbreviated to "Pos.".

I think an option in the plugin, where one can define a template for what to look for would be really beneficial.
The handling of this is different enough that I don't think making it translatable will work. But, from the samples you have given, I think I have added the correct searches into the code. These are in the attached beta.
Quote:
I added the German .mo file. Some quote got autocorrected to the wrong kind of quote. I fixed it, but this wasn't the issue. So hopefully you can spot my mistake.
What did you call the file? I named it "de.mo" and added it to the plugin. When I set the calibre language to German, the plugin appeared to use the German translations.
Quote:
EDIT
The forum doesn't allow to upload my mo file. Says "invalid file" so you can find it here: http://ul.to/nz9e5ilg

EDIT2
Silly me, the forum clearly says it only allows certain suffixes. That's why the upload failed.
Yes, the forum only allows certain file types. That's why I zipped them up. Could you supply the .po file? I have found a few more missing strings to add. When I have the language po files, I can update these automatically for anyone doing translations.

The attached beta includes the fix for getting the annotations for German (hopefully) and changes for most of the problems Nicolas F reported. Plus a zip file with the update .po files.
Attached Files
File Type: zip annotations-translations-default.zip (7.2 KB, 233 views)
File Type: zip Annotations-beta.zip (676.8 KB, 232 views)
davidfor is offline   Reply With Quote
Advert
Old 09-03-2017, 10:21 AM   #336
davidfor
Grand Sorcerer
davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.
 
Posts: 24,907
Karma: 47303748
Join Date: Jul 2011
Location: Sydney, Australia
Device: Kobo:Touch,Glo, AuraH2O, GloHD,AuraONE, ClaraHD, Libra H2O; tolinoepos
Quote:
Originally Posted by Nicolas F View Post
Thanks for the fix. Still a few things :
  1. The error cited by dsestero (number 3) occurs again:
    Spoiler:
    calibre, version 3.7.0
    ERREUR : Exception non gérée: <b>ValueError</b>:'Confidence' is not in list

    calibre 3.7 [64bit] embedded-python: True is64bit: True
    Windows-10-10.0.15063-SP0 Windows ('64bit', 'WindowsPE')
    ('Windows', '10', '10.0.15063')
    Python 2.7.12+
    Windows: ('10', '10.0.15063', 'SP0', u'Multiprocessor Free')
    Interface language: fr
    Successfully initialized third party plugins: NormComment (0, 0, 3) && KoboTouchExtended (2, 8, 2) && Extraire ISBN (1, 4, 4) && Diaps Editing Toolbag (0, 3, 5) && Kobo Utilities (2, 5, 2) && Annotations (1, 6, 1) && Amazon hi-res covers (0, 1, 0) && KePub Output (2, 7, 1) && Find Duplicates (1, 6, 3) && Goodreads Sync (1, 10, 1) && Kindle covers (G) (0, 3, 0) && KePub Metadata Reader (2, 7, 1) && Count Pages (1, 8, 0) && Goodreads (1, 1, 12) && KePub Metadata Writer (2, 7, 1) && EpubMerge (2, 1, 1) && Contrôle qualité (1, 9, 11) && KePub Input (2, 7, 3) && EpubSplit (2, 2, 1)
    Traceback (most recent call last):
    File "calibre_plugins.annotations.action", line 362, in fetch_usb_device_annotations
    File "calibre_plugins.annotations.action", line 281, in fetch_device_annotations
    File "calibre_plugins.annotations.annotated_books", line 314, in __init__
    ValueError: 'Confidence' is not in list

  1. I should have fixed this in the latest beta. It deserves a .
    Quote:

  2. Unless I missed something, it's still not translated
  3. Missed it and have added it in the beta.
    Quote:

  4. The button now works correctly, but the window still isn't translated.
  5. The create column dialog is a little different to everything else. I think I have to rewrite how it is done to get the translation working.
    Quote:

  6. It's still not translated
Fixed in the latest beta.
Quote:
But aside from 1, all the other things don't impact on functionality at all, so don't lose your sleep trying to make it translatable if it's hard to achieve. It's only in the configuration menu...



It's not displayed in the UI, it's the description of the function. It's just that I never used this, don't have a kindle and I don't understand what it's doing so I don't know how to translate the labels related to news clipping.
For this, I can't find where the text you quoted is. It isn't in the default.po and I can't find it anywhere in the plugin code.
davidfor is offline   Reply With Quote
Old 09-03-2017, 10:27 AM   #337
davidfor
Grand Sorcerer
davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.
 
Posts: 24,907
Karma: 47303748
Join Date: Jul 2011
Location: Sydney, Australia
Device: Kobo:Touch,Glo, AuraH2O, GloHD,AuraONE, ClaraHD, Libra H2O; tolinoepos
Quote:
Originally Posted by dsestero View Post
I confirm I can not get any annotations from the books if my Kindle is configured with language italian. I only get the annotations made when Kindle is configured with English language.

I think the same problem highlighted by schnesim applies and I think his proposal to add an option where one can define a template for what to look for would be a nice solution.
The problem is that this isn't a simple string to translate, it's part of a regex. The plugin already handles having multiple strings for each language and I can add more. I just need the actual strings to add. For Italian the plugin currently has:

Code:
    "La mia evidenziazione": ('it', 'highlight'),
    "Le mie note":           ('it', 'note'),
    "Il mio segnalibro":     ('it', 'bookmark'),

    'it': (r"\sPosizione\s*%s",),

    'it': (r"\spagina\s*%s",),
Quote:
Furthermore, I confirm the error 'Confidence is not in the list' is still present.
Should be fixed in the latest beta.
davidfor is offline   Reply With Quote
Old 09-04-2017, 09:13 AM   #338
dsestero
Enthusiast
dsestero began at the beginning.
 
Posts: 36
Karma: 10
Join Date: Aug 2017
Location: Aosta (Italy)
Device: Kindle Voyage
Thank you David, we are almost there!

Ok, here is the fragment of the code for matching the annotations updated according to what I found in MyClippings from my Kindle Voyage:
Code:
    "La tua evidenziazione": ('it', 'highlight'),
    "La tua nota":           ('it', 'note'),
    "Il tuo segnalibro":     ('it', 'bookmark'),

    'it': (r"\sposizione\s*%s",),

    'it': (r"\spagina\s*%s",),
please update the plugin accordingly.

Furthermore, I completed the it.po file with the latest translations and attached the updated annotations-translations-default.zip.

Thanks a lot, I am very happy to have this plugin almost working for Italian!

Dario
Attached Files
File Type: zip annotations-translations-default.zip (7.6 KB, 227 views)
dsestero is offline   Reply With Quote
Old 09-06-2017, 08:21 AM   #339
davidfor
Grand Sorcerer
davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.
 
Posts: 24,907
Karma: 47303748
Join Date: Jul 2011
Location: Sydney, Australia
Device: Kobo:Touch,Glo, AuraH2O, GloHD,AuraONE, ClaraHD, Libra H2O; tolinoepos
Beta - Update for Italian

Attached is an updated beta. This includes the latest Italian translations from dsestero plus the changed Italian strings for fetching annotations from the Kindle.
Attached Files
File Type: zip Annotations-beta.zip (677.8 KB, 223 views)
davidfor is offline   Reply With Quote
Old 09-06-2017, 03:24 PM   #340
schnesim
Member
schnesim began at the beginning.
 
Posts: 21
Karma: 10
Join Date: Aug 2017
Device: Kindle 2. Gen
It's still not possible to import annotations in German (or probably any other non English language), so right now I'm trying to tweak the code to make it work.

One quick question. How do I debug a plugin? Is remote debugging from an IDE possible or do I have to work with messages printed to the console?
schnesim is offline   Reply With Quote
Old 09-06-2017, 08:13 PM   #341
davidfor
Grand Sorcerer
davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.
 
Posts: 24,907
Karma: 47303748
Join Date: Jul 2011
Location: Sydney, Australia
Device: Kobo:Touch,Glo, AuraH2O, GloHD,AuraONE, ClaraHD, Libra H2O; tolinoepos
Quote:
Originally Posted by schnesim View Post
It's still not possible to import annotations in German (or probably any other non English language), so right now I'm trying to tweak the code to make it work.
Unless Amazon have made more significant changes to the "My Clippings.txt" than your earlier post suggests and everyone who uses other languages is quiet, I doubt it is affecting every one. But, we'll have to see what others have to say.

I've done some manual checks of the code against the samples you gave the other day. They should work. If you send me a copy of your "My Clippings.txt" I can look and see what other differences there are and test them. Also, copy of the debug log when you have tried to fetch the annotations would tell me a lot.
Quote:
One quick question. How do I debug a plugin? Is remote debugging from an IDE possible or do I have to work with messages printed to the console?
There is a method where you can use VisualStudio, but I normally just write to the console. Using the log method in the code will write to the console with some extra information.
davidfor is offline   Reply With Quote
Old 09-07-2017, 01:24 AM   #342
schnesim
Member
schnesim began at the beginning.
 
Posts: 21
Karma: 10
Join Date: Aug 2017
Device: Kindle 2. Gen
No problem, here is a debug outout and the My Clippings file.
Attached Files
File Type: zip caibre-debug.txt.zip (5.2 KB, 230 views)
File Type: zip my_clippings.txt.zip (36.5 KB, 219 views)
schnesim is offline   Reply With Quote
Old 09-07-2017, 03:02 AM   #343
davidfor
Grand Sorcerer
davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.
 
Posts: 24,907
Karma: 47303748
Join Date: Jul 2011
Location: Sydney, Australia
Device: Kobo:Touch,Glo, AuraH2O, GloHD,AuraONE, ClaraHD, Libra H2O; tolinoepos
Quote:
Originally Posted by schnesim View Post
No problem, here is a debug outout and the My Clippings file.
The debug log has:

Code:
DEBUG:   31.5  ParseKindleMyClippingsTxt ERROR: Error trying to read clippings file: coercing to Unicode: need string or buffer, NoneType found
That suggest the clippings file is empty or missing. And the plugin expect the clippings file to be called "My Clippings.txt". The clippings file you posted is "my_clippings.txt". Did you rename the file or is this what it is called on the device?
davidfor is offline   Reply With Quote
Old 09-07-2017, 04:34 AM   #344
dsestero
Enthusiast
dsestero began at the beginning.
 
Posts: 36
Karma: 10
Join Date: Aug 2017
Location: Aosta (Italy)
Device: Kindle Voyage
Thank you David,

now for some books the annotations are fetched correctly, while for others annotated books no annotation is found, although the title and author match.

Next week I will investigate more deeply and then will write back.

Ciao,
Dario
dsestero is offline   Reply With Quote
Old 09-07-2017, 06:33 AM   #345
davidfor
Grand Sorcerer
davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.
 
Posts: 24,907
Karma: 47303748
Join Date: Jul 2011
Location: Sydney, Australia
Device: Kobo:Touch,Glo, AuraH2O, GloHD,AuraONE, ClaraHD, Libra H2O; tolinoepos
Quote:
Originally Posted by dsestero View Post
now for some books the annotations are fetched correctly, while for others annotated books no annotation is found, although the title and author match.

Next week I will investigate more deeply and then will write back.
Good to hear. If you send me a copy of the your clippings file, I'll have a look to see if can work out what is wrong. And an idea of which aren't working would help.
davidfor is offline   Reply With Quote
Reply

Tags
sampleexportingapp


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
[GUI Plugin] Open With kiwidude Plugins 403 04-01-2024 08:39 AM
[GUI Plugin] KindleUnpack - The Plugin DiapDealer Plugins 492 10-25-2022 08:13 AM
[GUI Plugin] Annotations (closed) GRiker Plugins 68 06-17-2014 06:11 AM
[GUI Plugin] KiNotes -axel- Plugins 0 07-14-2013 06:39 PM
[GUI Plugin] Plugin Updater **Deprecated** kiwidude Plugins 159 06-19-2011 12:27 PM


All times are GMT -4. The time now is 02:04 PM.


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