Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

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

wants to merge 2 commits into from

Conversation

Steap
Copy link

@Steap Steap commented May 13, 2017

No description provided.

@kovidgoyal
Copy link
Owner

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
Copy link
Owner

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
Copy link
Owner

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 :)

@Steap
Copy link
Author

Steap commented May 27, 2017

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.

@kovidgoyal
Copy link
Owner

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...

This is especially useful when the title of a book does not allow the user to
guess the language in which it is written (think of "Oliver Twist" by Dickens or
"Nana" by Zola).
@ChoiceTheorem
Copy link

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

@snow212-cn
This comment has been minimized.
Copy link

@Rockster1501 Rockster1501 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Go go go

@sharonnkanng
Copy link

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..

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants