GetText: fix crash if a value is used as unique value and as singular/plural

Concretely 1 second, %1 seconds since #11549 added `1 second` all by itself.
reviewable/pr11643/r1
Frans de Jonge 1 month ago
parent 279f16aa23
commit 32395ea373

@ -58,7 +58,7 @@ Returns a translation.
local translation = _("A meaningful message.")
--]]
function GetText_mt.__call(gettext, msgid)
return gettext.translation[msgid] or gettext.wrapUntranslated(msgid)
return gettext.translation[msgid] and gettext.translation[msgid][0] or gettext.translation[msgid] or gettext.wrapUntranslated(msgid)
end
local function c_escape(what_full, what)

Loading…
Cancel
Save