From 320b9bee04a1efda423e813ca88237948b9ab058 Mon Sep 17 00:00:00 2001 From: Alexell Date: Mon, 31 Jan 2022 12:44:09 +0300 Subject: [PATCH] =?UTF-8?q?=D0=9B=D0=BE=D0=BA=D0=B0=D0=BB=D0=B8=D0=B7?= =?UTF-8?q?=D0=B0=D1=86=D0=B8=D1=8F=20=D0=BD=D0=BE=D0=B2=D1=8B=D1=85=20?= =?UTF-8?q?=D0=B2=D1=8B=D0=B2=D0=BE=D0=B4=D0=BE=D0=B2=20=D0=B2=20=D1=87?= =?UTF-8?q?=D0=B0=D1=82=20(=D1=87=D0=B0=D1=81=D1=82=D0=B8=D1=87=D0=BD?= =?UTF-8?q?=D0=BE)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lua/autorun/metrostroi_advanced_init.lua | 54 +++++++++++++----------- lua/metrostroi_advanced/language/en.lua | 14 ++++++ lua/metrostroi_advanced/language/ru.lua | 14 ++++++ 3 files changed, 57 insertions(+), 25 deletions(-) diff --git a/lua/autorun/metrostroi_advanced_init.lua b/lua/autorun/metrostroi_advanced_init.lua index d6a5445..3594e20 100644 --- a/lua/autorun/metrostroi_advanced_init.lua +++ b/lua/autorun/metrostroi_advanced_init.lua @@ -1,3 +1,4 @@ +return ------------------------ Metrostroi Advanced ------------------------- -- Developers: -- Alexell | https://steamcommunity.com/profiles/76561198210303223 @@ -47,6 +48,9 @@ function MetrostroiAdvanced.LoadLanguage(lang) end if SERVER then + local function lang(str) + return MetrostroiAdvanced.Lang[str] + end -- Список слов из точек телепорта для игнорирования запрета спавна на станциях function MetrostroiAdvanced.LoadStationsIgnore() if not file.Exists("metrostroi_advanced/stations_ignore.txt","DATA") then @@ -241,7 +245,7 @@ if SERVER then else ent_station = "N/A" end - if (ent_station=="") then ent_station = MetrostroiAdvanced.Lang["UnknownPlace"] end + if (ent_station=="") then ent_station = lang("UnknownPlace") end return ent_station end @@ -415,16 +419,16 @@ if SERVER then end if route_found and route_opened then timer.Simple(0.2, function() - ulx.fancyLog("#s opened emergency route #s.", ply:Nick(), Name:upper()) + ulx.fancyLog("#s "..lang("OpenedEmerRoute").." #s.", ply:Nick(), Name:upper()) end) elseif route_found and not route_opened then timer.Simple(0.2, function() - ply:ChatPrint("Emergency route "..Name:upper().." is already opened.") + ply:ChatPrint(lang("EmerRoute").." "..Name:upper().." "..lang("AlreadyOpened")..".") end) end if not route_found then timer.Simple(0.2, function() - ply:ChatPrint("Emergency route "..Name:upper().." not found.") + ply:ChatPrint(lang("EmerRoute").." "..Name:upper().." "..lang("NotFound")..".") end) end elseif comm == "!sdeactiv" then @@ -444,16 +448,16 @@ if SERVER then end if route_found and route_closed then timer.Simple(0.2, function() - ulx.fancyLog("#s closed emergency route #s.", ply:Nick(), Name:upper()) + ulx.fancyLog("#s "..lang("ClosedEmerRoute").." #s.", ply:Nick(), Name:upper()) end) elseif route_found and not route_closed then timer.Simple(0.2, function() - ply:ChatPrint("Emergency route "..Name:upper().." is already closed.") + ply:ChatPrint(lang("EmerRoute").." "..Name:upper().." "..lang("AlreadyClosed")..".") end) end if not route_found then timer.Simple(0.2, function() - ply:ChatPrint("Emergency route "..Name:upper().." not found.") + ply:ChatPrint(lang("EmerRoute").." "..Name:upper().." "..lang("NotFound")..".") end) end elseif comm == "!sclose" then @@ -500,25 +504,25 @@ if SERVER then end if signal_found and signal_closed then timer.Simple(0.2, function() - ulx.fancyLog("#s closed signal #s.", ply:Nick(), Name:upper()) + ulx.fancyLog("#s "..lang("ClosedSignal").." #s.", ply:Nick(), Name:upper()) end) elseif signal_found and not signal_closed then timer.Simple(0.2, function() - ply:ChatPrint("Signal "..Name:upper().." is already closed.") + ply:ChatPrint(lang("Signal").." "..Name:upper()..lang("AlreadyClosed")..".") end) end if route_found and route_closed then timer.Simple(0.2, function() - ulx.fancyLog("#s closed route #s.", ply:Nick(), Name:upper()) + ulx.fancyLog("#s "..lang("ClosedRoute").." #s.", ply:Nick(), Name:upper()) end) elseif route_found and not route_closed then timer.Simple(0.2, function() - ply:ChatPrint("Route "..Name:upper().." is already closed.") + ply:ChatPrint(lang("Route").." "..Name:upper()..lang("AlreadyClosed")..".") end) end if not route_found and not signal_found then timer.Simple(0.2, function() - ply:ChatPrint("Signal/Route "..Name:upper().." not found.") + ply:ChatPrint(lang("SignalOrRoute").." "..Name:upper()..lang("NotFound")..".") end) end elseif comm == "!sopen" then @@ -552,25 +556,25 @@ if SERVER then end if signal_found and signal_opened then timer.Simple(0.2, function() - ulx.fancyLog("#s opened signal #s.", ply:Nick(), Name:upper()) + ulx.fancyLog("#s "..lang("OpenedSignal").." #s.", ply:Nick(), Name:upper()) end) elseif signal_found and not signal_opened then timer.Simple(0.2, function() - ply:ChatPrint("Signal "..Name:upper().." is already opened.") + ply:ChatPrint(lang("Signal").." "..Name:upper().." "..lang("AlreadyOpened")..".") end) end if route_found and route_opened then timer.Simple(0.2, function() - ulx.fancyLog("#s opened route #s.", ply:Nick(), Name:upper()) + ulx.fancyLog("#s "..lang("OpenedRoute").." #s.", ply:Nick(), Name:upper()) end) elseif route_found and not route_opened then timer.Simple(0.2, function() - ply:ChatPrint("Route "..Name:upper().." is already opened.") + ply:ChatPrint(lang("Route").." "..Name:upper().." "..lang("AlreadyOpened")..".") end) end if not route_found and not signal_found then timer.Simple(0.2, function() - ply:ChatPrint("Signal/Route "..Name:upper().." not found.") + ply:ChatPrint(lang("SignalOrRoute").." "..Name:upper()..lang("NotFound")..".") end) end elseif comm == "!sopps" then @@ -587,11 +591,11 @@ if SERVER then end if signal_found and signal_opened then timer.Simple(0.2, function() - ulx.fancyLog("#s opened IS on signal #s.", ply:Nick(), Name:upper()) + ulx.fancyLog("#s "..lang("OpenedIS").." #s.", ply:Nick(), Name:upper()) end) elseif not signal_found then timer.Simple(0.2, function() - ply:ChatPrint("Signal "..Name:upper().." not found.") + ply:ChatPrint(lang("Signal").." "..Name:upper()..lang("NotFound")..".") end) end elseif comm == "!sclps" then @@ -608,11 +612,11 @@ if SERVER then end if signal_found and signal_closed then timer.Simple(0.2, function() - ulx.fancyLog("#s closed IS on signal #s.", ply:Nick(), Name:upper()) + ulx.fancyLog("#s "..lang("ClosedIS").." #s.", ply:Nick(), Name:upper()) end) elseif not signal_found then timer.Simple(0.2, function() - ply:ChatPrint("Signal "..Name:upper().." not found.") + ply:ChatPrint(lang("Signal").." "..Name:upper()..lang("NotFound")..".") end) end elseif Metrostroi.Version > 1537278077 then @@ -627,11 +631,11 @@ if SERVER then end if signal_found and ao_changed then timer.Simple(0.2, function() - ulx.fancyLog("#s enabled AO on signal #s.", ply:Nick(), Name:upper()) + ulx.fancyLog("#s "..lang("EnabledAS").." #s.", ply:Nick(), Name:upper()) end) elseif not signal_found then timer.Simple(0.2, function() - ply:ChatPrint("Signal "..Name:upper().." not found.") + ply:ChatPrint(lang("Signal").." "..Name:upper()..lang("NotFound")..".") end) end elseif comm == "!sdisao" then @@ -645,11 +649,11 @@ if SERVER then end if signal_found and ao_changed then timer.Simple(0.2, function() - ulx.fancyLog("#s disabled AO on signal #s.", ply:Nick(), Name:upper()) + ulx.fancyLog("#s "..lang("DisabledAS").." #s.", ply:Nick(), Name:upper()) end) elseif not signal_found then timer.Simple(0.2, function() - ply:ChatPrint("Signal "..Name:upper().." not found.") + ply:ChatPrint(lang("Signal").." "..Name:upper()..lang("NotFound")..".") end) end end diff --git a/lua/metrostroi_advanced/language/en.lua b/lua/metrostroi_advanced/language/en.lua index 7f1d7d9..9979795 100644 --- a/lua/metrostroi_advanced/language/en.lua +++ b/lua/metrostroi_advanced/language/en.lua @@ -61,6 +61,20 @@ MetrostroiAdvanced.Lang["Afkmins"] = "minute(s)" MetrostroiAdvanced.Lang["Afkmin1"] = "minute" MetrostroiAdvanced.Lang["AfkKick"] = "kicked for being AFK" MetrostroiAdvanced.Lang["PressedButton"] = "pressed button" +MetrostroiAdvanced.Lang["OpenedEmerRoute"] = "opened emergency route" +MetrostroiAdvanced.Lang["ClosedEmerRoute"] = "opened emergency route" +MetrostroiAdvanced.Lang["EmerRoute"] = "Emergency route" +MetrostroiAdvanced.Lang["AlreadyOpened"] = "is already opened" +MetrostroiAdvanced.Lang["AlreadyClosed"] = "is already closed" +MetrostroiAdvanced.Lang["SignalOrRoute"] = "Signal/Route" +MetrostroiAdvanced.Lang["ClosedSignal"] = "closed signal" +MetrostroiAdvanced.Lang["ClosedRoute"] = "closed route" +MetrostroiAdvanced.Lang["OpenedSignal"] = "opened signal" +MetrostroiAdvanced.Lang["OpenedRoute"] = "opened route" +MetrostroiAdvanced.Lang["OpenedIS"] = "opened IS on signal" +MetrostroiAdvanced.Lang["ClosedIS"] = "closed IS on signal" +MetrostroiAdvanced.Lang["EnabledAS"] = "enabled AS on signal" +MetrostroiAdvanced.Lang["DisabledAS"] = "disabled AO on signal" -- ULX MetrostroiAdvanced.Lang["Teleported"] = "teleported" diff --git a/lua/metrostroi_advanced/language/ru.lua b/lua/metrostroi_advanced/language/ru.lua index 0051209..2b094ac 100644 --- a/lua/metrostroi_advanced/language/ru.lua +++ b/lua/metrostroi_advanced/language/ru.lua @@ -62,6 +62,20 @@ MetrostroiAdvanced.Lang["Afkmins"] = "минут(ы)" MetrostroiAdvanced.Lang["Afkmin1"] = "минуту" MetrostroiAdvanced.Lang["AfkKick"] = "отключен за бездействие" MetrostroiAdvanced.Lang["PressedButton"] = "нажал кнопку" +MetrostroiAdvanced.Lang["OpenedEmerRoute"] = "opened emergency route" +MetrostroiAdvanced.Lang["ClosedEmerRoute"] = "closed emergency route" +MetrostroiAdvanced.Lang["EmerRoute"] = "Emergency route" +MetrostroiAdvanced.Lang["AlreadyOpened"] = "уже открыт" +MetrostroiAdvanced.Lang["AlreadyClosed"] = "уже закрыт" +MetrostroiAdvanced.Lang["SignalOrRoute"] = "Светофор/Маршрут" +MetrostroiAdvanced.Lang["ClosedSignal"] = "закрыл светофор" +MetrostroiAdvanced.Lang["ClosedRoute"] = "закрыл маршрут" +MetrostroiAdvanced.Lang["OpenedSignal"] = "открыл светофор" +MetrostroiAdvanced.Lang["OpenedRoute"] = "открыл маршрут" +MetrostroiAdvanced.Lang["OpenedIS"] = "открыл ПС на светофоре" +MetrostroiAdvanced.Lang["ClosedIS"] = "закрыл ПС на светофоре" +MetrostroiAdvanced.Lang["EnabledAS"] = "включил АО на светофоре" +MetrostroiAdvanced.Lang["DisabledAS"] = "выключил АО на светофоре" -- ULX MetrostroiAdvanced.Lang["Teleported"] = "телепортировался"