Fix #1930737 [[Enhancement] Warning is not translated](https://bugs.launchpad.net/calibre/+bug/1930737)

This commit is contained in:
Kovid Goyal 2021-06-04 05:17:19 +05:30
parent eea1a02373
commit db1b00a158
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C
2 changed files with 8 additions and 7 deletions

View File

@ -25,7 +25,6 @@ from __python__ import hash_literals, bound_methods
import traceback
from elementmaker import E
from gettext import gettext as _
from dom import set_css
from read_book.cfi import (
@ -884,10 +883,7 @@ def resize_done():
def auto_scroll_action(action):
if action is 'toggle':
get_boss().send_message('error', title=_('No auto scroll in paged mode'), msg=_(
'Switch to flow mode (Viewer preferences->Page layout) to enable auto'
' scrolling'), is_non_critical=True
)
get_boss().send_message('error', errkey='no-auto-scroll-in-paged-mode', is_non_critical=True)
return False

View File

@ -779,10 +779,15 @@ class View:
def on_iframe_error(self, data):
title = data.title or _('There was an error processing the book')
msg = _('Unknown error')
if data.errkey:
if data.errkey is 'no-auto-scroll-in-paged-mode':
title = _('No auto scroll in paged mode')
msg = _('Switch to flow mode (Viewer preferences->Page layout) to enable auto scrolling')
if data.is_non_critical:
warning_dialog(title, data.msg, data.details, on_close=ui_operations.focus_iframe)
warning_dialog(title, msg, data.details, on_close=ui_operations.focus_iframe)
return
ui_operations.show_error(title, data.msg, data.details)
ui_operations.show_error(title, msg, data.details)
def apply_color_scheme(self):
self.current_color_scheme = ans = resolve_color_scheme()