1
0
mirror of https://github.com/janeczku/calibre-web synced 2025-10-22 19:17:38 +00:00

Enhancements for displaying languages on non english locale

This commit is contained in:
Ozzieisaacs
2021-09-26 17:04:53 +02:00
parent 2edcd16119
commit 58735caff3
2 changed files with 18 additions and 11 deletions

View File

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