diff --git a/frontend/apps/cloudstorage/cloudstorage.lua b/frontend/apps/cloudstorage/cloudstorage.lua index 209106919..4d158aefc 100644 --- a/frontend/apps/cloudstorage/cloudstorage.lua +++ b/frontend/apps/cloudstorage/cloudstorage.lua @@ -122,7 +122,7 @@ function CloudStorage:openCloudServer(url) table.remove(self.paths) return false else - UIManager:show(InfoMessage:new{text = _("Empty folder") }) + UIManager:show(InfoMessage:new{ text = _("Empty folder") }) return false end end diff --git a/frontend/apps/cloudstorage/dropbox.lua b/frontend/apps/cloudstorage/dropbox.lua index ab55bb2ce..168374c2c 100644 --- a/frontend/apps/cloudstorage/dropbox.lua +++ b/frontend/apps/cloudstorage/dropbox.lua @@ -27,7 +27,7 @@ function DropBox:downloadFile(item, password, path, close) }) else UIManager:show(InfoMessage:new{ - text = _("Could not save file to:\n") .. path, + text = T(_("Could not save file to:\n%1"), path), timeout = 3, }) end @@ -81,7 +81,7 @@ function DropBox:config(item, callback) { text = _("Info"), callback = function() - UIManager:show(InfoMessage:new{text = text_info }) + UIManager:show(InfoMessage:new{ text = text_info }) end }, { @@ -99,7 +99,9 @@ function DropBox:config(item, callback) self.settings_dialog:onClose() UIManager:close(self.settings_dialog) else - UIManager:show(InfoMessage:new{text = "Please fill in all fields." }) + UIManager:show(InfoMessage:new{ + text = _("Please fill in all fields.") + }) end end }, diff --git a/frontend/apps/cloudstorage/ftp.lua b/frontend/apps/cloudstorage/ftp.lua index be02310e5..69c1f6ace 100644 --- a/frontend/apps/cloudstorage/ftp.lua +++ b/frontend/apps/cloudstorage/ftp.lua @@ -48,7 +48,7 @@ function Ftp:downloadFile(item, address, user, pass, path, close) }) else UIManager:show(InfoMessage:new{ - text = _("Could not save file to:\n") .. path, + text = T(_("Could not save file to:\n%1"), path), timeout = 3, }) end @@ -114,7 +114,7 @@ function Ftp:config(item, callback) { text = _("Info"), callback = function() - UIManager:show(InfoMessage:new{text = text_info }) + UIManager:show(InfoMessage:new{ text = text_info }) end }, { @@ -132,7 +132,9 @@ function Ftp:config(item, callback) self.settings_dialog:onClose() UIManager:close(self.settings_dialog) else - UIManager:show(InfoMessage:new{text = "Please fill in all fields." }) + UIManager:show(InfoMessage:new{ + text = _("Please fill in all fields.") + }) end end }, diff --git a/frontend/apps/filemanager/filemanager.lua b/frontend/apps/filemanager/filemanager.lua index d39b3813f..7a1bcc162 100644 --- a/frontend/apps/filemanager/filemanager.lua +++ b/frontend/apps/filemanager/filemanager.lua @@ -482,16 +482,16 @@ function FileManager:renameFile(file) }) else UIManager:show(InfoMessage:new{ - text = util.template(_( - "Failed to move history data of %1 to %2.\n" .. - "The reading history may be lost."), file, dest), + text = util.template( + _("Failed to move history data of %1 to %2.\nThe reading history may be lost."), + file, dest), }) end end else UIManager:show(InfoMessage:new{ text = util.template( - _("Failed to rename from %1 to %2"), file, dest), + _("Failed to rename from %1 to %2"), file, dest), }) end end diff --git a/frontend/apps/filemanager/filemanagerfilesearcher.lua b/frontend/apps/filemanager/filemanagerfilesearcher.lua index 509344ba6..c2d099966 100644 --- a/frontend/apps/filemanager/filemanagerfilesearcher.lua +++ b/frontend/apps/filemanager/filemanagerfilesearcher.lua @@ -98,7 +98,8 @@ function FileSearcher:close() else UIManager:show( InfoMessage:new{ - text = util.template(_("Found no files matching '%1'."), self.search_value) + text = util.template(_("Found no files matching '%1'."), + self.search_value) } ) end diff --git a/frontend/apps/filemanager/filemanagersearch.lua b/frontend/apps/filemanager/filemanagersearch.lua index e446a6b42..afe5c7add 100644 --- a/frontend/apps/filemanager/filemanagersearch.lua +++ b/frontend/apps/filemanager/filemanagersearch.lua @@ -209,7 +209,11 @@ function Search:ShowSearch() UIManager:show(self.search_dialog) else if self.error then - UIManager:show(InfoMessage:new{text = self.error .. ("\n") .. _( "Unable to find a calibre metadata file."),}) + UIManager:show(InfoMessage:new{ + text = ("%s\n%s"):format( + self.error, + _("Unable to find a calibre metadata file.")), + }) end end @@ -472,38 +476,39 @@ function Search:find(option) self:browse(option,1) end else - UIManager:show(InfoMessage:new{text = T(_("No match for %1."), self.search_value)}) + UIManager:show(InfoMessage:new{ + text = T(_("No match for %1."), self.search_value) + }) end end function Search:onMenuHold(item) - if string.len(item.info or "") > 0 then - if item.notchecked then - item.info = item.info .. item.path - local f = io.open(item.path) - if f == nil then - item.info = item.info .. "\n" .. _("File not found!") - else - item.info = item.info .. "\n" .. _("Size:") .. " " .. string.format("%4.1fM",lfs.attributes(item.path, "size")/1024/1024) - f:close() - end - item.notchecked = false - end - local thumbnail = nil - local doc = DocumentRegistry:openDocument(item.path) - if doc then - thumbnail = doc:getCoverPageImage() - doc:close() - end - local thumbwidth = math.min(240, Screen:getWidth()/3) - UIManager:show(InfoMessage:new{ - text = item.info, - image = thumbnail, - image_width = thumbwidth, - image_height = thumbwidth/2*3 - }) + if not item.info or item.info:len() <= 0 then return end + if item.notchecked then + item.info = item.info .. item.path + local f = io.open(item.path) + if f == nil then + item.info = item.info .. "\n" .. _("File not found!") + else + item.info = item.info .. "\n" .. _("Size:") .. " " .. string.format("%4.1fM",lfs.attributes(item.path, "size")/1024/1024) + f:close() + end + item.notchecked = false + end + local thumbnail + local doc = DocumentRegistry:openDocument(item.path) + if doc then + thumbnail = doc:getCoverPageImage() + doc:close() end + local thumbwidth = math.min(240, Screen:getWidth()/3) + UIManager:show(InfoMessage:new{ + text = item.info, + image = thumbnail, + image_width = thumbwidth, + image_height = thumbwidth/2*3 + }) end function Search:showresults() diff --git a/frontend/apps/reader/modules/readerdictionary.lua b/frontend/apps/reader/modules/readerdictionary.lua index d046c2a52..7cffc3318 100644 --- a/frontend/apps/reader/modules/readerdictionary.lua +++ b/frontend/apps/reader/modules/readerdictionary.lua @@ -232,7 +232,8 @@ function ReaderDictionary:onUpdateDefaultDict(dict) logger.dbg("make default dictionary:", dict) self.default_dictionary = dict UIManager:show(InfoMessage:new{ - text = T(_("%1 is now the default dictionary for this document."), dict), + text = T(_("%1 is now the default dictionary for this document."), + dict), timeout = 2, }) return true diff --git a/frontend/ui/widget/menu.lua b/frontend/ui/widget/menu.lua index a5714bd75..3c0eb5b42 100644 --- a/frontend/ui/widget/menu.lua +++ b/frontend/ui/widget/menu.lua @@ -268,9 +268,7 @@ function MenuItem:onUnfocus() end function MenuItem:onShowItemDetail() - UIManager:show(InfoMessage:new{ - text=self.detail, - }) + UIManager:show(InfoMessage:new{ text = self.detail, }) return true end