Address assorted Weblate comments (#7154)

* Fix typo in dropbox

Reported by @lescheck

* Rephrase text justification explanation more elegantly

* CoverBrowser: fix up some plurals

* Statistics: remove random use of template function

* Use ngettext for minute/minutes and second/seconds

* Change KB/MB/GB to kB/MB/GB SI units
reviewable/pr7155/r1
Frans de Jonge 3 years ago committed by GitHub
parent cd6e2d9975
commit 5c9dc850e8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -142,7 +142,7 @@ function DropBox:info(token)
local info = DropBoxApi:fetchInfo(token)
local info_text
if info and info.name then
info_text = T(_"Type: %1\nName: %2\nEmail: %3\nCounty: %4",
info_text = T(_"Type: %1\nName: %2\nEmail: %3\nCountry: %4",
"Dropbox",info.name.display_name, info.email, info.country)
else
info_text = _("No information available")

@ -164,7 +164,7 @@ h1 + h6, h2 + h6, h3 + h6, h4 + h6, h5 + h6 { page-break-before: avoid !importan
{
id = "text_align_all_justify",
title = _("Justify all elements"),
description = _("Text justification is the default, but it may be overridden by publisher styles. This will re-enable it for all elements, which may lose centering in some of them."),
description = _("Text justification is the default, but it may be overridden by publisher styles. This will force justification on all elements, some of which may not be centered as expected."),
css = [[* { text-align: justify !important; }]],
separator = true,
},

@ -5,6 +5,7 @@ local ffi = require("ffi")
local logger = require("logger")
local _ = require("gettext")
local Input = Device.input
local N_ = _.ngettext
local Screen = Device.screen
local T = require("ffi/util").template
@ -25,10 +26,10 @@ local timeout_custom7 = 30 * 60 * 1000
local function humanReadableTimeout(timeout)
local sec = timeout / 1000
if sec >= 120 then
return T(_("%1 minutes"), sec / 60)
if sec >= 60 then
return T(N_("1 minute", "%1 minutes", sec), sec / 60)
else
return T(_("%1 seconds"), sec)
return T(N_("1 second", "%1 seconds", sec), sec)
end
end

@ -878,17 +878,17 @@ function util.getFriendlySize(size, right_align)
local deci_format = right_align and "%6d" or "%d"
size = tonumber(size)
if not size or type(size) ~= "number" then return end
if size > 1024*1024*1024 then
if size > 1000*1000*1000 then
-- @translators This is an abbreviation for the gigabyte, a unit of computer memory or data storage capacity.
return T(_("%1 GB"), string.format(frac_format, size/1024/1024/1024))
return T(_("%1 GB"), string.format(frac_format, size/1000/1000/1000))
end
if size > 1024*1024 then
if size > 1000*1000 then
-- @translators This is an abbreviation for the megabyte, a unit of computer memory or data storage capacity.
return T(_("%1 MB"), string.format(frac_format, size/1024/1024))
return T(_("%1 MB"), string.format(frac_format, size/1000/1000))
end
if size > 1024 then
if size > 1000 then
-- @translators This is an abbreviation for the kilobyte, a unit of computer memory or data storage capacity.
return T(_("%1 KB"), string.format(frac_format, size/1024))
return T(_("%1 kB"), string.format(frac_format, size/1000))
else
-- @translators This is an abbreviation for the byte, a unit of computer memory or data storage capacity.
return T(_("%1 B"), string.format(deci_format, size))

@ -411,9 +411,9 @@ function ListMenuItem:update()
-- Display these instead of the read %
if pages then
if status == "complete" then
pages_str = T(_("Finished - %1 pages"), pages)
pages_str = T(N_("Finished 1 page", "Finished %1 pages", pages), pages)
else
pages_str = T(_("On hold - %1 pages"), pages)
pages_str = T(N_("On hold 1 page", "On hold %1 pages", pages), pages)
end
else
pages_str = status == "complete" and _("Finished") or _("On hold")

@ -1023,7 +1023,8 @@ The max value ensures a page you stay on for a long time (because you fell aslee
})
else
UIManager:show(InfoMessage:new{
text =T(_("Reading progress unavailable.\nNo data from last %1 days."),7)})
text = _("Reading progress is not available.\nThere is no data for the last week."),
})
end
end
},

@ -332,19 +332,19 @@ describe("util module", function()
describe("should convert bytes to friendly size as string", function()
it("to 100.0 GB", function()
assert.is_equal("100.0 GB",
util.getFriendlySize(100*1024*1024*1024))
util.getFriendlySize(100*1000*1000*1000))
end)
it("to 1.0 GB", function()
assert.is_equal("1.0 GB",
util.getFriendlySize(1024*1024*1024+1))
util.getFriendlySize(1000*1000*1000+1))
end)
it("to 1.0 MB", function()
assert.is_equal("1.0 MB",
util.getFriendlySize(1024*1024+1))
util.getFriendlySize(1000*1000+1))
end)
it("to 1.0 KB", function()
assert.is_equal("1.0 KB",
util.getFriendlySize(1024+1))
it("to 1.0 kB", function()
assert.is_equal("1.0 kB",
util.getFriendlySize(1000+1))
end)
it("to B", function()
assert.is_equal("10 B",
@ -352,19 +352,19 @@ describe("util module", function()
end)
it("to 100.0 GB with minimum field width alignment", function()
assert.is_equal(" 100.0 GB",
util.getFriendlySize(100*1024*1024*1024, true))
util.getFriendlySize(100*1000*1000*1000, true))
end)
it("to 1.0 GB with minimum field width alignment", function()
assert.is_equal(" 1.0 GB",
util.getFriendlySize(1024*1024*1024+1, true))
util.getFriendlySize(1000*1000*1000+1, true))
end)
it("to 1.0 MB with minimum field width alignment", function()
assert.is_equal(" 1.0 MB",
util.getFriendlySize(1024*1024+1, true))
util.getFriendlySize(1000*1000+1, true))
end)
it("to 1.0 KB with minimum field width alignment", function()
assert.is_equal(" 1.0 KB",
util.getFriendlySize(1024+1, true))
it("to 1.0 kB with minimum field width alignment", function()
assert.is_equal(" 1.0 kB",
util.getFriendlySize(1000+1, true))
end)
it("to B with minimum field width alignment", function()
assert.is_equal(" 10 B",

Loading…
Cancel
Save