[fix] Statistics: translation (#3151)

* [fix] Statistics: translation
pull/3154/head
Frans de Jonge 7 years ago committed by Hzj_jie
parent cc26be4a17
commit a8d65aad35

@ -133,8 +133,12 @@ function ReaderStatistics:checkInitDatabase()
if self.convert_to_db then -- if conversion to sqlite was doing earlier if self.convert_to_db then -- if conversion to sqlite was doing earlier
if not conn:exec("pragma table_info('book');") then if not conn:exec("pragma table_info('book');") then
UIManager:show(ConfirmBox:new{ UIManager:show(ConfirmBox:new{
text = T(_("Cannot open database in %1.\nThe database may have been moved or deleted.\n " .. text = T(_([[
"Do you want to create an empty database?"), db_location), Cannot open database in %1.
The database may have been moved or deleted.
Do you want to create an empty database?
]]),
db_location),
cancel_text = _("Close"), cancel_text = _("Close"),
cancel_callback = function() cancel_callback = function()
return return
@ -154,16 +158,19 @@ function ReaderStatistics:checkInitDatabase()
if not conn:exec("pragma table_info('book');") then if not conn:exec("pragma table_info('book');") then
if #ReadHistory.hist > 0 then if #ReadHistory.hist > 0 then
local info = InfoMessage:new{ local info = InfoMessage:new{
text =_("New version of statistics plugin is detected.\n" .. text =_([[
"Statistics data needs to be converted into the new database format.\n".. New version of statistics plugin is detected.
"It make take a few minutes.\nPlease wait…")} Statistics data needs to be converted into the new database format.
It make take a few minutes.
Please wait
]])}
UIManager:show(info) UIManager:show(info)
UIManager:forceRePaint() UIManager:forceRePaint()
local nr_book = self:migrateToDB(conn) local nr_book = self:migrateToDB(conn)
UIManager:close(info) UIManager:close(info)
UIManager:forceRePaint() UIManager:forceRePaint()
UIManager:show(InfoMessage:new{ UIManager:show(InfoMessage:new{
text =T(_("Convertion completed.\nImported %1 books to database."),nr_book), timeout = 4 }) text =T(_("Conversion completed.\nImported %1 books to database."),nr_book), timeout = 4 })
else else
self:createDB(conn) self:createDB(conn)
end end

Loading…
Cancel
Save