diff --git a/Modules/CombatAlerter.lua b/Modules/CombatAlerter.lua index c5743a0..22e8adf 100644 --- a/Modules/CombatAlerter.lua +++ b/Modules/CombatAlerter.lua @@ -85,6 +85,14 @@ function shared.CombatAlerter.Init() print(string.format("[%s] Queuing alert message: '%s'", ModuleName, msg.message)) end table.insert(shared.messenger.queue, msg) + if not shared.L.ru.zones[zone] then + print(string.format("[%s] Zone %s not found in ru.zones", ModuleName, zone)) + end + zone = shared.L.ru.zones[zone] or zone + if not shared.L.ru.zones[subZone] then + print(string.format("[%s] Subzone %s not found in ru.zones", ModuleName, subZone)) + end + subZone = shared.L.ru.zones[subZone] or subZone ---@type Message msg = { diff --git a/Modules/DeathReporter.lua b/Modules/DeathReporter.lua index 39a5f8f..5b5bc97 100644 --- a/Modules/DeathReporter.lua +++ b/Modules/DeathReporter.lua @@ -95,7 +95,7 @@ function shared.DeathReporter.Init() local msg = { channel = "CHANNEL", data = Heimdall_Data.config.deathReporter.masterChannel, - message = string.format(shared.L.en.deathReporterDeath, + message = string.format(shared.L.en.killed, source, destination, spellName, @@ -107,16 +107,25 @@ function shared.DeathReporter.Init() print(string.format("[%s] Adding message to queue: %s", ModuleName, msg.message)) end table.insert(shared.messenger.queue, msg) + local zone, subZone = GetZoneText(), GetSubZoneText() + if not shared.L.ru.zones[zone] then + print(string.format("[%s] Zone %s not found in ru.zones", ModuleName, zone)) + end + zone = shared.L.ru.zones[zone] or zone + if not shared.L.ru.zones[subZone] then + print(string.format("[%s] Subzone %s not found in ru.zones", ModuleName, subZone)) + end + subZone = shared.L.ru.zones[subZone] or subZone ---@type Message msg = { channel = "CHANNEL", data = Heimdall_Data.config.deathReporter.masterChannel .. "ru", - message = string.format(shared.L.ru.deathReporterDeath, + message = string.format(shared.L.ru.killed, source, destination, spellName, - location, + string.format("%s (%s)", zone, subZone), tostring(GetCurrentMapAreaID()), x * 100, y * 100) } diff --git a/Modules/Spotter.lua b/Modules/Spotter.lua index 74c0c9f..c91dc54 100644 --- a/Modules/Spotter.lua +++ b/Modules/Spotter.lua @@ -157,14 +157,14 @@ function shared.Spotter.Init() SetMapToCurrentZone() SetMapByID(GetCurrentMapAreaID()) local text = string.format(shared.L.en.spotterSpotted, - hostile and "Hostile" or "Friendly", + hostile and shared.L.en.tidbits.hostile or shared.L.en.tidbits.friendly, name, class, stinky and string.format("(%s)", "!!!!") or "", race, faction, - FormatHP(hp), - FormatHP(maxHp), + string.gsub(FormatHP(hp), "M", "kk"), + string.gsub(FormatHP(maxHp), "M", "kk"), location, tostring(GetCurrentMapAreaID()), x * 100, y * 100) @@ -181,16 +181,38 @@ function shared.Spotter.Init() } table.insert(shared.messenger.queue, msg) + local ruClass = shared.L.ru.classes[class] + if not ruClass then + print(string.format("[%s] Class %s not found in ru.classes", ModuleName, class)) + end + local ruRace = shared.L.ru.races[race] + if not ruRace then + print(string.format("[%s] Race %s not found in ru.races", ModuleName, race)) + end + local ruFaction = shared.L.ru.factions[faction] + if not ruFaction then + print(string.format("[%s] Faction %s not found in ru.factions", ModuleName, faction)) + end + local zone, subzone = GetZoneText(), GetSubZoneText() + local ruZone = shared.L.ru.zones[zone] + if not ruZone then + print(string.format("[%s] Zone %s not found in ru.zones", ModuleName, zone)) + end + local ruSubzone = shared.L.ru.zones[subzone] + if not ruSubzone then + print(string.format("[%s] Subzone %s not found in ru.zones", ModuleName, subzone)) + end + text = string.format(shared.L.ru.spotterSpotted, - hostile and "Hostile" or "Friendly", + hostile and shared.L.ru.tidbits.hostile or shared.L.ru.tidbits.friendly, name, - class, + ruClass or class, stinky and string.format("(%s)", "!!!!") or "", - race, - faction, + ruRace or race, + ruFaction or faction, FormatHP(hp), FormatHP(maxHp), - location, + string.format("%s (%s)", ruZone or zone, ruSubzone or subzone), tostring(GetCurrentMapAreaID()), x * 100, y * 100) diff --git a/Modules/Whoer.lua b/Modules/Whoer.lua index 3aa65d7..b3ff579 100644 --- a/Modules/Whoer.lua +++ b/Modules/Whoer.lua @@ -73,12 +73,28 @@ function shared.Whoer.Init() end, ---@return string NotifyRu = function(self) + local ruClass = shared.L.ru.classes[self.class] + if not ruClass then + print(string.format("[%s] Class %s not found in ru.classes", ModuleName, self.class)) + end + + local ruRace = shared.L.ru.races[self.race] + if not ruRace then + print(string.format("[%s] Race %s not found in ru.races", ModuleName, self.race)) + end + + local faction = shared.raceMap[self.race] + local ruFaction = shared.L.ru.factions[faction] + if not ruFaction then + print(string.format("[%s] Faction %s not found in ru.factions", ModuleName, faction)) + end + local text = string.format(shared.L.ru.whoerNew, self.name, self.stinky and "(!!!!)" or "", - self.class, - self.race, - tostring(shared.raceMap[self.race]), + ruClass or self.class, + ruRace or self.race, + ruFaction or faction, self.guild, self.zone, self.firstSeen, diff --git a/_L.lua b/_L.lua index 37a72a1..4dad2b4 100644 --- a/_L.lua +++ b/_L.lua @@ -8,13 +8,72 @@ shared.L = { whoerNew = "%s %s of class %s, race %s (%s) and guild %s in %s, first seen: %s, last seen: %s, times seen: %d", whoerMoved = "%s of class %s (%s - %s) and guild %s moved to %s", whoerGone = "%s of class %s and guild %s left %s", + killed = "%s killed %s with %s in %s (%s) at [%s](%2.2f, %2.2f)", + tidbits = { + hostile = "hostile", + friendly = "friendly", + unknown = "unknown", + } }, ru = { combatAlerterInCombat = "Я в бою с %s на %s (%s) на [%s](%2.2f, %2.2f)", snifferStinky = "Я чувствую запах %s", spotterSpotted = "Я вижу (%s) %s/%s %s (%s) с %s/%s здоровьем на %s [%s](%2.2f, %2.2f)", - whoerNew = "%s %s класса %s, расы %s (%s) и гильдии %s в %s, первый раз видели: %s, последний раз видели: %s, раз видели: %d", + whoerNew = + "%s %s класса %s, расы %s (%s) и гильдии %s в %s, первый раз видели: %s, последний раз видели: %s, раз видели: %d", whoerMoved = "%s класса %s (%s - %s) и гильдии %s переместился в %s", whoerGone = "%s класса %s и гильдии %s покинул %s", + killed = "%s убил %s с %s в %s (%s) на [%s](%2.2f, %2.2f)", + -- A lot of this shit I get straight from the API in english (my locale) + -- So there is no need to translate it from english to english + tidbits = { + hostile = "враждебный", + friendly = "дружественный", + unknown = "неизвестный", + }, + zones = { + ["Orgrimmar"] = "Оргриммар", + ["Valley of Strength"] = "Долина Силы", + ["Valley of Trials"] = "Долина Испытаний", + ["Durotar"] = "Дуротар", + ["Echo Isles"] = "Острова Эхо", + }, + classes = { + ["Hunter"] = "Охотник", + ["Warrior"] = "Воин", + ["Mage"] = "Маг", + ["Priest"] = "Жрец", + ["Paladin"] = "Паладин", + ["Shaman"] = "Шаман", + ["Rogue"] = "Разбойник", + ["Warlock"] = "Чернокнижник", + ["Druid"] = "Друид", + ["Death Knight"] = "Рыцарь Смерти", + ["Monk"] = "Монах", + ["Demon Hunter"] = "Демон Хламер", + ["Evoker"] = "Эвокер", + }, + races = { + ["Human"] = "Человек", + ["Orc"] = "Орк", + ["Dwarf"] = "Дворф", + ["Night Elf"] = "Ночной Эльф", + ["Tauren"] = "Таурен", + ["Gnome"] = "Гном", + ["Troll"] = "Тролль", + ["Goblin"] = "Гоблин", + ["Blood Elf"] = "Кровавый Эльф", + ["Draenei"] = "Дреней", + ["Worgen"] = "Ворген", + ["Pandaren"] = "Пандарен", + ["Zandalari"] = "Зандалари", + ["Mechagnome"] = "Механом", + ["Vulpera"] = "Вульперы", + ["Undead"] = "Нежить", + }, + factions = { + ["Alliance"] = "Альянс", + ["Horde"] = "Орда", + }, }, }