decouple reader footer from dictquicklookup widget & translation fix (#2664)

* chore: fix strings for translations

* dictionary(chore): decouple reader footer from dictquicklookup widget
pull/2610/merge
Qingping Hou 7 years ago committed by Hzj_jie
parent 8f4ec13841
commit fc12ee6537

@ -209,6 +209,10 @@ function ReaderDictionary:showDict(word, results, box)
-- differentiate between dict and wiki
is_wiki = self.is_wiki,
wiki_languages = self.wiki_languages,
refresh_callback = function()
-- update info in footer (time, battery, etc)
self.view.footer:updateFooter()
end,
}
table.insert(self.dict_window_list, self.dict_window)
UIManager:show(self.dict_window)

@ -524,10 +524,6 @@ function ReaderFooter:onPosUpdate(pos)
self:updateFooterPos()
end
function ReaderFooter:onUpdateFooter()
self:updateFooter()
end
-- recalculate footer sizes when document page count is updated
-- see documentation for more info about this event.
ReaderFooter.onUpdatePos = ReaderFooter.updateFooter

@ -65,7 +65,7 @@ function WpaSupplicant:authenticateNetwork(network)
local re = wcli:setNetwork(nw_id, "ssid", string.format("\"%s\"", network.ssid))
if re == 'FAIL' then
wcli:removeNetwork(nw_id)
return false, _("Failed to set network SSID.")
return false, _("An error occurred while selecting network.")
end
if not network.psk then
network.psk = calculatePsk(network.ssid, network.password)
@ -74,7 +74,7 @@ function WpaSupplicant:authenticateNetwork(network)
re = wcli:setNetwork(nw_id, "psk", network.psk)
if re == 'FAIL' then
wcli:removeNetwork(nw_id)
return false, _("Failed to set network password.")
return false, _("An error occurred while setting password.")
end
wcli:enableNetworkByID(nw_id)

@ -56,6 +56,8 @@ local DictQuickLookup = InputContainer:new{
definition_padding = Screen:scaleBySize(2),
definition_margin = Screen:scaleBySize(2),
button_padding = Screen:scaleBySize(14),
-- refresh_callback will be called before we trigger full refresh in onSwipe
refresh_callback = nil,
}
function DictQuickLookup:init()
@ -627,8 +629,7 @@ function DictQuickLookup:onSwipe(arg, ges)
elseif ges.direction == "east" then
self:changeToPrevDict()
else
-- update footer (time & battery)
UIManager:broadcastEvent(Event:new("UpdateFooter"))
if self.refresh_callback then self.refresh_callback() end
-- trigger full refresh
UIManager:setDirty(nil, "full")
end

@ -298,7 +298,7 @@ function Wikipedia:createEpub(epub_path, page, lang, with_images, progress_callb
end
end
progress_callback(_("Fetching Wikipedia page..."))
progress_callback(_("Fetching Wikipedia page"))
local ok, phtml = pcall(self.wikiphtml, self, page, lang)
if not ok then
progress_callback(phtml)
@ -741,7 +741,7 @@ time, abbr, sup {
if include_images then
local nb_images = #images
for inum, img in ipairs(images) do
progress_callback(T(_("Fetching image %1 / %2 ..."), inum, nb_images))
progress_callback(T(_("Fetching image %1 / %2 "), inum, nb_images))
local src = img.src
if use_img_2x and img.src2x then
src = img.src2x

Loading…
Cancel
Save