Status strings translation context (#13459)
Some checks are pending
macos / macOS 13 x86-64 🔨15.2 🎯10.15 (push) Waiting to run
macos / macOS 14 ARM64 🔨15.4 🎯11.0 (push) Waiting to run

This commit is contained in:
hius07
2025-03-26 17:01:39 +02:00
committed by GitHub
parent b6e3b2cbc3
commit 9b8dbf3e83
3 changed files with 17 additions and 10 deletions

View File

@@ -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

View File

@@ -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, "?"))

View File

@@ -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,