1
0
mirror of https://github.com/janeczku/calibre-web synced 2024-12-18 22:20:30 +00:00
This commit is contained in:
cbartondock 2021-09-29 09:34:11 -04:00
commit 50f4fe6546
2 changed files with 18 additions and 11 deletions

View File

@ -805,11 +805,16 @@ class CalibreDB():
.filter(self.common_filters()) \ .filter(self.common_filters()) \
.group_by(text('books_languages_link.lang_code')).all() .group_by(text('books_languages_link.lang_code')).all()
for lang in languages: for lang in languages:
try: lang.name = isoLanguages.get_language_name(get_locale(), lang.lang_code)
cur_l = LC.parse(lang.lang_code) #try:
lang.name = cur_l.get_language_name(get_locale()) # if lang.lang_code.lower() == "und":
except UnknownLocaleError: # lang.name = isoLanguages.get_language_name(get_locale(), lang.lang_code)
lang.name = _(isoLanguages.get(part3=lang.lang_code).name) # # lang.name = _("Undetermined")
# else:
# cur_l = LC.parse(lang.lang_code)
# lang.name = cur_l.get_language_name(get_locale())
#except UnknownLocaleError:
# lang.name = _(isoLanguages.get(part3=lang.lang_code).name)
return languages return languages
def update_title_sort(self, config, conn=None): def update_title_sort(self, config, conn=None):

View File

@ -1745,12 +1745,14 @@ def show_book(book_id):
entries = calibre_db.get_filtered_book(book_id, allow_show_archived=True) entries = calibre_db.get_filtered_book(book_id, allow_show_archived=True)
if entries: if entries:
for index in range(0, len(entries.languages)): for index in range(0, len(entries.languages)):
try: entries.languages[index].language_name = isoLanguages.get_language_name(get_locale(), entries.languages[
entries.languages[index].language_name = LC.parse(entries.languages[index].lang_code)\ index].lang_code)
.get_language_name(get_locale()) #try:
except UnknownLocaleError: # entries.languages[index].language_name = isoLanguages.get_language_name(get_locale(), LC.parse(entries.languages[index].lang_code)
entries.languages[index].language_name = _( # .get_language_name(get_locale())
isoLanguages.get(part3=entries.languages[index].lang_code).name) #except UnknownLocaleError:
# entries.languages[index].language_name = _(
# isoLanguages.get(part3=entries.languages[index].lang_code).name)
cc = get_cc_columns(filter_config_custom_read=True) cc = get_cc_columns(filter_config_custom_read=True)
book_in_shelfs = [] book_in_shelfs = []
shelfs = ub.session.query(ub.BookShelf).filter(ub.BookShelf.book_id == book_id).all() shelfs = ub.session.query(ub.BookShelf).filter(ub.BookShelf.book_id == book_id).all()