Localization
This commit is contained in:
parent
1237381c60
commit
12d361e670
51
init.lua
51
init.lua
|
@ -4,6 +4,7 @@ local include, nodecore, minetest
|
||||||
-- LUALOCALS > ---------------------------------------------------------
|
-- LUALOCALS > ---------------------------------------------------------
|
||||||
|
|
||||||
local modname = minetest.get_current_modname()
|
local modname = minetest.get_current_modname()
|
||||||
|
local S = minetest.get_translator(modname)
|
||||||
|
|
||||||
ctf = {}
|
ctf = {}
|
||||||
|
|
||||||
|
@ -44,13 +45,14 @@ function ctf.spawn(name,pos,call)
|
||||||
local n = math.random()
|
local n = math.random()
|
||||||
local pl = ctf.players[name]
|
local pl = ctf.players[name]
|
||||||
if pl.transid then
|
if pl.transid then
|
||||||
minetest.chat_send_player("<TELEPORT> Cancelling previous transportation")
|
minetest.chat_send_player(S"<TELEPORT> Cancelling previous transportation")
|
||||||
end
|
end
|
||||||
pl.transid = n
|
pl.transid = n
|
||||||
pos = {x=f(pos.x),y=f(pos.y),z=f(pos.z)}
|
pos = {x=f(pos.x),y=f(pos.y),z=f(pos.z)}
|
||||||
call = call or function()end
|
call = call or function()end
|
||||||
local limit = SPAWNFALL_LIMIT
|
local limit = SPAWNFALL_LIMIT
|
||||||
minetest.chat_send_player(name,"<TELEPORT> Configuring transportation processor...")
|
minetest.chat_send_player(name,S"<TELEPORT> Configuring transportation processor...")
|
||||||
|
--minetest.after(30,function()
|
||||||
minetest.emerge_area({x=pos.x,y=pos.y-limit,z=pos.z},{x=pos.x,y=pos.y+limit,z=pos.z},function(bp,act,crem)
|
minetest.emerge_area({x=pos.x,y=pos.y-limit,z=pos.z},{x=pos.x,y=pos.y+limit,z=pos.z},function(bp,act,crem)
|
||||||
if crem > 0 then return end
|
if crem > 0 then return end
|
||||||
pl = ctf.players[name]
|
pl = ctf.players[name]
|
||||||
|
@ -59,7 +61,7 @@ function ctf.spawn(name,pos,call)
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
pl.transid = nil
|
pl.transid = nil
|
||||||
minetest.chat_send_player(name,"<TELEPORT> Done. Sending transport coordinates...")
|
minetest.chat_send_player(name,S"<TELEPORT> Done. Sending transport coordinates...")
|
||||||
local off = 0
|
local off = 0
|
||||||
while off > -limit do
|
while off > -limit do
|
||||||
if minetest.get_node({x=pos.x,y=pos.y+off,z=pos.z}).name ~= "air" then
|
if minetest.get_node({x=pos.x,y=pos.y+off,z=pos.z}).name ~= "air" then
|
||||||
|
@ -81,6 +83,7 @@ function ctf.spawn(name,pos,call)
|
||||||
call(ref,apos)
|
call(ref,apos)
|
||||||
end
|
end
|
||||||
end)
|
end)
|
||||||
|
--end)
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
@ -105,11 +108,11 @@ minetest.register_chatcommand("vote",{
|
||||||
desc = "Vote to do things",
|
desc = "Vote to do things",
|
||||||
func = function(name,param)
|
func = function(name,param)
|
||||||
if ctf.ended then
|
if ctf.ended then
|
||||||
minetest.chat_send_player(name,"<DEMOCRACY> Nothing to vote for")
|
minetest.chat_send_player(name,S"<DEMOCRACY> Nothing to vote for")
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
if not ctf.started and ctf.player_count < 2 then
|
if not ctf.started and ctf.player_count < 2 then
|
||||||
minetest.chat_send_player(name,"<DEMOCRACY> Not enough players")
|
minetest.chat_send_player(name,S"<DEMOCRACY> Not enough players")
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
local pl = ctf.players[name]
|
local pl = ctf.players[name]
|
||||||
|
@ -117,15 +120,15 @@ minetest.register_chatcommand("vote",{
|
||||||
ctf.voted_count = pl.voted and (ctf.voted_count+1) or (ctf.voted_count-1)
|
ctf.voted_count = pl.voted and (ctf.voted_count+1) or (ctf.voted_count-1)
|
||||||
if ctf.started then
|
if ctf.started then
|
||||||
if pl.voted then
|
if pl.voted then
|
||||||
minetest.chat_send_player(name,"<DEMOCRACY> You vote to end the game")
|
minetest.chat_send_player(name,S"<DEMOCRACY> You vote to end the game")
|
||||||
else
|
else
|
||||||
minetest.chat_send_player(name,"<DEMOCRACY> You vote to NOT end the game")
|
minetest.chat_send_player(name,S"<DEMOCRACY> You vote to NOT end the game")
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
if pl.voted then
|
if pl.voted then
|
||||||
minetest.chat_send_player(name,"<DEMOCRACY> You vote to start the game")
|
minetest.chat_send_player(name,S"<DEMOCRACY> You vote to start the game")
|
||||||
else
|
else
|
||||||
minetest.chat_send_player(name,"<DEMOCRACY> You vote to NOT start the game")
|
minetest.chat_send_player(name,S"<DEMOCRACY> You vote to NOT start the game")
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
@ -204,7 +207,7 @@ function ctf.set_team_text(name)
|
||||||
assert(pl)
|
assert(pl)
|
||||||
local team = teams[pl.team]
|
local team = teams[pl.team]
|
||||||
print(pl.team,team)
|
print(pl.team,team)
|
||||||
ctf.set_text(name,"You're member of "..tostring(team.desc).." team\n/vote to end the game",team.colornum)
|
ctf.set_text(name,S("You're member of @1 team",tostring(team.desc)).."\n"..S"/vote to end the game",team.colornum)
|
||||||
end
|
end
|
||||||
|
|
||||||
function ctf.join(team,name)
|
function ctf.join(team,name)
|
||||||
|
@ -236,7 +239,7 @@ minetest.register_on_joinplayer(function(ref)
|
||||||
local name = ref:get_player_name()
|
local name = ref:get_player_name()
|
||||||
local id = ref:hud_add{
|
local id = ref:hud_add{
|
||||||
name = "stat",
|
name = "stat",
|
||||||
text = "Game is not started yet\n/vote to start the game",
|
text = S"The game hasn't started yet".."\n"..S"/vote to end the game",
|
||||||
number = 0xFFFFFF,
|
number = 0xFFFFFF,
|
||||||
alignment = {x=-1,y=1},
|
alignment = {x=-1,y=1},
|
||||||
offset = {x=-20,y=20},
|
offset = {x=-20,y=20},
|
||||||
|
@ -317,7 +320,7 @@ end
|
||||||
|
|
||||||
function ctf.start()
|
function ctf.start()
|
||||||
if ctf.starting and (ctf.voted_count/ctf.player_count) < 0.5 then
|
if ctf.starting and (ctf.voted_count/ctf.player_count) < 0.5 then
|
||||||
minetest.chat_send_all("<INFO + DEMOCRACY> Aborting")
|
minetest.chat_send_all(S"<INFO + DEMOCRACY> Aborting")
|
||||||
ctf.starting = -math.huge
|
ctf.starting = -math.huge
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
@ -325,7 +328,7 @@ function ctf.start()
|
||||||
local tc = math.max(2,math.floor(ctf.player_count/PLAYERS_PER_TEAM))
|
local tc = math.max(2,math.floor(ctf.player_count/PLAYERS_PER_TEAM))
|
||||||
if ctf.player_count >= 2 and not ctf.starting and (ctf.voted_count/ctf.player_count) >= 0.5 then
|
if ctf.player_count >= 2 and not ctf.starting and (ctf.voted_count/ctf.player_count) >= 0.5 then
|
||||||
ctf.starting = minetest.get_server_uptime()+10
|
ctf.starting = minetest.get_server_uptime()+10
|
||||||
minetest.chat_send_all("<INFO + DEMOCRACY> Most players are ready. Starting the game in 10...")
|
minetest.chat_send_all(S"<INFO + DEMOCRACY> Most players are ready. Starting the game in 10...")
|
||||||
do
|
do
|
||||||
local n = 10
|
local n = 10
|
||||||
local function f()
|
local function f()
|
||||||
|
@ -333,7 +336,7 @@ function ctf.start()
|
||||||
local n2=math.ceil(ctf.starting-minetest.get_server_uptime())
|
local n2=math.ceil(ctf.starting-minetest.get_server_uptime())
|
||||||
if n2 ~= n and n2 > 0 then
|
if n2 ~= n and n2 > 0 then
|
||||||
n=n2
|
n=n2
|
||||||
minetest.chat_send_all("<INFO> "..n.."...")
|
minetest.chat_send_all(S("<INFO> @1...",n))
|
||||||
end
|
end
|
||||||
if n2 > 0 then
|
if n2 > 0 then
|
||||||
minetest.after(0.2,f)
|
minetest.after(0.2,f)
|
||||||
|
@ -343,11 +346,11 @@ function ctf.start()
|
||||||
end
|
end
|
||||||
elseif ctf.starting and not (ctf.player_count >= 2) then
|
elseif ctf.starting and not (ctf.player_count >= 2) then
|
||||||
ctf.starting = false
|
ctf.starting = false
|
||||||
minetest.chat_send_all("<INFO> Not enough players now. Aborting.")
|
minetest.chat_send_all(S"<INFO> Not enough players now. Aborting.")
|
||||||
end
|
end
|
||||||
if ctf.starting and minetest.get_server_uptime() >= ctf.starting then
|
if ctf.starting and minetest.get_server_uptime() >= ctf.starting then
|
||||||
ctf.starting = math.huge
|
ctf.starting = math.huge
|
||||||
minetest.chat_send_all("<TELEPORT + INFO> CONFIGURING TRANSPORTATION PROCCESSORS FOR EVERYONE . . .")
|
minetest.chat_send_all(S"<TELEPORT + INFO> CONFIGURING TRANSPORTATION PROCCESSORS FOR EVERYONE . . .")
|
||||||
local c = 0
|
local c = 0
|
||||||
ctf.teams = {}
|
ctf.teams = {}
|
||||||
for k,v in pairs(teams) do
|
for k,v in pairs(teams) do
|
||||||
|
@ -370,11 +373,11 @@ function ctf.start()
|
||||||
pc = pc + 1
|
pc = pc + 1
|
||||||
if pc < ctf.player_count then return end
|
if pc < ctf.player_count then return end
|
||||||
if ctf.starting ~= math.huge then
|
if ctf.starting ~= math.huge then
|
||||||
minetest.chat_send_all("<TELEPORT + INFO> SOMETHING HAPPENED. ABORTING")
|
minetest.chat_send_all(S"<TELEPORT + INFO> SOMETHING HAPPENED. ABORTING")
|
||||||
ctf.teams = {}
|
ctf.teams = {}
|
||||||
for k,v in pairs(ctf.players) do
|
for k,v in pairs(ctf.players) do
|
||||||
v.team = nil
|
v.team = nil
|
||||||
ctf.set_text(k,"Game is not started yet\n/vote to start the game")
|
ctf.set_text(k,S"The game hasn't started yet".."\n"..S"/vote to end the game")
|
||||||
end
|
end
|
||||||
ctf.starting = false
|
ctf.starting = false
|
||||||
ctf.started = false
|
ctf.started = false
|
||||||
|
@ -389,7 +392,7 @@ function ctf.start()
|
||||||
ctf.voted_count = ctf.voted_count - 1
|
ctf.voted_count = ctf.voted_count - 1
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
minetest.chat_send_all("<INFO> The game begins!")
|
minetest.chat_send_all(S"<INFO> The game begins!")
|
||||||
for k,v in pairs(ctf.players) do
|
for k,v in pairs(ctf.players) do
|
||||||
ctf.explode_inv(minetest.get_player_by_name(k))
|
ctf.explode_inv(minetest.get_player_by_name(k))
|
||||||
end
|
end
|
||||||
|
@ -476,7 +479,7 @@ function ctf.check_win()
|
||||||
if team.score <= 0 then
|
if team.score <= 0 then
|
||||||
ctf.teams[name] = nil
|
ctf.teams[name] = nil
|
||||||
for pname,pl in pairs(team.players) do
|
for pname,pl in pairs(team.players) do
|
||||||
ctf.set_text(pname,":(\nYour team lost.",teams[name].colornum)
|
ctf.set_text(pname,S":(".."\n"..S"Your team lost.",teams[name].colornum)
|
||||||
end
|
end
|
||||||
minetest.chat_send_all("<INFO> "..teams[name].desc.." team lost!")
|
minetest.chat_send_all("<INFO> "..teams[name].desc.." team lost!")
|
||||||
end
|
end
|
||||||
|
@ -490,15 +493,15 @@ function ctf.check_win()
|
||||||
local name,team = next(ctf.teams)
|
local name,team = next(ctf.teams)
|
||||||
minetest.chat_send_all("<INFO> "..teams[name].desc.." team won!")
|
minetest.chat_send_all("<INFO> "..teams[name].desc.." team won!")
|
||||||
for pname,pl in pairs(team.players) do
|
for pname,pl in pairs(team.players) do
|
||||||
ctf.set_text(pname,":D\nYour team won!",teams[name].colornum)
|
ctf.set_text(pname,S":D".."\n"..S"Your team won!",teams[name].colornum)
|
||||||
end
|
end
|
||||||
elseif vout then
|
elseif vout then
|
||||||
minetest.chat_send_all("<INFO> Majority of players voted to end the game")
|
minetest.chat_send_all(S"<INFO> Majority of players voted to end the game")
|
||||||
for k,v in pairs(ctf.players) do
|
for k,v in pairs(ctf.players) do
|
||||||
ctf.set_text(k,"Game is not started yet\n/vote to start the game")
|
ctf.set_text(k,S"The game hasn't started yet".."\n"..S"/vote to end the game")
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
minetest.chat_send_all("<INFO> The game is finished")
|
minetest.chat_send_all(S"<INFO> The game is over")
|
||||||
ctf.teams = {}
|
ctf.teams = {}
|
||||||
do
|
do
|
||||||
local z = SPAWN_DIST
|
local z = SPAWN_DIST
|
||||||
|
|
|
@ -0,0 +1,27 @@
|
||||||
|
# textdomain: nc_ctf
|
||||||
|
<TELEPORT> Cancelling previous transportation=<TELEPORT> Cancelling previous transportation
|
||||||
|
<TELEPORT> Configuring transportation processor...=<TELEPORT> Configuring transportation processor...
|
||||||
|
<TELEPORT> Done. Sending transport coordinates...=<TELEPORT> Done. Sending transport coordinates...
|
||||||
|
Vote to do things=Vote to do things
|
||||||
|
<DEMOCRACY> Nothing to vote for=<DEMOCRACY> Nothing to vote for
|
||||||
|
<DEMOCRACY> Not enough players=<DEMOCRACY> Not enough players
|
||||||
|
<DEMOCRACY> You vote to end the game=<DEMOCRACY> You vote to end the game
|
||||||
|
<DEMOCRACY> You vote to NOT end the game=<DEMOCRACY> You vote to NOT end the game
|
||||||
|
<DEMOCRACY> You vote to start the game=<DEMOCRACY> You vote to start the game
|
||||||
|
<DEMOCRACY> You vote to NOT start the game=<DEMOCRACY> You vote to NOT start the game
|
||||||
|
You're member of @1 team=You're member of @1 team
|
||||||
|
/vote to end the game=/vote to end the game
|
||||||
|
The game hasn't started yet=The game hasn't started yet
|
||||||
|
<INFO + DEMOCRACY> Aborting=<INFO + DEMOCRACY> Aborting
|
||||||
|
<INFO + DEMOCRACY> Most players are ready. Starting the game in 10...=<INFO + DEMOCRACY> Most players are ready. Starting the game in 10...
|
||||||
|
<INFO> @1...=<INFO> @1...
|
||||||
|
<INFO> Not enough players now. Aborting.=<INFO> Not enough players now. Aborting.
|
||||||
|
<TELEPORT + INFO> CONFIGURING TRANSPORTATION PROCCESSORS FOR EVERYONE . . .=<TELEPORT + INFO> CONFIGURING TRANSPORTATION PROCCESSORS FOR EVERYONE . . .
|
||||||
|
<TELEPORT + INFO> SOMETHING HAPPENED. ABORTING=<TELEPORT + INFO> SOMETHING HAPPENED. ABORTING
|
||||||
|
<INFO> The game begins!=<INFO> The game begins!
|
||||||
|
:(=:(
|
||||||
|
:D=:D
|
||||||
|
Your team lost.=Your team lost.
|
||||||
|
Your team won!=Your team won!
|
||||||
|
<INFO> Majority of players voted to end the game=<INFO> Majority of players voted to end the game
|
||||||
|
<INFO> The game is over=<INFO> The game is over
|
|
@ -0,0 +1,27 @@
|
||||||
|
# textdomain: nc_ctf
|
||||||
|
<TELEPORT> Cancelling previous transportation=<TELEPORT> Отмена предыдущей телепортации
|
||||||
|
<TELEPORT> Configuring transportation processor...=<TELEPORT> Конфигурация транспортного процессора...
|
||||||
|
<TELEPORT> Done. Sending transport coordinates...=<TELEPORT> Готово. Отправка координат транспортации...
|
||||||
|
Vote to do things=Голосовать за всякие штуки
|
||||||
|
<DEMOCRACY> Nothing to vote for=<DEMOCRACY> Не за что голосовать
|
||||||
|
<DEMOCRACY> Not enough players=<DEMOCRACY> Недостаточно игроков
|
||||||
|
<DEMOCRACY> You vote to end the game=<DEMOCRACY> Вы голосуете за конец игры
|
||||||
|
<DEMOCRACY> You vote to NOT end the game=<DEMOCRACY> Вы голосуете против конца игры
|
||||||
|
<DEMOCRACY> You vote to start the game=<DEMOCRACY> Вы голосуете за начало игры
|
||||||
|
<DEMOCRACY> You vote to NOT start the game=<DEMOCRACY> Вы голосуете против начала игры
|
||||||
|
You're member of @1 team=Вы состоите в команде @1
|
||||||
|
/vote to end the game=/vote чтобы закончить игру
|
||||||
|
The game hasn't started yet=Игра еще не началась
|
||||||
|
<INFO + DEMOCRACY> Aborting=<INFO + DEMOCRACY> Отмена
|
||||||
|
<INFO + DEMOCRACY> Most players are ready. Starting the game in 10...=<INFO + DEMOCRACY> Многие игроки готовы. Начало игры через 10...
|
||||||
|
<INFO> @1...=<INFO> @1...
|
||||||
|
<INFO> Not enough players now. Aborting.=<INFO> Стало недостаточно игроков. Отмена.
|
||||||
|
<TELEPORT + INFO> CONFIGURING TRANSPORTATION PROCCESSORS FOR EVERYONE . . .=<TELEPORT + INFO> КОНФИГУРАЦИЯ ТРАНСПОРТНЫХ ПРОЦЕССОРОВ ДЛЯ ВСЕХ . . .
|
||||||
|
<TELEPORT + INFO> SOMETHING HAPPENED. ABORTING=<TELEPORT + INFO> ЧТО-ТО СЛУЧИЛОСЬ. ОТМЕНА
|
||||||
|
<INFO> The game begins!=<INFO> Игра начинается!
|
||||||
|
:(=:(
|
||||||
|
:D=:D
|
||||||
|
Your team lost.=Ваша команда проиграла.
|
||||||
|
Your team won!=Ваша команда выиграла!
|
||||||
|
<INFO> Majority of players voted to end the game=<INFO> Многие игроки проголосовали закончить эту игру
|
||||||
|
<INFO> The game is over=<INFO> Игра окончена
|
3
node.lua
3
node.lua
|
@ -84,6 +84,7 @@ minetest.register_node(modname..":telebarrier",{
|
||||||
light_source = 14,
|
light_source = 14,
|
||||||
paramtype = "light",
|
paramtype = "light",
|
||||||
drawtype="normal",
|
drawtype="normal",
|
||||||
|
pointable = false,
|
||||||
tiles = {
|
tiles = {
|
||||||
{name = "nc_ctf_telebarrier.png",
|
{name = "nc_ctf_telebarrier.png",
|
||||||
animation={
|
animation={
|
||||||
|
@ -101,6 +102,7 @@ minetest.register_node(modname..":telebarrier",{
|
||||||
minetest.register_node(modname..":barrier_hole",{
|
minetest.register_node(modname..":barrier_hole",{
|
||||||
drawtype="normal",
|
drawtype="normal",
|
||||||
use_texture_alpha=true,
|
use_texture_alpha=true,
|
||||||
|
pointable = false,
|
||||||
tiles = {"nc_ctf_barrier_hole.png"},
|
tiles = {"nc_ctf_barrier_hole.png"},
|
||||||
})
|
})
|
||||||
|
|
||||||
|
@ -108,6 +110,7 @@ minetest.register_node(modname..":barrier",{
|
||||||
light_source = 14,
|
light_source = 14,
|
||||||
paramtype = "light",
|
paramtype = "light",
|
||||||
drawtype="normal",
|
drawtype="normal",
|
||||||
|
pointable = false,
|
||||||
tiles = {
|
tiles = {
|
||||||
{name = "nc_ctf_barrier.png",
|
{name = "nc_ctf_barrier.png",
|
||||||
animation={
|
animation={
|
||||||
|
|
Binary file not shown.
Binary file not shown.
Loading…
Reference in New Issue