Add support for MT 5 game translation (rebasing ) (#2466)

rebased #2368
此提交包含在:
Yves Quemener
2019-09-11 02:09:51 +09:00
提交者 sfan5
父節點 d99a176b69
當前提交 bb9279ccb8
共有 43 個檔案被更改,包括 632 行新增433 行删除

查看文件

@ -1,6 +1,11 @@
-- sethome/init.lua
sethome = {}
-- Load support for MT game translation.
local S = minetest.get_translator("sethome")
local homes_file = minetest.get_worldpath() .. "/homes"
local homepos = {}
@ -68,30 +73,30 @@ sethome.go = function(name)
end
minetest.register_privilege("home", {
description = "Can use /sethome and /home",
description = S("Can use /sethome and /home"),
give_to_singleplayer = false
})
minetest.register_chatcommand("home", {
description = "Teleport you to your home point",
description = S("Teleport you to your home point"),
privs = {home = true},
func = function(name)
if sethome.go(name) then
return true, "Teleported to home!"
return true, S("Teleported to home!")
end
return false, "Set a home using /sethome"
return false, S("Set a home using /sethome")
end,
})
minetest.register_chatcommand("sethome", {
description = "Set your home point",
description = S("Set your home point"),
privs = {home = true},
func = function(name)
name = name or "" -- fallback to blank name if nil
local player = minetest.get_player_by_name(name)
if player and sethome.set(name, player:get_pos()) then
return true, "Home set!"
return true, S("Home set!")
end
return false, "Player not found!"
return false, S("Player not found!")
end,
})