Don't translate player names

- Simplify wield item player owner display
- Don't try to translate player names
This commit is contained in:
Aaron Suen 2021-03-09 07:51:03 -05:00
parent be71e234d4
commit 19e4a225e0
2 changed files with 9 additions and 1 deletions

View File

@ -16,10 +16,14 @@ minetest.register_on_mods_loaded(function() loadtimeover = true end)
local prefix = minetest.translate(modname, "x")
prefix = prefix:sub(1, prefix:find(modname) - 1)
local passthru = "@1"
function nodecore.translate_inform(str)
if (not str) or (type(str) ~= "string") or (not string_match(str, "%S"))
or (str:sub(1, #prefix) == prefix) then return end
if str == passthru then return true end
if not strings[str] then
if loadtimeover then
nodecore.log("warning", string_format(
@ -38,6 +42,10 @@ function nodecore.translate(str, ...)
return minetest.translate(modname, str, ...)
end
function nodecore.notranlsate(str)
return nodecore.translate(passthru, str)
end
if nodecore.infodump() then
nodecore.register_globalstep("translate templates", function()
if not strings_dirty then return end

View File

@ -148,7 +148,7 @@ entdef = {
local stack = inv:get_stack("main", slot)
nodecore.show_touchtip(puncher, nodecore.touchtip_stack(stack)
.. "\n" .. conf.pname .. "'s Inventory")
.. "\n" .. nodecore.notranslate(conf.pname))
local stime = self.swipetime or 0
local dofx = stime < nodecore.gametime - steal_fxtime