calibre icon indicating copy to clipboard operation
calibre copied to clipboard

Add a language field to the "get ebooks" dialog.

Open Steap opened this issue 7 years ago • 8 comments

Steap avatar May 13 '17 03:05 Steap

There's a whole bunch of other amazon plugins you should make similar changes to. See the parse_language() function in sources/amazon.py

Also I thing the language field should contain cacnonicalized langauge names whereever possible, so that the displayed language is the same from all stores. See the get_langauge() and canonicalize_lang() functions in localization.py

The plugins should return ISO lang codes and the GUI should display them as localized language names.

kovidgoyal avatar May 13 '17 03:05 kovidgoyal

You should not need to maintain your own mapping of german to english language names, it should be there already, see langnames_to_langcodes() in localization.py

Unless of course, libri.de uses different langnames than the ones in the german translation of calibre.

kovidgoyal avatar May 13 '17 12:05 kovidgoyal

Though I suppose if you want it to work with non-german calibre, you have to maintain your own mapping. So feel free to ignore my previous comment :)

kovidgoyal avatar May 13 '17 12:05 kovidgoyal

OK, thanks for the tips! I'm going to drop the non-English stores for now, I'm more interested in pushing the new feature. I'll update the PR with a fix for all English Amazon stores.

Steap avatar May 27 '17 17:05 Steap

Unfortunately, you cannot re-use code in that fashion for the amazon plugins. The reason is that store plugins are auto-updated and reloaded dynamically (to keep up with changes to websites). That means they cannot depend on each other. So you'd have to duplicate the code across all amazon plugins -- it's annoying, but...

kovidgoyal avatar May 29 '17 06:05 kovidgoyal

Where is code that makes some text able to jump through pages when clicked? Thank you!

ChoiceTheorem avatar Feb 18 '19 10:02 ChoiceTheorem

Is the coronavirus situation in India still not serious enough to kill the author?

snow212-cn avatar Apr 19 '20 05:04 snow212-cn

For this bug: Amazon meta data plugin should use current locale by default(https://bugs.launchpad.net/calibre/+bug/1256374), can we just change line 176 in the localization.py file to lang = get_system_locale()? If not, I am curious how to implement that feature since from other methods, there were various ways to receive user language and that's the dead end..

sharonnkanng avatar Jul 17 '22 17:07 sharonnkanng