Add Russian localization who (kto) for our russian friends
This commit is contained in:
@@ -110,6 +110,32 @@ shared.Commander = {
|
|||||||
end
|
end
|
||||||
return ret
|
return ret
|
||||||
end
|
end
|
||||||
|
-- This is really ugly, duplicating methods like this
|
||||||
|
-- But I have no better idea
|
||||||
|
-- We would have to drag reference channel all the way here
|
||||||
|
-- And then in here do some kind of deciding based on the fucking channel locale
|
||||||
|
-- That's also a nasty solution... I guess adding "kto" is better
|
||||||
|
---@param arr table<string, Player>
|
||||||
|
---@return string[]
|
||||||
|
local function WhoRu(arr)
|
||||||
|
local ret = {}
|
||||||
|
for _, player in pairs(arr) do
|
||||||
|
if shared.Whoer.ShouldNotifyForZone(player.zone) then
|
||||||
|
shared.dump(player)
|
||||||
|
ret[#ret + 1] = string.format(
|
||||||
|
"%s/%s (%s) %s",
|
||||||
|
player.name,
|
||||||
|
shared._L(player.class, "ru"),
|
||||||
|
shared._L(player.zone, "ru"),
|
||||||
|
player.stinky and "(!!!!)" or ""
|
||||||
|
)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
if Heimdall_Data.config.commander.debug then
|
||||||
|
print(string.format("[%s] Command result: %s", ModuleName, strjoin(", ", unpack(ret))))
|
||||||
|
end
|
||||||
|
return ret
|
||||||
|
end
|
||||||
---@param arr table<string, Player>
|
---@param arr table<string, Player>
|
||||||
---@return string[]
|
---@return string[]
|
||||||
local function WhoPartitioned(arr)
|
local function WhoPartitioned(arr)
|
||||||
@@ -123,6 +149,17 @@ shared.Commander = {
|
|||||||
end
|
end
|
||||||
---@param arr table<string, Player>
|
---@param arr table<string, Player>
|
||||||
---@return string[]
|
---@return string[]
|
||||||
|
local function WhoPartitionedRu(arr)
|
||||||
|
local who = WhoRu(arr)
|
||||||
|
local text = {}
|
||||||
|
---@diagnostic disable-next-line: param-type-mismatch something wrong with luals, it's picking up the "wrong" unpack
|
||||||
|
for _, line in pairs(Partition(strjoin(", ", unpack(who)), 200)) do
|
||||||
|
text[#text + 1] = "кто: " .. line
|
||||||
|
end
|
||||||
|
return text
|
||||||
|
end
|
||||||
|
---@param arr table<string, Player>
|
||||||
|
---@return string[]
|
||||||
local function CountClass(arr)
|
local function CountClass(arr)
|
||||||
local ret = {}
|
local ret = {}
|
||||||
for _, player in pairs(arr) do
|
for _, player in pairs(arr) do
|
||||||
@@ -167,6 +204,15 @@ shared.Commander = {
|
|||||||
if #res == 0 then return { "No stinkies found" } end
|
if #res == 0 then return { "No stinkies found" } end
|
||||||
return res
|
return res
|
||||||
end
|
end
|
||||||
|
local function WhoPartitionedStinkiesRu()
|
||||||
|
if Heimdall_Data.config.commander.debug then
|
||||||
|
print(string.format("[%s] Executing: WhoPartitionedStinkies", ModuleName))
|
||||||
|
shared.dump(HeimdallStinkies)
|
||||||
|
end
|
||||||
|
local res = WhoPartitionedRu(HeimdallStinkies)
|
||||||
|
if #res == 0 then return { "No stinkies found" } end
|
||||||
|
return res
|
||||||
|
end
|
||||||
local function CountPartitionedStinkies()
|
local function CountPartitionedStinkies()
|
||||||
if Heimdall_Data.config.commander.debug then
|
if Heimdall_Data.config.commander.debug then
|
||||||
print(string.format("[%s] Executing: CountPartitionedStinkies", ModuleName))
|
print(string.format("[%s] Executing: CountPartitionedStinkies", ModuleName))
|
||||||
@@ -288,6 +334,7 @@ shared.Commander = {
|
|||||||
|
|
||||||
local commands = {
|
local commands = {
|
||||||
{ keywordRe = "^who$", commanderOnly = false, callback = WhoPartitionedStinkies },
|
{ keywordRe = "^who$", commanderOnly = false, callback = WhoPartitionedStinkies },
|
||||||
|
{ keywordRe = "^кто$", commanderOnly = false, callback = WhoPartitionedStinkiesRu },
|
||||||
{ keywordRe = "^howmany$", commanderOnly = false, callback = CountPartitionedStinkies },
|
{ keywordRe = "^howmany$", commanderOnly = false, callback = CountPartitionedStinkies },
|
||||||
{ keywordRe = "^classes$", commanderOnly = false, callback = CountClassPartitionedStinkies },
|
{ keywordRe = "^classes$", commanderOnly = false, callback = CountClassPartitionedStinkies },
|
||||||
{ keywordRe = "^help$", commanderOnly = false, callback = HelpRu },
|
{ keywordRe = "^help$", commanderOnly = false, callback = HelpRu },
|
||||||
@@ -353,6 +400,7 @@ shared.Commander = {
|
|||||||
and (
|
and (
|
||||||
not command.commanderOnly
|
not command.commanderOnly
|
||||||
-- if Heimdall_Data.config.commander.debug then print(string.format("[%s] Ignoring command, sender %s not commander %s", ModuleName, sender, Heimdall_Data.config.commander.commander)) end
|
-- if Heimdall_Data.config.commander.debug then print(string.format("[%s] Ignoring command, sender %s not commander %s", ModuleName, sender, Heimdall_Data.config.commander.commander)) end
|
||||||
|
|
||||||
or (command.commanderOnly and sender == Heimdall_Data.config.commander.commander)
|
or (command.commanderOnly and sender == Heimdall_Data.config.commander.commander)
|
||||||
)
|
)
|
||||||
then
|
then
|
||||||
|
Reference in New Issue
Block a user