diff --git a/env/locales_deDE.lua b/env/locales_deDE.lua index 075f5476..358191ef 100644 --- a/env/locales_deDE.lua +++ b/env/locales_deDE.lua @@ -1,4 +1,6 @@ -pfLocaleClass["deDE"] = { +pfUI_locale["deDE"] = {} + +pfUI_locale["deDE"]["class"] = { ["Hexenmeister"] = "WARLOCK", ["Krieger"] = "WARRIOR", ["Jäger"] = "HUNTER", @@ -10,13 +12,13 @@ pfLocaleClass["deDE"] = { ["Schurke"] = "ROGUE", } -pfLocaleBagtypes["deDE"] = { +pfUI_locale["deDE"]["bagtypes"] = { ["Köcher"] = "QUIVER", ["Seelentasche"] = "SOULBAG", ["Behälter"] = "DEFAULT", } -pfLocaleInvtypes["deDE"] = { +pfUI_locale["deDE"]["itemtypes"] = { ["INVTYPE_WAND"] = "Zauberstab", ["INVTYPE_GUN"] = "Schusswaffe", ["INVTYPE_GUNPROJECTILE"] = "Projektil", @@ -25,7 +27,7 @@ pfLocaleInvtypes["deDE"] = { ["INVTYPE_THROWN"] = "Wurfwaffe", } -pfLocaleShift["deDE"] = { +pfUI_locale["deDE"]["stances"] = { ['BattleStance'] = "Kampfhaltung", ['DefensiveStance'] = "Verteidigungshaltung", ['BerserkerStance'] = "Berserkerhaltung", @@ -36,24 +38,24 @@ pfLocaleShift["deDE"] = { ['wantBattleBerserkStance'] = "Muss in Kampfhaltung, Berserkerhaltung sein.", } -pfLocaleSpellInterrupts["deDE"] = { +pfUI_locale["deDE"]["interrupts"] = { ["Schildhieb"] = true; ["Zuschlagen"] = true; ["Tritt"] = true; ["Erdschock"] = true; } -pfLocaleHunterbars["deDE"] = { +pfUI_locale["deDE"]["hunterpaging"] = { ["MELEE"] = "Zurechtstutzen", ["RANGED"] = "Arkaner Schuss", } -pfCustomCastbar["deDE"] = { +pfUI_locale["deDE"]["customcast"] = { ["AIMEDSHOT"] = "Gezielter Schuss", ["MULTISHOT"] = "Mehrfachschuss", } -pfLocaleSpells["deDE"] = { +pfUI_locale["deDE"]["spells"] = { ['Eisenherz nimmt wieder Huhngestalt an'] = {t=1000, icon="Ability_Racial_BearForm" }; ['Monstrositätenspucke'] = {t=2500, icon="Spell_Nature_CorrosiveBreath" }; ['Säure von Hakkar'] = {t=1000, icon="Spell_Nature_Acid_01" }; diff --git a/env/locales_enUS.lua b/env/locales_enUS.lua index a5c85d4c..3e94105b 100644 --- a/env/locales_enUS.lua +++ b/env/locales_enUS.lua @@ -1,4 +1,6 @@ -pfLocaleClass["enUS"] = { +pfUI_locale["enUS"] = {} + +pfUI_locale["enUS"]["class"] = { ["Warlock"] = "WARLOCK", ["Warrior"] = "WARRIOR", ["Hunter"] = "HUNTER", @@ -10,13 +12,13 @@ pfLocaleClass["enUS"] = { ["Rogue"] = "ROGUE", } -pfLocaleBagtypes["enUS"] = { +pfUI_locale["enUS"]["bagtypes"] = { ["Quiver"] = "QUIVER", ["Soul Bag"] = "SOULBAG", ["Bag"] = "DEFAULT" } -pfLocaleInvtypes["enUS"] = { +pfUI_locale["enUS"]["itemtypes"] = { ["INVTYPE_WAND"] = "Wand", ["INVTYPE_GUN"] = "Gun", ["INVTYPE_GUNPROJECTILE"] = "Projectile", @@ -25,7 +27,7 @@ pfLocaleInvtypes["enUS"] = { ["INVTYPE_THROWN"] = "Thrown", } -pfLocaleShift["enUS"] = { +pfUI_locale["enUS"]["stances"] = { ['BattleStance'] = "Battle Stance", ['DefensiveStance'] = "Defensive Stance", ['BerserkerStance'] = "Berserker Stance", @@ -36,24 +38,24 @@ pfLocaleShift["enUS"] = { ['wantBattleBerserkStance'] = "Must be in Battle Stance, Berserker Stance", } -pfLocaleSpellInterrupts["enUS"] = { +pfUI_locale["enUS"]["interrupts"] = { ["Shield Bash"] = true; ["Pummel"] = true; ["Kick"] = true; ["Earth Shock"] = true; } -pfLocaleHunterbars["enUS"] = { +pfUI_locale["enUS"]["hunterpaging"] = { ["MELEE"] = "Wing Clip", ["RANGED"] = "Arcane Shot", } -pfCustomCastbar["enUS"] = { +pfUI_locale["enUS"]["customcast"] = { ["AIMEDSHOT"] = "Aimed Shot", ["MULTISHOT"] = "Multi-Shot", } -pfLocaleSpells["enUS"] = { +pfUI_locale["enUS"]["spells"] = { ['"Plucky" Resumes Chicken Form'] = {t=1000, icon="Ability_Racial_BearForm" }; ['Abomination Spit'] = {t=2500, icon="Spell_Nature_CorrosiveBreath" }; ['Acid of Hakkar'] = {t=1000, icon="Spell_Nature_Acid_01" }; diff --git a/env/locales_frFR.lua b/env/locales_frFR.lua index 8a23869d..098b4a65 100644 --- a/env/locales_frFR.lua +++ b/env/locales_frFR.lua @@ -1,4 +1,6 @@ -pfLocaleClass["frFR"] = { +pfUI_locale["frFR"] = {} + +pfUI_locale["frFR"]["class"] = { ["D\195\169moniste"] = "WARLOCK", ["Guerrier"] = "WARRIOR", ["Chasseur"] = "HUNTER", @@ -10,13 +12,13 @@ pfLocaleClass["frFR"] = { ["Voleur"] = "ROGUE", } -pfLocaleBagtypes["frFR"] = { +pfUI_locale["frFR"]["bagtypes"] = { ["Carquois"] = "QUIVER", ["Sac d'\195\162me"] = "SOULBAG", ["Conteneur"] = "DEFAULT" } -pfLocaleInvtypes["frFR"] = { +pfUI_locale["frFR"]["itemtypes"] = { ["INVTYPE_WAND"] = "Baguette", ["INVTYPE_GUN"] = "Arme \195\160 feu", ["INVTYPE_GUNPROJECTILE"] = "Projectile", @@ -25,7 +27,7 @@ pfLocaleInvtypes["frFR"] = { ["INVTYPE_THROWN"] = "Arme de jet", } -pfLocaleShift["frFR"] = { +pfUI_locale["frFR"]["stances"] = { ['BattleStance'] = "Posture de combat", ['DefensiveStance'] = "Posture défensive", ['BerserkerStance'] = "Posture berserker", @@ -36,24 +38,24 @@ pfLocaleShift["frFR"] = { ['wantBattleBerserkStance'] = "Requiert Posture de combat, Posture berserker", } -pfLocaleSpellInterrupts["frFR"] = { +pfUI_locale["frFR"]["interrupts"] = { ["Coup de bouclier"] = true; ["Volée de coups"] = true; ["Coup de pied"] = true; ["Horion de terre"] = true; } -pfLocaleHunterbars["frFR"] = { +pfUI_locale["frFR"]["hunterpaging"] = { ["MELEE"] = "Coupure d'ailes", ["RANGED"] = "Tir des Arcanes", } -pfCustomCastbar["frFR"] = { +pfUI_locale["frFR"]["customcast"] = { ["AIMEDSHOT"] = "Visée", ["MULTISHOT"] = "Flèches multiples", } -pfLocaleSpells["frFR"] = { +pfUI_locale["frFR"]["spells"] = { ['Le Brave reprend sa forme de poulet'] = {t=1000, icon="Ability_Racial_BearForm" }; ['Crachat d\'abomination'] = {t=2500, icon="Spell_Nature_CorrosiveBreath" }; ['Acide d\'Hakkar'] = {t=1000, icon="Spell_Nature_Acid_01" }; diff --git a/env/locales_ruRU.lua b/env/locales_ruRU.lua index 5c81e06b..92b85c3d 100644 --- a/env/locales_ruRU.lua +++ b/env/locales_ruRU.lua @@ -1,4 +1,6 @@ -pfLocaleClass["ruRU"] = { +pfUI_locale["ruRU"] = {} + +pfUI_locale["ruRU"]["class"] = { ["Чернокнижник"] = "WARLOCK", ["Воин"] = "WARRIOR", ["Охотник"] = "HUNTER", @@ -10,13 +12,13 @@ pfLocaleClass["ruRU"] = { ["Разбойник"] = "ROGUE", } -pfLocaleBagtypes["ruRU"] = { +pfUI_locale["ruRU"]["bagtypes"] = { ["Амуниция"] = "QUIVER", ["Сумка душ"] = "SOULBAG", ["Сумка"] = "DEFAULT" } -pfLocaleInvtypes["ruRU"] = { +pfUI_locale["ruRU"]["itemtypes"] = { ["INVTYPE_WAND"] = "Жезл", ["INVTYPE_GUN"] = "Огнестрельное", ["INVTYPE_GUNPROJECTILE"] = "Пуля", @@ -25,7 +27,7 @@ pfLocaleInvtypes["ruRU"] = { ["INVTYPE_THROWN"] = "Метательное", } -pfLocaleShift["ruRU"] = { +pfUI_locale["ruRU"]["stances"] = { ['BattleStance'] = "Боевая стойка", ['DefensiveStance'] = "Оборонительная стойка", ['BerserkerStance'] = "Стойка берсерка", @@ -36,24 +38,24 @@ pfLocaleShift["ruRU"] = { ['wantBattleBerserkStance'] = "Необходимо находиться в Боевая стойка, Стойка берсерка.", } -pfLocaleSpellInterrupts["ruRU"] = { +pfUI_locale["ruRU"]["interrupts"] = { ["Удар щитом"] = true; ["Зуботычина"] = true; ["Пинок"] = true; ["Земной шок"] = true; } -pfLocaleHunterbars["ruRU"] = { +pfUI_locale["ruRU"]["hunterpaging"] = { ["MELEE"] = "Подрезать крылья", ["RANGED"] = "Чародейский выстрел", } -pfCustomCastbar["ruRU"] = { +pfUI_locale["ruRU"]["customcast"] = { ["AIMEDSHOT"] = "Прицельный выстрел", ["MULTISHOT"] = "Залп", } -pfLocaleSpells["ruRU"] = { +pfUI_locale["ruRU"]["spells"] = { ['"Отчаянный" снова принимает облик цыпленка"'] = {t=1000, icon="Ability_Racial_BearForm" }; ['Плевок мясника'] = {t=2500, icon="Spell_Nature_CorrosiveBreath" }; ['Кислота Хаккара'] = {t=1000, icon="Spell_Nature_Acid_01" }; diff --git a/env/locales_zhCN.lua b/env/locales_zhCN.lua index dafd9123..234c98df 100644 --- a/env/locales_zhCN.lua +++ b/env/locales_zhCN.lua @@ -1,4 +1,6 @@ -pfLocaleClass["zhCN"] = { +pfUI_locale["zhCN"] = {} + +pfUI_locale["zhCN"]["class"] = { ["术士"] = "WARLOCK", ["战士"] = "WARRIOR", ["猎人"] = "HUNTER", @@ -10,13 +12,13 @@ pfLocaleClass["zhCN"] = { ["盗贼"] = "ROGUE", } -pfLocaleBagtypes["zhCN"] = { +pfUI_locale["zhCN"]["bagtypes"] = { ["箭袋"] = "QUIVER", ["灵魂袋"] = "SOULBAG", ["包裹"] = "DEFAULT" } -pfLocaleInvtypes["zhCN"] = { +pfUI_locale["zhCN"]["itemtypes"] = { ["INVTYPE_WAND"] = "魔杖", ["INVTYPE_GUN"] = "枪械", ["INVTYPE_GUNPROJECTILE"] = "弹药", @@ -25,7 +27,7 @@ pfLocaleInvtypes["zhCN"] = { ["INVTYPE_THROWN"] = "投掷武器", } -pfLocaleShift["zhCN"] = { +pfUI_locale["zhCN"]["stances"] = { ['BattleStance'] = "战斗姿态", ['DefensiveStance'] = "防御姿态", ['BerserkerStance'] = "狂暴姿态", @@ -36,24 +38,24 @@ pfLocaleShift["zhCN"] = { ['wantBattleBerserkStance'] = "必须在战斗姿态, 狂暴姿态中", } -pfLocaleSpellInterrupts["zhCN"] = { +pfUI_locale["zhCN"]["interrupts"] = { ["盾击"] = true; ["拳击"] = true; ["脚踢"] = true; ["地震术"] = true; } -pfLocaleHunterbars["zhCN"] = { +pfUI_locale["zhCN"]["hunterpaging"] = { ["MELEE"] = "摔绊", ["RANGED"] = "奥术射击", } -pfCustomCastbar["zhCN"] = { +pfUI_locale["zhCN"]["customcast"] = { ["AIMEDSHOT"] = "瞄准射击", ["MULTISHOT"] = "多重射击", } -pfLocaleSpells["zhCN"] = { +pfUI_locale["zhCN"]["spells"] = { ['"Plucky" Resumes Chicken Form'] = {t=1000, icon="Ability_Racial_BearForm" }; ['憎恶喷吐'] = {t=2500, icon="Spell_Nature_CorrosiveBreath" }; ['哈卡酸液'] = {t=1000, icon="Spell_Nature_Acid_01" }; diff --git a/modules/autoshift.lua b/modules/autoshift.lua index e6d479e1..b1b04f73 100644 --- a/modules/autoshift.lua +++ b/modules/autoshift.lua @@ -6,46 +6,46 @@ pfUI:RegisterModule("autoshift", function () pfUI.autoshift.CastSpellByName = _G["CastSpellByName"] Hook("CastSpell", function(spellId, spellbookTabNum) - if pfUI.autoshift.lastError == pfLocaleShift[pfUI.cache["locale"]]['wantBattleStance'] then - pfUI.autoshift.CastSpellByName(pfLocaleShift[pfUI.cache["locale"]]['BattleStance']) - elseif pfUI.autoshift.lastError == pfLocaleShift[pfUI.cache["locale"]]['wantBattleDefStance'] then - pfUI.autoshift.CastSpellByName(pfLocaleShift[pfUI.cache["locale"]]['BattleStance']) - elseif pfUI.autoshift.lastError == pfLocaleShift[pfUI.cache["locale"]]['wantBattleBerserkStance'] then - pfUI.autoshift.CastSpellByName(pfLocaleShift[pfUI.cache["locale"]]['BerserkerStance']) - elseif pfUI.autoshift.lastError == pfLocaleShift[pfUI.cache["locale"]]['wantBerserkerStance'] then - pfUI.autoshift.CastSpellByName(pfLocaleShift[pfUI.cache["locale"]]['BerserkerStance']) - elseif pfUI.autoshift.lastError == pfLocaleShift[pfUI.cache["locale"]]['wantDefensiveStance'] then - pfUI.autoshift.CastSpellByName(pfLocaleShift[pfUI.cache["locale"]]['DefensiveStance']) + if pfUI.autoshift.lastError == L["stances"]['wantBattleStance'] then + pfUI.autoshift.CastSpellByName(L["stances"]['BattleStance']) + elseif pfUI.autoshift.lastError == L["stances"]['wantBattleDefStance'] then + pfUI.autoshift.CastSpellByName(L["stances"]['BattleStance']) + elseif pfUI.autoshift.lastError == L["stances"]['wantBattleBerserkStance'] then + pfUI.autoshift.CastSpellByName(L["stances"]['BerserkerStance']) + elseif pfUI.autoshift.lastError == L["stances"]['wantBerserkerStance'] then + pfUI.autoshift.CastSpellByName(L["stances"]['BerserkerStance']) + elseif pfUI.autoshift.lastError == L["stances"]['wantDefensiveStance'] then + pfUI.autoshift.CastSpellByName(L["stances"]['DefensiveStance']) end pfUI.autoshift.lastError = "" end) Hook("CastSpellByName", function(spellName, onSelf) - if pfUI.autoshift.lastError == pfLocaleShift[pfUI.cache["locale"]]['wantBattleStance'] then - pfUI.autoshift.CastSpellByName(pfLocaleShift[pfUI.cache["locale"]]['BattleStance']) - elseif pfUI.autoshift.lastError == pfLocaleShift[pfUI.cache["locale"]]['wantBattleDefStance'] then - pfUI.autoshift.CastSpellByName(pfLocaleShift[pfUI.cache["locale"]]['BattleStance']) - elseif pfUI.autoshift.lastError == pfLocaleShift[pfUI.cache["locale"]]['wantBattleBerserkStance'] then - pfUI.autoshift.CastSpellByName(pfLocaleShift[pfUI.cache["locale"]]['BerserkerStance']) - elseif pfUI.autoshift.lastError == pfLocaleShift[pfUI.cache["locale"]]['wantBerserkerStance'] then - pfUI.autoshift.CastSpellByName(pfLocaleShift[pfUI.cache["locale"]]['BerserkerStance']) - elseif pfUI.autoshift.lastError == pfLocaleShift[pfUI.cache["locale"]]['wantDefensiveStance'] then - pfUI.autoshift.CastSpellByName(pfLocaleShift[pfUI.cache["locale"]]['DefensiveStance']) + if pfUI.autoshift.lastError == L["stances"]['wantBattleStance'] then + pfUI.autoshift.CastSpellByName(L["stances"]['BattleStance']) + elseif pfUI.autoshift.lastError == L["stances"]['wantBattleDefStance'] then + pfUI.autoshift.CastSpellByName(L["stances"]['BattleStance']) + elseif pfUI.autoshift.lastError == L["stances"]['wantBattleBerserkStance'] then + pfUI.autoshift.CastSpellByName(L["stances"]['BerserkerStance']) + elseif pfUI.autoshift.lastError == L["stances"]['wantBerserkerStance'] then + pfUI.autoshift.CastSpellByName(L["stances"]['BerserkerStance']) + elseif pfUI.autoshift.lastError == L["stances"]['wantDefensiveStance'] then + pfUI.autoshift.CastSpellByName(L["stances"]['DefensiveStance']) end pfUI.autoshift.lastError = "" end) Hook("UseAction", function(slot, checkCursor, onSelf) - if pfUI.autoshift.lastError == pfLocaleShift[pfUI.cache["locale"]]['wantBattleStance'] then - pfUI.autoshift.CastSpellByName(pfLocaleShift[pfUI.cache["locale"]]['BattleStance']) - elseif pfUI.autoshift.lastError == pfLocaleShift[pfUI.cache["locale"]]['wantBattleDefStance'] then - pfUI.autoshift.CastSpellByName(pfLocaleShift[pfUI.cache["locale"]]['BattleStance']) - elseif pfUI.autoshift.lastError == pfLocaleShift[pfUI.cache["locale"]]['wantBattleBerserkStance'] then - pfUI.autoshift.CastSpellByName(pfLocaleShift[pfUI.cache["locale"]]['BerserkerStance']) - elseif pfUI.autoshift.lastError == pfLocaleShift[pfUI.cache["locale"]]['wantBerserkerStance'] then - pfUI.autoshift.CastSpellByName(pfLocaleShift[pfUI.cache["locale"]]['BerserkerStance']) - elseif pfUI.autoshift.lastError == pfLocaleShift[pfUI.cache["locale"]]['wantDefensiveStance'] then - pfUI.autoshift.CastSpellByName(pfLocaleShift[pfUI.cache["locale"]]['DefensiveStance']) + if pfUI.autoshift.lastError == L["stances"]['wantBattleStance'] then + pfUI.autoshift.CastSpellByName(L["stances"]['BattleStance']) + elseif pfUI.autoshift.lastError == L["stances"]['wantBattleDefStance'] then + pfUI.autoshift.CastSpellByName(L["stances"]['BattleStance']) + elseif pfUI.autoshift.lastError == L["stances"]['wantBattleBerserkStance'] then + pfUI.autoshift.CastSpellByName(L["stances"]['BerserkerStance']) + elseif pfUI.autoshift.lastError == L["stances"]['wantBerserkerStance'] then + pfUI.autoshift.CastSpellByName(L["stances"]['BerserkerStance']) + elseif pfUI.autoshift.lastError == L["stances"]['wantDefensiveStance'] then + pfUI.autoshift.CastSpellByName(L["stances"]['DefensiveStance']) end pfUI.autoshift.lastError = "" end) diff --git a/modules/bags.lua b/modules/bags.lua index a3523680..5fe21db8 100644 --- a/modules/bags.lua +++ b/modules/bags.lua @@ -312,8 +312,8 @@ pfUI:RegisterModule("bags", function () local _, _, id = strfind(GetInventoryItemLink("player", ContainerIDToInventoryID(bag)) or "", "item:(%d+)") if id then local _, _, _, _, itemType, subType = GetItemInfo(id) - bagtype = pfLocaleBagtypes[pfUI.cache["locale"]][itemType] - bagsubtype = pfLocaleBagtypes[pfUI.cache["locale"]][subType] + bagtype = L["bagtypes"][itemType] + bagsubtype = L["bagtypes"][subType] if bagsubtype == "SOULBAG" then bagtype = "SOULBAG" diff --git a/modules/castbar.lua b/modules/castbar.lua index f0031775..33d3f5ce 100644 --- a/modules/castbar.lua +++ b/modules/castbar.lua @@ -78,8 +78,8 @@ pfUI:RegisterModule("castbar", function () local scanner = CreateFrame("GameTooltip", "pfSpellScanner", nil, "GameTooltipTemplate") scanner:SetOwner(WorldFrame, "ANCHOR_NONE") - local aimedshot = pfCustomCastbar[pfUI.cache["locale"]]["AIMEDSHOT"] - local multishot = pfCustomCastbar[pfUI.cache["locale"]]["MULTISHOT"] + local aimedshot = L["customcast"]["AIMEDSHOT"] + local multishot = L["customcast"]["MULTISHOT"] pfUI.castbar.player[aimedshot] = function(begin) if begin then @@ -473,9 +473,9 @@ pfUI:RegisterModule("castbar", function () end) function pfUI.castbar.target:Action(mob, spell) - if pfLocaleSpells[pfUI.cache["locale"]][spell] ~= nil then - local casttime = pfLocaleSpells[pfUI.cache["locale"]][spell].t / 1000 - local icon = pfLocaleSpells[pfUI.cache["locale"]][spell].icon + if L["spells"][spell] ~= nil then + local casttime = L["spells"][spell].t / 1000 + local icon = L["spells"][spell].icon pfUI.castbar.target.casterDB[mob] = {cast = spell, starttime = GetTime(), casttime = casttime, icon = icon} if UnitExists("target") and pfUI.castbar.target.casterDB[UnitName("target")] then if C.castbar.target.hide_pfui == "1" then @@ -490,7 +490,7 @@ pfUI:RegisterModule("castbar", function () end function pfUI.castbar.target:StopAction(mob, spell) - if pfUI.castbar.target.casterDB[mob] and pfLocaleSpellInterrupts[pfUI.cache["locale"]][spell] ~= nil then + if pfUI.castbar.target.casterDB[mob] and L["interrupts"][spell] ~= nil then pfUI.castbar.target.casterDB[mob] = nil end end diff --git a/modules/chat.lua b/modules/chat.lua index 0dd887ef..e7ed11ea 100644 --- a/modules/chat.lua +++ b/modules/chat.lua @@ -402,8 +402,8 @@ pfUI:RegisterModule("chat", function () local Name, Class, Level for i = 1, GetNumFriends() do Name, Level, Class = GetFriendInfo(i) - if pfLocaleClass[pfUI.cache["locale"]] and pfLocaleClass[pfUI.cache["locale"]][Class] then - Class = pfLocaleClass[pfUI.cache["locale"]][Class] + if L["class"] and L["class"][Class] then + Class = L["class"][Class] end pfUI_playerDB[Name] = { class = Class, level = Level } end @@ -411,8 +411,8 @@ pfUI:RegisterModule("chat", function () local Name, Class, Level for i = 1, GetNumGuildMembers() do Name, _, _, Level, Class = GetGuildRosterInfo(i) - if pfLocaleClass[pfUI.cache["locale"]] and pfLocaleClass[pfUI.cache["locale"]][Class] then - Class = pfLocaleClass[pfUI.cache["locale"]][Class] + if L["class"] and L["class"][Class] then + Class = L["class"][Class] end if Name and Level and Class and pfUI_playerDB then pfUI_playerDB[Name] = { class = Class, level = Level } @@ -423,8 +423,8 @@ pfUI:RegisterModule("chat", function () local Name, Class, SubGroup, Level for i = 1, GetNumRaidMembers() do Name, _, SubGroup, Level, Class = GetRaidRosterInfo(i) - if pfLocaleClass[pfUI.cache["locale"]] and pfLocaleClass[pfUI.cache["locale"]].Class then - Class = pfLocaleClass[pfUI.cache["locale"]][Class] + if L["class"] and L["class"].Class then + Class = L["class"][Class] end pfUI_playerDB[Name] = { class = Class, level = Level } end @@ -449,8 +449,8 @@ pfUI:RegisterModule("chat", function () local Name, Class, Level for i = 1, GetNumWhoResults() do Name, _, Level, _, Class, _ = GetWhoInfo(i) - if pfLocaleClass[pfUI.cache["locale"]] and pfLocaleClass[pfUI.cache["locale"]][Class] then - Class = pfLocaleClass[pfUI.cache["locale"]][Class] + if L["class"] and L["class"][Class] then + Class = L["class"][Class] end pfUI_playerDB[Name] = { class = Class, level = Level } end diff --git a/modules/eqcompare.lua b/modules/eqcompare.lua index 643dcde1..6a93057a 100644 --- a/modules/eqcompare.lua +++ b/modules/eqcompare.lua @@ -1,6 +1,6 @@ pfUI:RegisterModule("eqcompare", function () local loc = pfUI.cache["locale"] - for key, value in pairs(pfLocaleInvtypes[loc]) do setglobal(key, value) end + for key, value in pairs(L["itemtypes"]) do setglobal(key, value) end INVTYPE_WEAPON_OTHER = INVTYPE_WEAPON.."_other"; INVTYPE_FINGER_OTHER = INVTYPE_FINGER.."_other"; INVTYPE_TRINKET_OTHER = INVTYPE_TRINKET.."_other"; diff --git a/modules/hunterbar.lua b/modules/hunterbar.lua index 7054819b..a338384a 100644 --- a/modules/hunterbar.lua +++ b/modules/hunterbar.lua @@ -23,9 +23,9 @@ pfUI:RegisterModule("hunterbar", function () pfUI.hunterbar.scanner:SetAction(i) if pfHunterBarScannerTextLeft1 and pfHunterBarScannerTextLeft1:GetText() then - if pfHunterBarScannerTextLeft1:GetText() == pfLocaleHunterbars[pfUI.cache["locale"]]["MELEE"] then + if pfHunterBarScannerTextLeft1:GetText() == L["hunterpaging"]["MELEE"] then pfUI.hunterbar.melee = i - elseif pfHunterBarScannerTextLeft1:GetText() == pfLocaleHunterbars[pfUI.cache["locale"]]["RANGED"] then + elseif pfHunterBarScannerTextLeft1:GetText() == L["hunterpaging"]["RANGED"] then pfUI.hunterbar.ranged = i end end diff --git a/pfUI.lua b/pfUI.lua index 1e356de1..8e062f79 100644 --- a/pfUI.lua +++ b/pfUI.lua @@ -29,17 +29,9 @@ pfUI.movables = {} pfUI.version = {} pfUI.hooks = {} -pfLocaleClass = {} -pfLocaleBagtypes = {} -pfLocaleInvtypes = {} -pfLocaleShift = {} -pfLocaleSpells = {} -pfLocaleSpellInterrupts = {} -pfLocaleHunterbars = {} -pfCustomCastbar = {} - pfUI_playerDB = {} pfUI_config = {} +pfUI_locale = {} pfUI:SetScript("OnEvent", function() @@ -82,16 +74,7 @@ pfUI:SetScript("OnEvent", function() -- use C for configs env_pfui.C = pfUI_config - - -- fill the cache - pfUI.cache["locale"] = GetLocale() - if pfUI.cache["locale"] ~= "enUS" and - pfUI.cache["locale"] ~= "frFR" and - pfUI.cache["locale"] ~= "deDE" and - pfUI.cache["locale"] ~= "zhCN" and - pfUI.cache["locale"] ~= "ruRU" then - pfUI.cache["locale"] = "enUS" - end + env_pfui.L = pfUI_locale[GetLocale()] or pfUI_locale["enUS"] for i,m in pairs(this.modules) do -- do not load disabled modules