don't emit translation strings to the log

This commit is contained in:
flux 2022-12-09 09:05:00 -08:00
parent 5ae111e1fa
commit fccc95cfee
1 changed files with 13 additions and 8 deletions

21
api.lua
View File

@ -1,8 +1,13 @@
-- signs_lib api, backported from street_signs
local f = string.format
local S = signs_lib.S
local has_default_mod = minetest.get_modpath("default")
local function log(level, messagefmt, ...)
minetest.log(level, "[signs_lib] " .. f(messagefmt, ...))
end
local function get_sign_formspec() end
signs_lib.glow_item = "basic_materials:energy_crystal_simple"
@ -973,7 +978,7 @@ function signs_lib.after_place_node(pos, placer, itemstack, pointed_thing, locke
end
function signs_lib.register_fence_with_sign()
minetest.log("warning", "[signs_lib] ".."Attempt to call no longer used function signs_lib.register_fence_with_sign()")
log("warning", "[signs_lib] Attempt to call no longer used function signs_lib.register_fence_with_sign()")
end
local use_glow = function(pos, node, puncher, pointed_thing)
@ -1364,11 +1369,11 @@ minetest.register_on_player_receive_fields(function(player, formname, fields)
local playername = player:get_player_name()
if fields.text and fields.ok then
minetest.log("action", S("@1 wrote \"@2\" to sign at @3",
log("action", "%s wrote %q to sign at %s",
(playername or ""),
fields.text:gsub('\\', '\\\\'):gsub("\n", "\\n"),
fields.text:gsub("\n", "\\n"),
pos_string
))
)
signs_lib.update_sign(pos, fields)
elseif fields.wide_on or fields.wide_off or fields.uni_on or fields.uni_off then
local node = minetest.get_node(pos)
@ -1392,20 +1397,20 @@ minetest.register_on_player_receive_fields(function(player, formname, fields)
end
if change_wide then
minetest.log("action", S("@1 flipped the wide-font switch to \"@2\" at @3",
log("action", "%s flipped the wide-font switch to %q at %s",
(playername or ""),
(fields.wide_on and "off" or "on"),
minetest.pos_to_string(pos)
))
)
signs_lib.update_sign(pos, fields)
minetest.show_formspec(playername, "signs_lib:sign", get_sign_formspec(pos, node.name))
end
if change_uni then
minetest.log("action", S("@1 flipped the unicode-font switch to \"@2\" at @3",
log("action", "%s flipped the unicode-font switch to %q at %s",
(playername or ""),
(fields.uni_on and "off" or "on"),
minetest.pos_to_string(pos)
))
)
signs_lib.update_sign(pos, fields)
minetest.show_formspec(playername, "signs_lib:sign", get_sign_formspec(pos, node.name))
end