From bd8b1f57d30634b98dd58472781cb0abdd19bdce Mon Sep 17 00:00:00 2001 From: CiscOH Bellic Date: Sat, 27 Jul 2024 16:07:48 -0400 Subject: [PATCH] "Updated locale files and command registrations to use localized strings; modified environment detection logic to include retail build." --- scripts/Locales/enUS/enUS.lua | 20 ++++++++++++++++++- src/Environment/Environment.lua | 2 +- src/_bastion.lua | 34 ++++++++++++++++----------------- 3 files changed, 37 insertions(+), 19 deletions(-) diff --git a/scripts/Locales/enUS/enUS.lua b/scripts/Locales/enUS/enUS.lua index a153359..69921bd 100644 --- a/scripts/Locales/enUS/enUS.lua +++ b/scripts/Locales/enUS/enUS.lua @@ -2,6 +2,24 @@ local Tinkr, Bastion = ... local L = Bastion.Locale:NewLocale("Bastion", "enUS", true) -L["Tinkr"] = true +L["Available commands:"] = true +L["[MythicPlusUtils] Unknown command"] = true L["Bastion"] = true +L["Cast logging "] = true +L["Debuff logging "] = true +L["Debug mode disabled"] = true +L["Debug mode enabled"] = true +L["Disabled"] = true +L["Dump spells to a file"] = true +L["Enabled"] = true +L["Module not found"] = true +L["Tinkr"] = true +L["Toggle a module on/off"] = true +L["Toggle bastion on/off"] = true +L["Toggle debug mode on/off"] = true +L["Toggle m+ module on/off"] = true +L["Toggle trace mode on/off"] = true +L["Trace mode disabled"] = true +L["Trace mode enabled"] = true + diff --git a/src/Environment/Environment.lua b/src/Environment/Environment.lua index 532e0b8..7ea113d 100644 --- a/src/Environment/Environment.lua +++ b/src/Environment/Environment.lua @@ -23,7 +23,7 @@ local IsAddOnLoaded = IsAddOnLoaded or nil local buildNum = select(4, GetBuildInfo()) local buildName = "CLASSIC" -if buildNum > 110000 then +if buildNum >= 110000 then buildName = "RETAIL" elseif buildNum > 40000 then buildName = "CATA" diff --git a/src/_bastion.lua b/src/_bastion.lua index 675e78c..85db784 100644 --- a/src/_bastion.lua +++ b/src/_bastion.lua @@ -245,7 +245,7 @@ end local Command = Bastion.Command:New('bastion') -Command:Register('toggle', 'Toggle bastion on/off', function() +Command:Register('toggle', L["Toggle bastion on/off"], function() Bastion.Enabled = not Bastion.Enabled if Bastion.Enabled then Bastion:Print("Enabled") @@ -254,25 +254,25 @@ Command:Register('toggle', 'Toggle bastion on/off', function() end end) -Command:Register('debug', 'Toggle debug mode on/off', function() +Command:Register('debug', L["Toggle debug mode on/off"], function() Bastion.DebugMode = not Bastion.DebugMode if Bastion.DebugMode then - Bastion:Print("Debug mode enabled") + Bastion:Print(L["Debug mode enabled"]) else - Bastion:Print("Debug mode disabled") + Bastion:Print(L["Debug mode disabled"]) end end) -Command:Register('trace', 'Toggle trace mode on/off', function() +Command:Register('trace', L["Toggle trace mode on/off"], function() Bastion.TraceMode = not Bastion.TraceMode if Bastion.TraceMode then - Bastion:Print("Trace mode enabled") + Bastion:Print(L["Trace mode enabled"]) else - Bastion:Print("Trace mode disabled") + Bastion:Print(L["Trace mode disabled"]) end end) -Command:Register('dumpspells', 'Dump spells to a file', function() +Command:Register('dumpspells', L["Dump spells to a file"], function() local i = 1 local rand = math.random(100000, 999999) while true do @@ -295,36 +295,36 @@ Command:Register('dumpspells', 'Dump spells to a file', function() end end) -Command:Register('module', 'Toggle a module on/off', function(args) +Command:Register('module', L["Toggle a module on/off"], function(args) local module = Bastion:FindModule(args[2]) if module then module:Toggle() if module.enabled then - Bastion:Print("Enabled", module.name) + Bastion:Print(L["Enabled"], module.name) else - Bastion:Print("Disabled", module.name) + Bastion:Print(L["Disabled"], module.name) end else - Bastion:Print("Module not found") + Bastion:Print(L["Module not found"]) end end) -Command:Register('mplus', 'Toggle m+ module on/off', function(args) +Command:Register('mplus', L["Toggle m+ module on/off"], function(args) local cmd = args[2] if cmd == 'debuffs' then Bastion.MythicPlusUtils:ToggleDebuffLogging() - Bastion:Print("Debuff logging", Bastion.MythicPlusUtils.debuffLogging and "enabled" or "disabled") + Bastion:Print(L["Debuff logging "], Bastion.MythicPlusUtils.debuffLogging and L["Enabled"] or L["Disabled"]) return end if cmd == 'casts' then Bastion.MythicPlusUtils:ToggleCastLogging() - Bastion:Print("Cast logging", Bastion.MythicPlusUtils.castLogging and "enabled" or "disabled") + Bastion:Print(L["Cast logging "], Bastion.MythicPlusUtils.castLogging and L["Enabled"] or L["Disabled"]) return end - Bastion:Print("[MythicPlusUtils] Unknown command") - Bastion:Print("Available commands:") + Bastion:Print(L["[MythicPlusUtils] Unknown command"]) + Bastion:Print(L["Available commands:"] ) Bastion:Print("debuffs") Bastion:Print("casts") end)