diff --git a/src/pyj/book_list/main.pyj b/src/pyj/book_list/main.pyj index 246aa6b209..6c38801908 100644 --- a/src/pyj/book_list/main.pyj +++ b/src/pyj/book_list/main.pyj @@ -63,9 +63,7 @@ def init_ui(): , 0) # We do this after event loop ticks over to avoid catching popstate events that some browsers send on page load translations = get_translations() - if translations: - install(translations) - get_translations(translations) + install(translations) remove_initial_progress_bar() document.head.appendChild(E.style(get_widget_css())) set_css(document.body, background_color=get_color('window-background'), color=get_color('window-foreground')) @@ -88,7 +86,7 @@ def install_data_and_init_ui(raw_data): interface_data = get_interface_data() sd = UserSessionData(interface_data.username, interface_data.user_session_data) set_session_data(sd) - if data.translations: + if data.translations?: get_translations(data.translations) init_ui() @@ -128,7 +126,7 @@ def do_update_interface_data(): if end_type is 'load': data = JSON.parse(xhr.responseText) update_interface_data(data) - if data.translations: + if data.translations?: get_translations(data.translations) install(data.translations) ).send() diff --git a/src/pyj/session.pyj b/src/pyj/session.pyj index 85ec943c21..889feb2096 100644 --- a/src/pyj/session.pyj +++ b/src/pyj/session.pyj @@ -201,7 +201,7 @@ def update_interface_data(new_data): def get_translations(newval): if not get_translations.storage: get_translations.storage = SessionData('calibre-translations-') - if newval: + if newval?: get_translations.storage.set('current', newval) else: return get_translations.storage.get('current')