1
0
mirror of https://github.com/mt-mods/signs_lib.git synced 2024-12-24 00:00:20 +01:00

don't emit translation strings to the log (#17)

* don't emit translation strings to the log

* fix luacheck

* don't double-log signs_lib prefix
This commit is contained in:
fluxionary 2022-12-10 11:36:58 -08:00 committed by GitHub
parent 5ae111e1fa
commit ed3a679bca
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

20
api.lua
View File

@ -3,6 +3,10 @@
local S = signs_lib.S
local has_default_mod = minetest.get_modpath("default")
local function log(level, messagefmt, ...)
minetest.log(level, "[signs_lib] " .. messagefmt:format(...))
end
local function get_sign_formspec() end
signs_lib.glow_item = "basic_materials:energy_crystal_simple"
@ -973,7 +977,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", "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 +1368,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 +1396,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