1
0
mirror of https://github.com/minetest/minetest_game.git synced 2025-06-28 04:40:22 +02:00

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

rebased #2368
This commit is contained in:
Yves Quemener
2019-09-11 02:09:51 +09:00
committed by sfan5
parent d99a176b69
commit bb9279ccb8
43 changed files with 632 additions and 433 deletions

View File

@ -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,
})