GetText: fix crash if a value is used as unique value and as singular/plural (#11643)

Concretely 1 second, %1 seconds since #11549 added `1 second` all by itself.
This commit is contained in:
Frans de Jonge
2024-04-09 10:17:26 +02:00
committed by GitHub
parent 279f16aa23
commit ad266f46c2

View File

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