[go: nahoru, domu]

Skip to content

Commit

Permalink
Don't rely on presence of 5.x translation API (#14)
Browse files Browse the repository at this point in the history
* Update mtg.lua

* Update mcl2.lua
  • Loading branch information
LoneWolfHT committed Oct 20, 2021
1 parent 46dc08b commit fdef9c3
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 2 deletions.
10 changes: 9 additions & 1 deletion compat/mcl2.lua
Original file line number Diff line number Diff line change
@@ -1,4 +1,12 @@
local S = minetest.get_translator(minetest.get_current_modname())
local S

if minetest.get_translator ~= nil then
S = minetest.get_translator(minetest.get_current_modname())
else
S = function(str)
return(str)
end
end

for _, item in pairs({"lavastuff:sword", "lavastuff:pick", "lavastuff:axe", "lavastuff:shovel"}) do
local itype = item:sub(item:find(":")+1)
Expand Down
10 changes: 9 additions & 1 deletion compat/mtg.lua
Original file line number Diff line number Diff line change
@@ -1,4 +1,12 @@
local S = minetest.get_translator(minetest.get_current_modname())
local S

if minetest.get_translator ~= nil then
S = minetest.get_translator(minetest.get_current_modname())
else
S = function(str)
return(str)
end
end

-- Armor
--
Expand Down

0 comments on commit fdef9c3

Please sign in to comment.