forked from Mirrorlandia_minetest/minetest
Display sane output for empty descriptions
According to its man page, the function gettext(3) "may return a nonempty string" when msgid is "". This commit fixes a bug where the comment "" for some settings caused gettext to return a "nonempty string", in this case header info of the po file.
This commit is contained in:
parent
c4d1862344
commit
f3d82567c9
@ -234,7 +234,15 @@ local function create_change_setting_formspec(dialogdata)
|
|||||||
|
|
||||||
formspec = formspec .. ",,"
|
formspec = formspec .. ",,"
|
||||||
|
|
||||||
for _, comment_line in ipairs(fgettext_ne(setting.comment):split("\n")) do
|
local comment_text = ""
|
||||||
|
|
||||||
|
-- fgettext_ne("") doesn't have to return "", according to specification of gettext(3)
|
||||||
|
if setting.comment == "" then
|
||||||
|
comment_text = fgettext_ne("(No description of setting given)")
|
||||||
|
else
|
||||||
|
comment_text = fgettext_ne(setting.comment)
|
||||||
|
end
|
||||||
|
for _, comment_line in ipairs(comment_text:split("\n")) do
|
||||||
formspec = formspec .. "," .. core.formspec_escape(comment_line) .. ","
|
formspec = formspec .. "," .. core.formspec_escape(comment_line) .. ","
|
||||||
end
|
end
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user