Vocabulary builder: allow longer intervals (#9764)

reviewable/pr9779/r1
weijiuqiao 2 years ago committed by GitHub
parent 71c65d18f1
commit 5082289aad
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -227,7 +227,7 @@ function VocabularyBuilder:gotOrForgot(item, isGot)
elseif target_count == 7 then
due_time = current_time + 24 * 15 * 3600
else
due_time = current_time + 24 * 30 * 3600
due_time = current_time + 24 * 3600 * 30 * 2 ^ (math.min(target_count - 8, 6))
end
item.last_streak_count = item.streak_count

@ -932,13 +932,17 @@ function VocabItemWidget:getTimeSinceDue()
local rounding = elapsed > 0 and math.floor or math.ceil
if abs < 60 then
readable_time = abs .. C_("Time", "s")
readable_time = T(C_("Time", "%1s"), abs)
elseif abs < 3600 then
readable_time = string.format("%d"..C_("Time", "m"), rounding(abs/60))
readable_time = T(C_("Time", "%1m"), rounding(abs/60))
elseif abs < 3600 * 24 then
readable_time = string.format("%d"..C_("Time", "h"), rounding(abs/3600))
readable_time = T(C_("Time", "%1h"), rounding(abs/3600))
elseif abs < 3600 * 24 * 30 then
readable_time = T(C_("Time", "%1d"), rounding(abs/3600/24))
elseif abs < 3600 * 24 * 365 then
readable_time = T(C_("Time", "%1 mo."), rounding(abs/3600/24/3)/10)
else
readable_time = string.format("%d"..C_("Time", "d"), rounding(abs/3600/24))
readable_time = T(C_("Time", "%1 yr."), rounding(abs/3600/24/36.5)/10)
end
if elapsed < 0 then

Loading…
Cancel
Save