diff --git a/frontend/apps/reader/modules/readerrolling.lua b/frontend/apps/reader/modules/readerrolling.lua index 96aa8e83f..7a158fd13 100644 --- a/frontend/apps/reader/modules/readerrolling.lua +++ b/frontend/apps/reader/modules/readerrolling.lua @@ -308,18 +308,17 @@ end function ReaderRolling:onCheckDomStyleCoherence() if self.ui.document and self.ui.document:isBuiltDomStale() then - local has_bookmarks_warn = self.using_non_normalized_xpointers and self.ui.annotation:hasAnnotations() - self:showReloadConfirmBox(has_bookmarks_warn) + -- When using an older DOM version, bookmarks may break + local bookmarks_warn_txt = self.using_non_normalized_xpointers and self.ui.annotation:hasAnnotations() + and _("\nNote that this change in styles may render your bookmarks or highlights no more valid.\nIf some of them do not show anymore, you can just revert the change you just made to have them shown again.\n\n") + self:showReloadConfirmBox(bookmarks_warn_txt) end end -function ReaderRolling:showReloadConfirmBox(has_bookmarks_warn) - local has_bookmarks_warn_txt = has_bookmarks_warn - and _("\nNote that this change in styles may render your bookmarks or highlights no more valid.\nIf some of them do not show anymore, you can just revert the change you just made to have them shown again.\n\n") - or "" +function ReaderRolling:showReloadConfirmBox(warn_txt) UIManager:show(ConfirmBox:new{ text = T(_("Styles have changed in such a way that fully reloading the document may be needed for a correct rendering.\n%1Do you want to reload the document?"), - has_bookmarks_warn_txt), + warn_txt or ""), ok_callback = function() -- Allow for ConfirmBox to be closed before showing -- "Opening file" InfoMessage