mirror of
https://github.com/koreader/koreader.git
synced 2025-08-10 00:52:38 +00:00
Status strings translation context (#13459)
This commit is contained in:
@@ -122,7 +122,7 @@ function filemanagerutil.genStatusButtonsRow(doc_settings_or_file, caller_callba
|
||||
end
|
||||
local function genStatusButton(to_status)
|
||||
return {
|
||||
text = BookList.getBookStatusString(to_status) .. (status == to_status and " ✓" or ""),
|
||||
text = BookList.getBookStatusString(to_status, false, true) .. (status == to_status and " ✓" or ""),
|
||||
enabled = status ~= to_status,
|
||||
callback = function()
|
||||
summary.status = to_status
|
||||
|
||||
@@ -6,6 +6,7 @@ local ffiUtil = require("ffi/util")
|
||||
local sort = require("sort")
|
||||
local util = require("util")
|
||||
local _ = require("gettext")
|
||||
local C_ = _.pgettext
|
||||
local T = ffiUtil.template
|
||||
|
||||
local BookList = Menu:extend{
|
||||
@@ -343,16 +344,22 @@ function BookList.getBookStatus(file)
|
||||
end
|
||||
|
||||
local status_strings = {
|
||||
new = _("New"), -- no sidecar file
|
||||
reading = _("Reading"), -- doc_settings.summary.status
|
||||
abandoned = _("On hold"), -- doc_settings.summary.status
|
||||
complete = _("Finished"), -- doc_settings.summary.status
|
||||
deleted = _("Deleted"),
|
||||
all = _("All"),
|
||||
all = C_("Status of group of books", "All"),
|
||||
deleted = C_("Status of group of books", "Deleted"),
|
||||
new = C_("Status of group of books", "New"), -- no sidecar file
|
||||
reading = C_("Status of group of books", "Reading"), -- doc_settings.summary.status
|
||||
abandoned = C_("Status of group of books", "On hold"), -- doc_settings.summary.status
|
||||
complete = C_("Status of group of books", "Finished"), -- doc_settings.summary.status
|
||||
}
|
||||
|
||||
function BookList.getBookStatusString(status, with_prefix)
|
||||
local status_string = status and status_strings[status]
|
||||
local status_strings_singular = {
|
||||
reading = C_("Status of single book", "Reading"),
|
||||
abandoned = C_("Status of single book", "On hold"),
|
||||
complete = C_("Status of single book", "Finished"),
|
||||
}
|
||||
|
||||
function BookList.getBookStatusString(status, with_prefix, singular)
|
||||
local status_string = status and (singular and status_strings_singular[status] or status_strings[status])
|
||||
if status_string then
|
||||
if with_prefix then
|
||||
status_string = Utf8Proc.lowercase(util.fixUtf8(status_string, "?"))
|
||||
|
||||
@@ -274,7 +274,7 @@ function CalibreSearch:onMenuHold(item)
|
||||
if not item.info or item.info:len() <= 0 then return end
|
||||
local thumbnail = FileManagerBookInfo:getCoverImage(nil, item.path)
|
||||
local thumbwidth = math.min(300, Screen:getWidth()/3)
|
||||
local status_string = BookList.getBookStatusString(BookList.getBookStatus(item.path), true)
|
||||
local status_string = BookList.getBookStatusString(BookList.getBookStatus(item.path), true, true)
|
||||
UIManager:show(InfoMessage:new{
|
||||
text = item.info .. "\n" .. status_string,
|
||||
image = thumbnail,
|
||||
|
||||
Reference in New Issue
Block a user