diff --git a/ShaguTweaks-tbc.toc b/ShaguTweaks-tbc.toc index fbfe436..9995764 100644 --- a/ShaguTweaks-tbc.toc +++ b/ShaguTweaks-tbc.toc @@ -2,6 +2,7 @@ ## Title: |cffffcc00Shagu|cffffffffTweaks |cffff5555[BETA] ## Author: Shagu ## Notes: A collection of tweaks and enhancements to the Default UI +## Notes-ruRU: Коллекция настроек и улучшений для стандартного пользовательского интерфейса. ## Version: GIT ## SavedVariablesPerCharacter: ShaguTweaks_config, ShaguTweaks_cache @@ -13,6 +14,8 @@ locales\locales_frFR.lua locales\locales_koKR.lua locales\locales_ruRU.lua locales\locales_zhCN.lua +locales\translations_enUS.lua +locales\translations_ruRU.lua # basic main.lua diff --git a/ShaguTweaks.toc b/ShaguTweaks.toc index 66500e5..c4e1878 100644 --- a/ShaguTweaks.toc +++ b/ShaguTweaks.toc @@ -2,6 +2,7 @@ ## Title: |cffffcc00Shagu|cffffffffTweaks ## Author: Shagu ## Notes: A collection of tweaks and enhancements to the Default UI +## Notes-ruRU: Коллекция настроек и улучшений для стандартного пользовательского интерфейса. ## Version: GIT ## SavedVariablesPerCharacter: ShaguTweaks_config, ShaguTweaks_cache @@ -13,6 +14,8 @@ locales\locales_frFR.lua locales\locales_koKR.lua locales\locales_ruRU.lua locales\locales_zhCN.lua +locales\translations_enUS.lua +locales\translations_ruRU.lua # basic main.lua diff --git a/config.lua b/config.lua index 0550e83..2127022 100644 --- a/config.lua +++ b/config.lua @@ -1,4 +1,5 @@ local _G = ShaguTweaks.GetGlobalEnv() +local T = ShaguTweaks.T local GetExpansion = ShaguTweaks.GetExpansion local mod = math.mod or mod @@ -47,7 +48,7 @@ settings.title.tex:SetTexture("Interface\\DialogFrame\\UI-DialogBox-Header") settings.title.tex:SetAllPoints() settings.title.text = settings.title:CreateFontString(nil, "HIGH", "GameFontNormal") -settings.title.text:SetText("Advanced Options") +settings.title.text:SetText(T["Advanced Options"]) settings.title.text:SetPoint("TOP", 0, -14) settings.cancel = CreateFrame("Button", "AdvancedSettingsGUICancel", settings, "GameMenuButtonTemplate") @@ -102,7 +103,7 @@ settings.load = function(self) local gui = {} for title, module in pairs(ShaguTweaks.mods) do if module.expansions[expansion] then - local category = module.category or "General" + local category = module.category or T["General"] gui[category] = gui[category] or {} gui[category][title] = module end @@ -228,7 +229,7 @@ end local advanced = CreateFrame("Button", "GameMenuButtonAdvancedOptions", GameMenuFrame, "GameMenuButtonTemplate") advanced:SetPoint("TOP", GameMenuButtonUIOptions, "BOTTOM", 0, -1) -advanced:SetText("Advanced Options|cffffff00*") +advanced:SetText(T["Advanced Options"] .. "|cffffff00*") advanced:SetScript("OnClick", function() HideUIPanel(GameMenuFrame) settings:Show() diff --git a/locales/translations_enUS.lua b/locales/translations_enUS.lua new file mode 100644 index 0000000..27e07e3 --- /dev/null +++ b/locales/translations_enUS.lua @@ -0,0 +1,88 @@ +ShaguTweaks_translation = ShaguTweaks_translation or {} + +ShaguTweaks_translation["enUS"] = { + ["General"] = nil, + ["Tooltip & Items"] = nil, + ["World & MiniMap"] = nil, + ["Social & Chat"] = nil, + ["Unit Frames"] = nil, + ["Graphics"] = nil, + ["Action Bar"] = nil, + ["Advanced Options"] = nil, + ["Auto Dismount"] = nil, + ["Automatically dismounts whenever a spell is casted."] = nil, + ["Auto Stance"] = nil, + ["Automatically switch to the required warrior or druid stance on spell cast."] = nil, + ["Blue Shaman Class Colors"] = nil, + ["Changes the class color code of shamans to blue, as known from TBC+."] = nil, + ["Chat Hyperlinks"] = nil, + ["Copy website URLs from the chat, transforms CLINKs into real items and handles quest and player links."] = nil, + ["Chat Tweaks"] = nil, + ["Allows to scroll using the mouse wheel, enables sticky chat channels and repeats message on arrow up."] = nil, + ["Cooldown Numbers"] = nil, + ["Display the remaining duration as text on every cooldown."] = nil, + ["Darkened UI"] = nil, + ["Turns the entire interface into darker colors."] = nil, + ["Equip Compare"] = nil, + ["Shows currently equipped items on tooltips while the shift key is pressed."] = nil, + ["Unit Frame Health Colors"] = nil, + ["Change health text color based on its value."] = nil, + ["Real Health Numbers"] = nil, + ["Estimates health numbers, and shows numbers on player, pet and target unit frames."] = nil, + ["Hide Errors"] = nil, + ["Hides and ignores all Lua errors produced by broken addons."] = nil, + ["Hide Gryphons"] = nil, + ["Hides the gryphons left and right of the action bar."] = nil, + ["Item Rarity Borders"] = nil, + ["Show item rarity as the border color on bags, bank, character and inspect frames."] = nil, + ["MiniMap Clock"] = nil, + ["Adds a small 24h clock to the mini map."] = nil, + ["Clock"] = nil, + ["Localtime"] = nil, + ["Servertime"] = nil, + ["MiniMap Square"] = nil, + ["Draw the mini map in a squared shape instead of a round one."] = nil, + ["MiniMap Tweaks"] = nil, + ["Hides unnecessary mini map buttons and allows to zoom using the mouse wheel."] = nil, + ["Movable Unit Frames"] = nil, + ["Player and Target unit frames can be moved while and are pressed together."] = nil, + ["Nameplate Castbar"] = nil, + ["Adds a castbar to the nameplate based on combat log estimations."] = nil, + ["Nameplate Class Colors"] = nil, + ["Changes the nameplate health bar color to the class color."] = nil, + ["Nameplate Scale"] = nil, + ["Makes all nameplates honor the UI-Scale setting."] = nil, + ["Reduced Actionbar Size"] = nil, + ["Reduces the actionbar size by removing several items such as the bag panel and microbar"] = nil, + ["Sell Junk"] = nil, + ["Adds a “Sell Junk” button to every merchant window, that sells all grey items."] = nil, + ["Your vendor trash has been sold and you earned "] = nil, + ["Sell Grey Items"] = nil, + ["Social Colors"] = nil, + ["Show class colors in Who, Guild, Friends and Chat."] = nil, + ["Enemy Castbars"] = nil, + ["Shows an enemy castbar on target unit frame."] = nil, + ["Debuff Timer"] = nil, + ["Show debuff durations on the target unit frame."] = nil, + ["Tooltip Details"] = nil, + ["Display health, class color, guild name, guild rank and current target on unit tooltips."] = nil, + ["Turtle WoW Compatibility"] = nil, + ["Adds compatibility to Turtle WoW's custom changes."] = nil, + ["Unit Frame Big Health"] = nil, + ["Increases the healthbar of the player and target unitframe."] = nil, + ["Unit Frame Class Colors"] = nil, + ["Adds class colors to the player, target and party unit frames."] = nil, + ["Unit Frame Class Portraits"] = nil, + ["Replace unitframe portraits with class icons."] = nil, + ["Vendor Values"] = nil, + ["Shows the vendor sell values on all item tooltips."] = nil, + ["WorldMap Class Colors"] = nil, + ["Show class colored circles on world and battlefield map."] = nil, + ["WorldMap Coordinates"] = nil, + ["Adds coordinates to the bottom of the World Map."] = nil, + ['Player:'] = nil, + ['Cursor:'] = nil, + ['N/A'] = nil, + ["WorldMap Window"] = nil, + ["Turns the world map into a movable window. The map can be scaled with + Mousewheel."] = nil, +} diff --git a/locales/translations_ruRU.lua b/locales/translations_ruRU.lua new file mode 100644 index 0000000..cf42714 --- /dev/null +++ b/locales/translations_ruRU.lua @@ -0,0 +1,89 @@ +ShaguTweaks_translation = ShaguTweaks_translation or {} + +ShaguTweaks_translation["ruRU"] = { + ["General"] = "Общие", + ["Tooltip & Items"] = "Подсказки и предметы", + ["World & MiniMap"] = "Карта мира и мини-карта", + ["Social & Chat"] = "Общение и чат", + ["Unit Frames"] = "Окна юнитов", + ["Graphics"] = "Графика", + ["Action Bar"] = "Панель действий", + ["Advanced Options"] = "Расширенные настройки", + ["Auto Dismount"] = "Авто-спешивание", + ["Automatically dismounts whenever a spell is casted."] = "Автоматическое спешивание при каждом произнесении заклинания.", + ["Auto Stance"] = "Авто-стойка", + ["Automatically switch to the required warrior or druid stance on spell cast."] = "Автоматически переключаться на нужную стойку воина или друида при произнесении заклинания.", + ["Blue Shaman Class Colors"] = "Синий класс шамана", + ["Changes the class color code of shamans to blue, as known from TBC+."] = "Изменяет цветовой код класса шаманов на синий, как известно из TBC+.", + ["Chat Hyperlinks"] = "Гиперссылки чата", + ["Copy website URLs from the chat, transforms CLINKs into real items and handles quest and player links."] = "Копирование URL-адреса веб-сайтов из чата, преобразование CLINKов в реальные предметы и обрабатывание ссылок на квесты и игроков.", + ["Chat Tweaks"] = "Улучшения чата", + ["Allows to scroll using the mouse wheel, enables sticky chat channels and repeats message on arrow up."] = "Позволяет прокручивать колесо мыши, включает закрепленные каналы чата и повторяет сообщение при нажатии стрелки вверх.", + ["Cooldown Numbers"] = "Продолжительность перезарядки", + ["Display the remaining duration as text on every cooldown."] = "Отображать оставшуюся продолжительность в виде текста при перезарядке.", + ["Darkened UI"] = "Затемненный интерфейс", + ["Turns the entire interface into darker colors."] = "Меняет весь интерфейс в более темные цвета.", + ["Equip Compare"] = "Сравнение экипировки", + ["Shows currently equipped items on tooltips while the shift key is pressed."] = "Показывает экипированные в данный момент предметы во всплывающих подсказках, пока нажата клавиша Shift.", + ["Unit Frame Health Colors"] = "Цветное здоровье", + ["Change health text color based on its value."] = "Изменить цвет текста о состоянии здоровья в зависимости от его значения.", + ["Real Health Numbers"] = "Реальные цифры здоровья", + ["Estimates health numbers, and shows numbers on player, pet and target unit frames."] = "Оценивает количество здоровья и показывает цифры на окнах игрока, питомца и цели.", + ["Hide Errors"] = "Скрыть ошибки", + ["Hides and ignores all Lua errors produced by broken addons."] = "Скрывает и игнорирует все ошибки Lua, вызванные неработающими аддонами.", + ["Hide Gryphons"] = "Спрятать грифонов", + ["Hides the gryphons left and right of the action bar."] = "Скрывает грифонов слева и справа от панели действий.", + ["Item Rarity Borders"] = "Границы редкости предметов", + ["Show item rarity as the border color on bags, bank, character and inspect frames."] = "Показать редкость предмета в качестве цвета рамки на сумках, банке, окне персонажа и осмотра.", + ["MiniMap Clock"] = "Часы на мини-карте", + ["Adds a small 24h clock to the mini map."] = "Добавляет небольшие 24-часовые часы на мини-карту.", + ["Clock"] = "Часы", + ["Localtime"] = "Местное время", + ["Servertime"] = "Серверное время", + ["MiniMap Square"] = "Квадратная мини-карта", + ["Draw the mini map in a squared shape instead of a round one."] = "Мини-карта квадратной формы вместо круглой.", + ["MiniMap Tweaks"] = "Улучшения мини-карты", + ["Hides unnecessary mini map buttons and allows to zoom using the mouse wheel."] = "Скрывает ненужные кнопки мини-карты и позволяет масштабировать ее с помощью колеса мыши.", + ["Movable Unit Frames"] = "Передвижные окна", + ["Player and Target unit frames can be moved while and are pressed together."] = "Окна игрока и цели можно перемещать, удерживая клавиши и вместе.", + ["Nameplate Castbar"] = "Панель применения индикатора здоровья", + ["Adds a castbar to the nameplate based on combat log estimations."] = "Добавляет панель применения к индикатору здоровья на основе оценок журнала боя.", + ["Nameplate Class Colors"] = "Классы индикатора здоровья", + ["Changes the nameplate health bar color to the class color."] = "Изменяет цвет индикатора здоровья на цвет класса.", + ["Nameplate Scale"] = "Масштаб индикаторов здоровья", + ["Makes all nameplates honor the UI-Scale setting."] = "Все индикаторы здоровья будут соответствовать настройке UI-Scale.", + ["Reduced Actionbar Size"] = "Уменьшить панель действий", + ["Reduces the actionbar size by removing several items such as the bag panel and microbar"] = "Уменьшает размер панели действий за счет удаления нескольких элементов, таких как панель сумки и микропанель.", + ["Sell Junk"] = "Продать серые предметы", + ["Adds a “Sell Junk” button to every merchant window, that sells all grey items."] = "Добавляет кнопку «Продать серые предметы» в каждое окно торговца, в котором продаются все серые предметы.", + ["Your vendor trash has been sold and you earned "] = "Ваш хлам продан, и вы заработали ", + ["Sell Grey Items"] = "Продать серые предметы", + ["Social Colors"] = "Социальные цвета", + ["Show class colors in Who, Guild, Friends and Chat."] = "Показать цвета классов в разделах «Кто», «Гильдия», «Друзья» и «Чат».", + ["Enemy Castbars"] = "Панель применения противника", + ["Shows an enemy castbar on target unit frame."] = "Показать панель применения противника в окне юнита цели.", + ["Debuff Timer"] = "Таймер дебаффов", + ["Show debuff durations on the target unit frame."] = "Показать продолжительность дебаффов в окне цели.", + ["Tooltip Details"] = "Подробные подсказки", + ["Display health, class color, guild name, guild rank and current target on unit tooltips."] = "Отображение здоровья, цвета класса, названия гильдии, ранга гильдии и текущей цели во всплывающих подсказках юнитов.", + ["Turtle WoW Compatibility"] = "Совместимость с Turtle WoW", + ["Adds compatibility to Turtle WoW's custom changes."] = "Добавляет совместимость с пользовательскими изменениями Turtle WoW.", + ["Unit Frame Big Health"] = "Большое здоровье", + ["Increases the healthbar of the player and target unitframe."] = "Увеличивает полосу здоровья игрока и цели.", + ["Unit Frame Class Colors"] = "Цветные классы", + ["Adds class colors to the player, target and party unit frames."] = "Добавить цвета классов к окнам игрока, цели и отряда группы.", + ["Unit Frame Class Portraits"] = "Классовые портреты", + ["Replace unitframe portraits with class icons."] = "Заменить портреты окон юнитов значками классов.", + ["Vendor Values"] = "Стоимость продажи", + ["Shows the vendor sell values on all item tooltips."] = "Показывает стоимость продажи продавцу во всплывающих подсказках ко всем предметам.", + ["WorldMap Class Colors"] = "Классы на карте мира", + ["Show class colored circles on world and battlefield map."] = "Показать цветные круги классов на карте мира и поле боя.", + ["WorldMap Coordinates"] = "Координаты на карте мира", + ["Adds coordinates to the bottom of the World Map."] = "Добавляет координаты внизу карты мира.", + ['Player:'] = "Игрок:", + ['Cursor:'] = "Курсор:", + ['N/A'] = "Н/Д", + ["WorldMap Window"] = "Окно карты мира", + ["Turns the world map into a movable window. The map can be scaled with + Mousewheel."] = "Превращает карту мира в подвижное окно. Карту можно масштабировать с помощью + Колесо мыши.", +} + diff --git a/main.lua b/main.lua index 1d5c4ff..028af92 100644 --- a/main.lua +++ b/main.lua @@ -16,11 +16,21 @@ seterrorhandler(error) ShaguTweaks = CreateFrame("Frame") ShaguTweaks.mods = {} --- load translation tables -ShaguTweaks.L = (ShaguTweaks_locale[GetLocale()] or ShaguTweaks_locale["enUS"]) -ShaguTweaks:RegisterEvent("VARIABLES_LOADED") -ShaguTweaks:SetScript("OnEvent", function() - -- load current expansion + -- load translation tables + ShaguTweaks.L = (ShaguTweaks_locale[GetLocale()] or ShaguTweaks_locale["enUS"]) + ShaguTweaks.T = (ShaguTweaks_translation[GetLocale()] or ShaguTweaks_translation["enUS"]) + + -- use table index key as translation fallback + ShaguTweaks.T = setmetatable(ShaguTweaks.T, { __index = function(tab,key) + local value = tostring(key) + rawset(tab, key, value) + return value + end}) + + ShaguTweaks:RegisterEvent("VARIABLES_LOADED") + ShaguTweaks:SetScript("OnEvent", function() + + -- load current expansion local expansion = ShaguTweaks:GetExpansion() -- initialize empty config diff --git a/mods/auto-dismount.lua b/mods/auto-dismount.lua index b0d11f6..90f605e 100644 --- a/mods/auto-dismount.lua +++ b/mods/auto-dismount.lua @@ -1,8 +1,9 @@ local _G = ShaguTweaks.GetGlobalEnv() +local T = ShaguTweaks.T local module = ShaguTweaks:register({ - title = "Auto Dismount", - description = "Automatically dismounts whenever a spell is casted.", + title = T["Auto Dismount"], + description = T["Automatically dismounts whenever a spell is casted."], expansions = { ["vanilla"] = true, ["tbc"] = nil }, enabled = nil, }) diff --git a/mods/auto-stance.lua b/mods/auto-stance.lua index 5924efa..fc936b3 100644 --- a/mods/auto-stance.lua +++ b/mods/auto-stance.lua @@ -1,9 +1,10 @@ local _G = ShaguTweaks.GetGlobalEnv() +local T = ShaguTweaks.T local strsplit = ShaguTweaks.strsplit local module = ShaguTweaks:register({ - title = "Auto Stance", - description = "Automatically switch to the required warrior or druid stance on spell cast.", + title = T["Auto Stance"], + description = T["Automatically switch to the required warrior or druid stance on spell cast."], expansions = { ["vanilla"] = true, ["tbc"] = nil }, enabled = nil, }) diff --git a/mods/blue-shaman.lua b/mods/blue-shaman.lua index 2f9cbcd..33a502d 100644 --- a/mods/blue-shaman.lua +++ b/mods/blue-shaman.lua @@ -1,11 +1,12 @@ local _G = ShaguTweaks.GetGlobalEnv() +local T = ShaguTweaks.T local GetExpansion = ShaguTweaks.GetExpansion local module = ShaguTweaks:register({ - title = "Blue Shaman Class Colors", - description = "Changes the class color code of shamans to blue, as known from TBC+.", + title = T["Blue Shaman Class Colors"], + description = T["Changes the class color code of shamans to blue, as known from TBC+."], expansions = { ["vanilla"] = true, ["tbc"] = nil }, - category = "Social & Chat", + category = T["Social & Chat"], enabled = true, }) diff --git a/mods/chat-links.lua b/mods/chat-links.lua index be4fdcd..394902f 100644 --- a/mods/chat-links.lua +++ b/mods/chat-links.lua @@ -1,4 +1,5 @@ local _G = ShaguTweaks.GetGlobalEnv() +local T = ShaguTweaks.T local gfind = string.gmatch or string.gfind local GetUnitData = ShaguTweaks.GetUnitData local hooksecurefunc = ShaguTweaks.hooksecurefunc @@ -8,10 +9,10 @@ local rgbhex = ShaguTweaks.rgbhex local strsplit = ShaguTweaks.strsplit local module = ShaguTweaks:register({ - title = "Chat Hyperlinks", - description = "Copy website URLs from the chat, transforms CLINKs into real items and handles quest and player links.", + title = T["Chat Hyperlinks"], + description = T["Copy website URLs from the chat, transforms CLINKs into real items and handles quest and player links."], expansions = { ["vanilla"] = true, ["tbc"] = true }, - category = "Social & Chat", + category = T["Social & Chat"], enabled = true, }) diff --git a/mods/chat-tweaks.lua b/mods/chat-tweaks.lua index d1e11e4..ec3ad0c 100644 --- a/mods/chat-tweaks.lua +++ b/mods/chat-tweaks.lua @@ -1,11 +1,12 @@ local _G = ShaguTweaks.GetGlobalEnv() +local T = ShaguTweaks.T local scrollspeed = 1 local module = ShaguTweaks:register({ - title = "Chat Tweaks", - description = "Allows to scroll using the mouse wheel, enables sticky chat channels and repeats message on arrow up.", + title = T["Chat Tweaks"], + description = T["Allows to scroll using the mouse wheel, enables sticky chat channels and repeats message on arrow up."], expansions = { ["vanilla"] = true, ["tbc"] = true }, - category = "Social & Chat", + category = T["Social & Chat"], enabled = true, }) diff --git a/mods/cooldown-numbers.lua b/mods/cooldown-numbers.lua index e893473..ac70bc4 100644 --- a/mods/cooldown-numbers.lua +++ b/mods/cooldown-numbers.lua @@ -1,12 +1,13 @@ local _G = ShaguTweaks.GetGlobalEnv() +local T = ShaguTweaks.T local hooksecurefunc = hooksecurefunc or ShaguTweaks.hooksecurefunc local GetExpansion = ShaguTweaks.GetExpansion local AddBorder = ShaguTweaks.AddBorder local TimeConvert = ShaguTweaks.TimeConvert local module = ShaguTweaks:register({ - title = "Cooldown Numbers", - description = "Display the remaining duration as text on every cooldown.", + title = T["Cooldown Numbers"], + description = T["Display the remaining duration as text on every cooldown."], expansions = { ["vanilla"] = true, ["tbc"] = true }, enabled = nil, color = { r = .3, g = .3, b = .3, a = .9} diff --git a/mods/dark-ui-elements.lua b/mods/dark-ui-elements.lua index c33842b..0847b2b 100644 --- a/mods/dark-ui-elements.lua +++ b/mods/dark-ui-elements.lua @@ -1,11 +1,12 @@ local _G = ShaguTweaks.GetGlobalEnv() +local T = ShaguTweaks.T local HookAddonOrVariable = ShaguTweaks.HookAddonOrVariable local GetExpansion = ShaguTweaks.GetExpansion local AddBorder = ShaguTweaks.AddBorder local module = ShaguTweaks:register({ - title = "Darkened UI", - description = "Turns the entire interface into darker colors.", + title = T["Darkened UI"], + description = T["Turns the entire interface into darker colors."], expansions = { ["vanilla"] = true, ["tbc"] = true }, enabled = nil, color = { r = .3, g = .3, b = .3, a = .9} diff --git a/mods/equip-compare.lua b/mods/equip-compare.lua index 6a591f6..97d0317 100644 --- a/mods/equip-compare.lua +++ b/mods/equip-compare.lua @@ -1,10 +1,11 @@ local _G = ShaguTweaks.GetGlobalEnv() +local T = ShaguTweaks.T local module = ShaguTweaks:register({ - title = "Equip Compare", - description = "Shows currently equipped items on tooltips while the shift key is pressed.", + title = T["Equip Compare"], + description = T["Shows currently equipped items on tooltips while the shift key is pressed."], expansions = { ["vanilla"] = true, ["tbc"] = nil }, - category = "Tooltip & Items", + category = T["Tooltip & Items"], enabled = true, }) diff --git a/mods/health-color.lua b/mods/health-color.lua index 322b6b8..f037704 100644 --- a/mods/health-color.lua +++ b/mods/health-color.lua @@ -1,13 +1,14 @@ local _G = ShaguTweaks.GetGlobalEnv() +local T = ShaguTweaks.T local Abbreviate = ShaguTweaks.Abbreviate local GetColorGradient = ShaguTweaks.GetColorGradient local vanilla = ShaguTweaks.GetExpansion() == "vanilla" or nil local module = ShaguTweaks:register({ - title = "Unit Frame Health Colors", - description = "Change health text color based on its value.", + title = T["Unit Frame Health Colors"], + description = T["Change health text color based on its value."], expansions = { ["vanilla"] = true, ["tbc"] = true }, - category = "Unit Frames", + category = T["Unit Frames"], enabled = nil, }) diff --git a/mods/health-numbers.lua b/mods/health-numbers.lua index 1649a55..e2939d8 100644 --- a/mods/health-numbers.lua +++ b/mods/health-numbers.lua @@ -1,13 +1,14 @@ local _G = ShaguTweaks.GetGlobalEnv() +local T = ShaguTweaks.T local Abbreviate = ShaguTweaks.Abbreviate local GetColorGradient = ShaguTweaks.GetColorGradient local vanilla = ShaguTweaks.GetExpansion() == "vanilla" or nil local module = ShaguTweaks:register({ - title = "Real Health Numbers", - description = "Estimates health numbers, and shows numbers on player, pet and target unit frames.", + title = T["Real Health Numbers"], + description = T["Estimates health numbers, and shows numbers on player, pet and target unit frames."], expansions = { ["vanilla"] = true, ["tbc"] = true }, - category = "Unit Frames", + category = T["Unit Frames"], enabled = true, }) diff --git a/mods/hide-errors.lua b/mods/hide-errors.lua index 5705e5e..4cae120 100644 --- a/mods/hide-errors.lua +++ b/mods/hide-errors.lua @@ -1,8 +1,9 @@ local _G = ShaguTweaks.GetGlobalEnv() +local T = ShaguTweaks.T local module = ShaguTweaks:register({ - title = "Hide Errors", - description = "Hides and ignores all Lua errors produced by broken addons.", + title = T["Hide Errors"], + description = T["Hides and ignores all Lua errors produced by broken addons."], expansions = { ["vanilla"] = true, ["tbc"] = true }, enabled = nil, }) diff --git a/mods/hide-gryphons.lua b/mods/hide-gryphons.lua index dc7bb3b..cc55e01 100644 --- a/mods/hide-gryphons.lua +++ b/mods/hide-gryphons.lua @@ -1,8 +1,9 @@ local _G = ShaguTweaks.GetGlobalEnv() +local T = ShaguTweaks.T local module = ShaguTweaks:register({ - title = "Hide Gryphons", - description = "Hides the gryphons left and right of the action bar.", + title = T["Hide Gryphons"], + description = T["Hides the gryphons left and right of the action bar."], expansions = { ["vanilla"] = true, ["tbc"] = true }, enabled = nil, }) diff --git a/mods/item-colors.lua b/mods/item-colors.lua index 14cd412..25f9c90 100644 --- a/mods/item-colors.lua +++ b/mods/item-colors.lua @@ -1,13 +1,14 @@ local _G = ShaguTweaks.GetGlobalEnv() +local T = ShaguTweaks.T local GetExpansion = ShaguTweaks.GetExpansion local AddBorder = ShaguTweaks.AddBorder local HookAddonOrVariable = ShaguTweaks.HookAddonOrVariable local module = ShaguTweaks:register({ - title = "Item Rarity Borders", - description = "Show item rarity as the border color on bags, bank, character and inspect frames.", + title = T["Item Rarity Borders"], + description = T["Show item rarity as the border color on bags, bank, character and inspect frames."], expansions = { ["vanilla"] = true, ["tbc"] = true }, - category = "Tooltip & Items", + category = T["Tooltip & Items"], enabled = true, }) diff --git a/mods/minimap-clock.lua b/mods/minimap-clock.lua index 167a116..ed6cbd8 100644 --- a/mods/minimap-clock.lua +++ b/mods/minimap-clock.lua @@ -1,10 +1,11 @@ local _G = ShaguTweaks.GetGlobalEnv() +local T = ShaguTweaks.T local module = ShaguTweaks:register({ - title = "MiniMap Clock", - description = "Adds a small 24h clock to the mini map.", + title = T["MiniMap Clock"], + description = T["Adds a small 24h clock to the mini map."], expansions = { ["vanilla"] = true, ["tbc"] = nil }, - category = "World & MiniMap", + category = T["World & MiniMap"], enabled = nil, }) @@ -43,9 +44,9 @@ module.enable = function(self) GameTooltip:ClearLines() GameTooltip:SetOwner(this, ANCHOR_BOTTOMLEFT) - GameTooltip:AddLine("Clock") - GameTooltip:AddDoubleLine("Localtime", time, 1,1,1,1,1,1) - GameTooltip:AddDoubleLine("Servertime", servertime, 1,1,1,1,1,1) + GameTooltip:AddLine(T["Clock"]) + GameTooltip:AddDoubleLine(T["Localtime"], time, 1,1,1,1,1,1) + GameTooltip:AddDoubleLine(T["Servertime"], servertime, 1,1,1,1,1,1) GameTooltip:Show() end) diff --git a/mods/minimap-square.lua b/mods/minimap-square.lua index c13f5de..5c921e2 100644 --- a/mods/minimap-square.lua +++ b/mods/minimap-square.lua @@ -1,10 +1,11 @@ local _G = ShaguTweaks.GetGlobalEnv() +local T = ShaguTweaks.T local module = ShaguTweaks:register({ - title = "MiniMap Square", - description = "Draw the mini map in a squared shape instead of a round one.", + title = T["MiniMap Square"], + description = T["Draw the mini map in a squared shape instead of a round one."], expansions = { ["vanilla"] = true, ["tbc"] = true }, - category = "World & MiniMap", + category = T["World & MiniMap"], enabled = nil, }) diff --git a/mods/minimap-tweaks.lua b/mods/minimap-tweaks.lua index c3ecd7f..b40a218 100644 --- a/mods/minimap-tweaks.lua +++ b/mods/minimap-tweaks.lua @@ -1,10 +1,11 @@ local _G = ShaguTweaks.GetGlobalEnv() +local T = ShaguTweaks.T local module = ShaguTweaks:register({ - title = "MiniMap Tweaks", - description = "Hides unnecessary mini map buttons and allows to zoom using the mouse wheel.", + title = T["MiniMap Tweaks"], + description = T["Hides unnecessary mini map buttons and allows to zoom using the mouse wheel."], expansions = { ["vanilla"] = true, ["tbc"] = true }, - category = "World & MiniMap", + category = T["World & MiniMap"], enabled = nil, }) diff --git a/mods/move-unitframes.lua b/mods/move-unitframes.lua index 4d60fed..08650e8 100644 --- a/mods/move-unitframes.lua +++ b/mods/move-unitframes.lua @@ -1,10 +1,11 @@ local _G = ShaguTweaks.GetGlobalEnv() +local T = ShaguTweaks.T local module = ShaguTweaks:register({ - title = "Movable Unit Frames", - description = "Player and Target unit frames can be moved while and are pressed together.", + title = T["Movable Unit Frames"], + description = T["Player and Target unit frames can be moved while and are pressed together."], expansions = { ["vanilla"] = true, ["tbc"] = true }, - category = "Unit Frames", + category = T["Unit Frames"], enabled = nil, }) diff --git a/mods/nameplate-castbar.lua b/mods/nameplate-castbar.lua index ac4b670..7dd1474 100644 --- a/mods/nameplate-castbar.lua +++ b/mods/nameplate-castbar.lua @@ -1,10 +1,11 @@ local _G = ShaguTweaks.GetGlobalEnv() +local T = ShaguTweaks.T local UnitCastingInfo = ShaguTweaks.UnitCastingInfo local UnitChannelInfo = ShaguTweaks.UnitChannelInfo local module = ShaguTweaks:register({ - title = "Nameplate Castbar", - description = "Adds a castbar to the nameplate based on combat log estimations.", + title = T["Nameplate Castbar"], + description = T["Adds a castbar to the nameplate based on combat log estimations."], expansions = { ["vanilla"] = true, ["tbc"] = false }, enabled = nil, }) diff --git a/mods/nameplate-classcolor.lua b/mods/nameplate-classcolor.lua index 83859ce..7421b2c 100644 --- a/mods/nameplate-classcolor.lua +++ b/mods/nameplate-classcolor.lua @@ -1,9 +1,10 @@ local _G = ShaguTweaks.GetGlobalEnv() +local T = ShaguTweaks.T local GetUnitData = ShaguTweaks.GetUnitData local module = ShaguTweaks:register({ - title = "Nameplate Class Colors", - description = "Changes the nameplate health bar color to the class color.", + title = T["Nameplate Class Colors"], + description = T["Changes the nameplate health bar color to the class color."], expansions = { ["vanilla"] = true, ["tbc"] = true }, enabled = nil, }) diff --git a/mods/nameplate-scale.lua b/mods/nameplate-scale.lua index 73b0bac..6ca5c8b 100644 --- a/mods/nameplate-scale.lua +++ b/mods/nameplate-scale.lua @@ -1,8 +1,9 @@ local _G = ShaguTweaks.GetGlobalEnv() +local T = ShaguTweaks.T local module = ShaguTweaks:register({ - title = "Nameplate Scale", - description = "Makes all nameplates honor the UI-Scale setting.", + title = T["Nameplate Scale"], + description = T["Makes all nameplates honor the UI-Scale setting."], expansions = { ["vanilla"] = true, ["tbc"] = nil }, enabled = true, }) diff --git a/mods/reduced-actionbar.lua b/mods/reduced-actionbar.lua index 5e87868..7ab7cd7 100644 --- a/mods/reduced-actionbar.lua +++ b/mods/reduced-actionbar.lua @@ -1,8 +1,9 @@ local _G = ShaguTweaks.GetGlobalEnv() +local T = ShaguTweaks.T local module = ShaguTweaks:register({ - title = "Reduced Actionbar Size", - description = "Reduces the actionbar size by removing several items such as the bag panel and microbar", + title = T["Reduced Actionbar Size"], + description = T["Reduces the actionbar size by removing several items such as the bag panel and microbar"], expansions = { ["vanilla"] = true, ["tbc"] = nil }, categpry = nil, enabled = nil, diff --git a/mods/sell-junk.lua b/mods/sell-junk.lua index df8eeb1..6cf55a5 100644 --- a/mods/sell-junk.lua +++ b/mods/sell-junk.lua @@ -1,10 +1,11 @@ local _G = ShaguTweaks.GetGlobalEnv() +local T = ShaguTweaks.T local module = ShaguTweaks:register({ - title = "Sell Junk", - description = "Adds a “Sell Junk” button to every merchant window, that sells all grey items.", + title = T["Sell Junk"], + description = T["Adds a “Sell Junk” button to every merchant window, that sells all grey items."], expansions = { ["vanilla"] = true, ["tbc"] = true }, - category = "Tooltip & Items", + category = T["Tooltip & Items"], enabled = true, }) @@ -61,7 +62,7 @@ module.enable = function(self) autovendor:SetScript("OnHide", function() if this.count > 0 then - DEFAULT_CHAT_FRAME:AddMessage("Your vendor trash has been sold and you earned " .. CreateGoldString(this.price)) + DEFAULT_CHAT_FRAME:AddMessage(T["Your vendor trash has been sold and you earned "] .. CreateGoldString(this.price)) end end) @@ -131,7 +132,7 @@ module.enable = function(self) autovendor.button:SetNormalTexture("Interface\\Icons\\Spell_Shadow_SacrificialShield") autovendor.button:SetScript("OnEnter", function() GameTooltip:SetOwner(this, "ANCHOR_RIGHT") - GameTooltip:SetText("Sell Grey Items") + GameTooltip:SetText(T["Sell Grey Items"]) GameTooltip:Show() end) diff --git a/mods/social-colors.lua b/mods/social-colors.lua index 7ed4342..9d51c4c 100644 --- a/mods/social-colors.lua +++ b/mods/social-colors.lua @@ -1,5 +1,5 @@ local _G = ShaguTweaks.GetGlobalEnv() -local L = ShaguTweaks.L +local T = ShaguTweaks.T local gfind = string.gmatch or string.gfind local GetUnitData = ShaguTweaks.GetUnitData local hooksecurefunc = ShaguTweaks.hooksecurefunc @@ -10,10 +10,10 @@ local strsplit = ShaguTweaks.strsplit local friendinfo = gsub(gsub(FRIENDS_LEVEL_TEMPLATE,"%%s","%%s %%s"),"%%d","%%s") local module = ShaguTweaks:register({ - title = "Social Colors", - description = "Show class colors in Who, Guild, Friends and Chat.", + title = T["Social Colors"], + description = T["Show class colors in Who, Guild, Friends and Chat."], expansions = { ["vanilla"] = true, ["tbc"] = true }, - category = "Social & Chat", + category = T["Social & Chat"], enabled = nil, }) diff --git a/mods/target-castbar.lua b/mods/target-castbar.lua index bfe3be8..8601ba1 100644 --- a/mods/target-castbar.lua +++ b/mods/target-castbar.lua @@ -1,13 +1,14 @@ local _G = ShaguTweaks.GetGlobalEnv() +local T = ShaguTweaks.T local GetExpansion = ShaguTweaks.GetExpansion local UnitCastingInfo = ShaguTweaks.UnitCastingInfo local UnitChannelInfo = ShaguTweaks.UnitChannelInfo local module = ShaguTweaks:register({ - title = "Enemy Castbars", - description = "Shows an enemy castbar on target unit frame.", + title = T["Enemy Castbars"], + description = T["Shows an enemy castbar on target unit frame."], expansions = { ["vanilla"] = true, ["tbc"] = nil }, - category = "Unit Frames", + category = T["Unit Frames"], enabled = true, }) diff --git a/mods/target-debufftimer.lua b/mods/target-debufftimer.lua index 265faef..62de95d 100644 --- a/mods/target-debufftimer.lua +++ b/mods/target-debufftimer.lua @@ -1,10 +1,11 @@ local _G = ShaguTweaks.GetGlobalEnv() +local T = ShaguTweaks.T local module = ShaguTweaks:register({ - title = "Debuff Timer", - description = "Show debuff durations on the target unit frame.", + title = T["Debuff Timer"], + description = T["Show debuff durations on the target unit frame."], expansions = { ["vanilla"] = true, ["tbc"] = nil }, - category = "Unit Frames", + category = T["Unit Frames"], enabled = true, }) diff --git a/mods/tooltip-details.lua b/mods/tooltip-details.lua index 1a1726d..a087d70 100644 --- a/mods/tooltip-details.lua +++ b/mods/tooltip-details.lua @@ -1,13 +1,14 @@ local _G = ShaguTweaks.GetGlobalEnv() +local T = ShaguTweaks.T local round = ShaguTweaks.round local rgbhex = ShaguTweaks.rgbhex local Abbreviate = ShaguTweaks.Abbreviate local module = ShaguTweaks:register({ - title = "Tooltip Details", - description = "Display health, class color, guild name, guild rank and current target on unit tooltips.", + title = T["Tooltip Details"], + description = T["Display health, class color, guild name, guild rank and current target on unit tooltips."], expansions = { ["vanilla"] = true, ["tbc"] = true }, - category = "Tooltip & Items", + category = T["Tooltip & Items"], enabled = nil, }) diff --git a/mods/turtle-wow.lua b/mods/turtle-wow.lua index 7b453e8..3040ccb 100644 --- a/mods/turtle-wow.lua +++ b/mods/turtle-wow.lua @@ -8,18 +8,20 @@ -- Skip module initialization on every other client than TurtleWoW. if not TargetHPText or not TargetHPPercText then return end +local T = ShaguTweaks.T local selldata + local module = ShaguTweaks:register({ - title = "Turtle WoW Compatibility", - description = "Adds compatibility to Turtle WoW's custom changes", + title = T["Turtle WoW Compatibility"], + description = T["Adds compatibility to Turtle WoW's custom changes."], expansions = { ["vanilla"] = true, ["tbc"] = false }, - category = "General", + category = T["General"], enabled = true, }) module.enable = function(self) -- hide turtle-wow's target status texts - if ShaguTweaks_config["Real Health Numbers"] == 1 then + if ShaguTweaks_config(T["Real Health Numbers"]) == 1 then TargetHPText:Hide() TargetHPText.Show = function() return end @@ -34,7 +36,7 @@ module.enable = function(self) HookWorldMapFrame_Maximize() -- re-apply worldmap window - if ShaguTweaks_config["WorldMap Window"] == 1 then + if ShaguTweaks_config(T["WorldMap Window"]) == 1 then WorldMapFrame:SetMovable(true) WorldMapFrame:EnableMouse(true) diff --git a/mods/unitframes-bighealth.lua b/mods/unitframes-bighealth.lua index 47b5786..c5e8a97 100644 --- a/mods/unitframes-bighealth.lua +++ b/mods/unitframes-bighealth.lua @@ -1,10 +1,11 @@ local _G = ShaguTweaks.GetGlobalEnv() +local T = ShaguTweaks.T local module = ShaguTweaks:register({ - title = "Unit Frame Big Health", - description = "Increases the healthbar of the player and target unitframe.", + title = T["Unit Frame Big Health"], + description = T["Increases the healthbar of the player and target unitframe."], expansions = { ["vanilla"] = true, ["tbc"] = true }, - category = "Unit Frames", + category = T["Unit Frames"], enabled = nil, }) diff --git a/mods/unitframes-classcolor.lua b/mods/unitframes-classcolor.lua index dfc1537..f52402b 100644 --- a/mods/unitframes-classcolor.lua +++ b/mods/unitframes-classcolor.lua @@ -1,10 +1,11 @@ local _G = ShaguTweaks.GetGlobalEnv() +local T = ShaguTweaks.T local module = ShaguTweaks:register({ - title = "Unit Frame Class Colors", - description = "Adds class colors to the player, target and party unit frames.", + title = T["Unit Frame Class Colors"], + description = T["Adds class colors to the player, target and party unit frames."], expansions = { ["vanilla"] = true, ["tbc"] = true }, - category = "Unit Frames", + category = T["Unit Frames"], enabled = nil, }) diff --git a/mods/unitframes-classportrait.lua b/mods/unitframes-classportrait.lua index 4c30343..a7d802d 100644 --- a/mods/unitframes-classportrait.lua +++ b/mods/unitframes-classportrait.lua @@ -1,4 +1,5 @@ local _G = ShaguTweaks.GetGlobalEnv() +local T = ShaguTweaks.T local addonpath local tocs = { "", "-master", "-tbc", "-wotlk" } @@ -25,10 +26,10 @@ local CLASS_ICON_TCOORDS = { } local module = ShaguTweaks:register({ - title = "Unit Frame Class Portraits", - description = "Replace unitframe portraits with class icons.", + title = T["Unit Frame Class Portraits"], + description = T["Replace unitframe portraits with class icons."], expansions = { ["vanilla"] = true, ["tbc"] = true }, - category = "Unit Frames", + category = T["Unit Frames"], enabled = nil, }) diff --git a/mods/vendor-values.lua b/mods/vendor-values.lua index f8805a8..640722e 100644 --- a/mods/vendor-values.lua +++ b/mods/vendor-values.lua @@ -1,11 +1,12 @@ local _G = ShaguTweaks.GetGlobalEnv() +local T = ShaguTweaks.T local GetExpansion = ShaguTweaks.GetExpansion local module = ShaguTweaks:register({ - title = "Vendor Values", - description = "Shows the vendor sell values on all item tooltips.", + title = T["Vendor Values"], + description = T["Shows the vendor sell values on all item tooltips."], expansions = { ["vanilla"] = true, ["tbc"] = true }, - category = "Tooltip & Items", + category = T["Tooltip & Items"], enabled = true, }) diff --git a/mods/worldmap-colors.lua b/mods/worldmap-colors.lua index 68323ed..09208fc 100644 --- a/mods/worldmap-colors.lua +++ b/mods/worldmap-colors.lua @@ -1,10 +1,11 @@ local _G = ShaguTweaks.GetGlobalEnv() +local T = ShaguTweaks.T local module = ShaguTweaks:register({ - title = "WorldMap Class Colors", - description = "Show class colored circles on world and battlefield map.", + title = T["WorldMap Class Colors"], + description = T["Show class colored circles on world and battlefield map."], expansions = { ["vanilla"] = true, ["tbc"] = true }, - category = "World & MiniMap", + category = T["World & MiniMap"], enabled = true, }) diff --git a/mods/worldmap-coordinates.lua b/mods/worldmap-coordinates.lua index 36cbdbe..4cb8a9a 100644 --- a/mods/worldmap-coordinates.lua +++ b/mods/worldmap-coordinates.lua @@ -1,10 +1,11 @@ local _G = ShaguTweaks.GetGlobalEnv() +local T = ShaguTweaks.T local module = ShaguTweaks:register({ - title = "WorldMap Coordinates", - description = "Adds coordinates to the bottom of the World Map.", + title = T["WorldMap Coordinates"], + description = T["Adds coordinates to the bottom of the World Map."], expansions = { ["vanilla"] = true, ["tbc"] = true }, - category = "World & MiniMap", + category = T["World & MiniMap"], enabled = nil, }) @@ -49,15 +50,15 @@ module.enable = function(self) local px, py = GetPlayerMapPosition("player") if px > 0 and py > 0 then - WorldMapButton.player.text:SetText(string.format('|cffffcc00Player: |r%.1f / %.1f', px*100, py*100)) + WorldMapButton.player.text:SetText(string.format('|cffffcc00' .. T['Player:'] .. ' |r%.1f / %.1f', px*100, py*100)) else - WorldMapButton.player.text:SetText(string.format('|cffffcc00Player: |rN/A')) + WorldMapButton.player.text:SetText(string.format('|cffffcc00' .. T['Player:'] .. ' |r' .. T['N/A'])) end if MouseIsOver(WorldMapButton) then - WorldMapButton.coords.text:SetText(string.format('|cffffcc00Cursor: |r%.1f / %.1f', mx, my)) + WorldMapButton.coords.text:SetText(string.format('|cffffcc00' .. T['Cursor:'] .. ' |r%.1f / %.1f', mx, my)) else - WorldMapButton.coords.text:SetText(string.format('|cffffcc00Cursor: |rN/A')) + WorldMapButton.coords.text:SetText(string.format('|cffffcc00' .. T['Cursor:'] .. ' |r' .. T['N/A'])) end end) end diff --git a/mods/worldmap-window.lua b/mods/worldmap-window.lua index 6e757e2..1074de7 100644 --- a/mods/worldmap-window.lua +++ b/mods/worldmap-window.lua @@ -1,11 +1,12 @@ local _G = ShaguTweaks.GetGlobalEnv() +local T = ShaguTweaks.T local HookScript = ShaguTweaks.HookScript local module = ShaguTweaks:register({ - title = "WorldMap Window", - description = "Turns the world map into a movable window. The map can be scaled with + Mousewheel.", + title = T["WorldMap Window"], + description = T["Turns the world map into a movable window. The map can be scaled with + Mousewheel."], expansions = { ["vanilla"] = true, ["tbc"] = true }, - category = "World & MiniMap", + category = T["World & MiniMap"], enabled = true, })