Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

(Wrath) Add localization #2643

Open
wants to merge 1 commit into
base: wrath
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
280 changes: 135 additions & 145 deletions Classes.lua

Large diffs are not rendered by default.

57 changes: 49 additions & 8 deletions Constants.lua
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,47 @@
-- June 2014

local addon, ns = ...
local Hekili = _G[ addon ]

ns.Version = GetAddOnMetadata( "Hekili", "Version" )
ns.Flavor = GetAddOnMetadata( "Hekili", "X-Flavor" ) or "Retail"

local format = string.format

local buildStr, _, _, buildNum = GetBuildInfo()

ns.CurrentBuild = buildNum

if ns.Version == ( "@" .. "project-version" .. "@" ) then
ns.Version = format( "Dev-%s (%s)", buildStr, date( "%Y%m%d" ) )
end

ns.AllowSimCImports = true

ns.IsRetail = function()
return ns.Flavor == "Retail"
end

ns.IsWrath = function()
return ns.Flavor == "Wrath"
end

ns.IsClassic = function()
return ns.IsWrath()
end

ns.IsDragonflight = function()
return buildNum >= 100000
end

ns.BuiltFor = ns.IsDragonflight() and 100007 or 30401
ns.GameBuild = buildStr

ns.PTR = buildNum > ns.BuiltFor

ns.LOCALE = ( GetLocale() == "enGB" and "enUS" ) or GetLocale()
ns.L = { deDE = {}, enUS = {}, esES = {}, esMX = {}, frFR = {}, itIT = {}, koKR = {}, ptBR = {}, ruRU = {}, zhCN = {}, zhTW = {} }
ns._L = {}


local GetSpecialization = _G.GetSpecialization or function() return GetActiveTalentGroup() end
local GetSpecializationInfo = _G.GetSpecializationInfo or function()
Expand Down Expand Up @@ -49,6 +89,7 @@ local ResourceInfo = {
mana = Enum.PowerType.Mana,
rage = Enum.PowerType.Rage,
focus = Enum.PowerType.Focus,
happiness = Enum.PowerType.Happiness,
energy = Enum.PowerType.Energy,
combo_points = Enum.PowerType.ComboPoints,
runes = Enum.PowerType.Runes,
Expand Down Expand Up @@ -180,17 +221,11 @@ local SpecializationKeys = {
[251] = "frost",
[252] = "unholy",

[577] = "havoc",
[581] = "vengeance",

[102] = "balance",
[103] = "feral",
[104] = "guardian",
[105] = "restoration",

[1467] = "devastation",
[1468] = "preservation",

[253] = "beast_mastery",
[254] = "marksmanship",
[255] = "survival",
Expand Down Expand Up @@ -226,6 +261,12 @@ local SpecializationKeys = {
[71] = "arms",
[72] = "fury",
[73] = "protection",

[577] = "havoc",
[581] = "vengeance",

[1467] = "devastation",
[1468] = "preservation",
}

ns.getSpecializationKey = function ( id )
Expand Down Expand Up @@ -258,7 +299,7 @@ ns.FrameStratas = {
}


if Hekili.IsWrath() then
if ns.IsWrath() then
ns.WrathTalentToSpellID = {
[23] = { 11083, 12351 },
[24] = { 11094, 13043 },
Expand Down
52 changes: 27 additions & 25 deletions Core.lua
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

local addon, ns = ...
local Hekili = _G[ addon ]
local L = LibStub("AceLocale-3.0"):GetLocale( addon )

local class = Hekili.Class
local state = Hekili.State
Expand Down Expand Up @@ -46,7 +47,7 @@ local function EmbedBlizOptions()
open:SetPoint( "CENTER", panel, "CENTER", 0, 0 )
open:SetWidth( 250 )
open:SetHeight( 25 )
open:SetText( "Open Hekili Options Panel" )
open:SetText( L["Open Hekili Options Panel"] )

open:SetScript( "OnClick", function ()
InterfaceOptionsFrameOkay:Click()
Expand Down Expand Up @@ -104,8 +105,8 @@ function Hekili:OnInitialize()
end,
OnTooltipShow = function( tt )
tt:AddDoubleLine( "Hekili", ns.UI.Minimap.text )
tt:AddLine( "|cFFFFFFFFLeft-click to make quick adjustments.|r" )
tt:AddLine( "|cFFFFFFFFRight-click to open the options interface.|r" )
tt:AddLine( "|cFFFFFFFF" .. L["Left-click to make quick adjustments."] .. "|r" )
tt:AddLine( "|cFFFFFFFF" .. L["Right-click to open the options interface."] .. "|r" )
end,
} )

Expand All @@ -116,18 +117,25 @@ function Hekili:OnInitialize()

if p.toggles.essences.override then
-- Don't show Essences here if it's overridden by CDs anyway?
self.text = format( "|c%s%s|r %sCD|r %sInt|r %sDef|r", color,
m == "single" and "ST" or ( m == "aoe" and "AOE" or ( m == "dual" and "Dual" or ( m == "reactive" and "React" or "Auto" ) ) ),
self.text = format( "|c%s%s|r %s%s|r %s%s|r %s%s|r",
color,
m == "single" and L["ST"] or ( m == "aoe" and L["AOE"] or ( m == "dual" and L["Dual"] or ( m == "reactive" and L["React"] or L["Auto"] ) ) ),
p.toggles.cooldowns.value and "|cFF00FF00" or "|cFFFF0000",
L["CD"],
p.toggles.interrupts.value and "|cFF00FF00" or "|cFFFF0000",
p.toggles.defensives.value and "|cFF00FF00" or "|cFFFF0000" )
L["Int"],
p.toggles.defensives.value and "|cFF00FF00" or "|cFFFF0000",
L["Def"] )
else
self.text = format( "|c%s%s|r %sCD|r %sCov|r %sInt|r",
self.text = format( "|c%s%s|r %s%s|r %s%s|r %s%s|r",
color,
m == "single" and "ST" or ( m == "aoe" and "AOE" or ( m == "dual" and "Dual" or ( m == "reactive" and "React" or "Auto" ) ) ),
m == "single" and L["ST"] or ( m == "aoe" and L["AOE"] or ( m == "dual" and L["Dual"] or ( m == "reactive" and L["React"] or L["Auto"] ) ) ),
p.toggles.cooldowns.value and "|cFF00FF00" or "|cFFFF0000",
L["CD"],
p.toggles.essences.value and "|cFF00FF00" or "|cFFFF0000",
p.toggles.interrupts.value and "|cFF00FF00" or "|cFFFF0000" )
L["Cov"],
p.toggles.interrupts.value and "|cFF00FF00" or "|cFFFF0000",
L["Int"] )
end
end

Expand All @@ -138,7 +146,6 @@ function Hekili:OnInitialize()
end
end


--[[ NEED TO PUT VERSION UPDATING STUFF HERE.
if not self.DB.profile.Version or self.DB.profile.Version < 7 or not self.DB.profile.Release or self.DB.profile.Release < 20161000 then
self.DB:ResetDB()
Expand All @@ -149,6 +156,7 @@ function Hekili:OnInitialize()
-- initializeClassModule()
self:RestoreDefaults()
self:RunOneTimeFixes()

checkImports()

ns.updateTalents()
Expand Down Expand Up @@ -629,15 +637,14 @@ do

local function DoYield( self, msg, time, force )
if not coroutine.running() then return end

time = time or debugprofilestop()

prevTime = time

if force or time - self.frameStartTime > self.maxFrameTime * 0.9 then
coroutine.yield()

prevMsg = "Resumed thread..."
prevMsg = L["Resumed thread..."]
prevTime = debugprofilestop()

resumeTime = prevTime
Expand All @@ -659,7 +666,7 @@ do
function Hekili:ResetThreadClock()
resumeTime = debugprofilestop()

prevMsg = "Started thread..."
prevMsg = L["Started thread..."]
prevTime = resumeTime
end
end
Expand Down Expand Up @@ -703,7 +710,6 @@ function Hekili:GetPredictionFromAPL( dispName, packName, listName, slot, action
local force_channel = false
local stop = false


if self:IsListActive( packName, listName ) then
local actID = 1

Expand Down Expand Up @@ -1335,7 +1341,6 @@ function Hekili:GetPredictionFromAPL( dispName, packName, listName, slot, action
end

if rWait == 0 or force_channel then break end

end
end
end
Expand Down Expand Up @@ -1370,7 +1375,6 @@ Hekili:ProfileCPU( "GetPredictionFromAPL", Hekili.GetPredictionFromAPL )


function Hekili:GetNextPrediction( dispName, packName, slot )

local debug = self.ActiveDebug

-- This is the entry point for the prediction engine.
Expand Down Expand Up @@ -1919,7 +1923,6 @@ function Hekili.Update()
if ability.gcd ~= "off" and state.cooldown.global_cooldown.remains == 0 then
state.setCooldown( "global_cooldown", state.gcd.execute )
end

-- Hekili:Yield( "Post-GCD for " .. dispName .. " #" .. i .. ": " .. action )

local cast_target = state.cast_target ~= "nobody" and state.cast_target or state.target.unit
Expand Down Expand Up @@ -1959,7 +1962,6 @@ function Hekili.Update()
-- Queue ticks because we may not have an ability.tick function, but may have resources tied to an aura.
if ability.tick_time then
local ticks = floor( cast / ability.tick_time )

for i = 1, ticks do
if debug then Hekili:Debug( "Queueing %s channel tick (%d of %d) at %.2f [+%.2f].", action, i, ticks, state.query_time + ( i * ability.tick_time ), state.offset + ( i * ability.tick_time ) ) end
state:QueueEvent( action, state.query_time, state.query_time + ( i * ability.tick_time ), "CHANNEL_TICK", cast_target )
Expand Down Expand Up @@ -2030,7 +2032,7 @@ function Hekili.Update()
end
else
if not hasSnapped and profile.autoSnapshot and InCombatLockdown() and state.level >= 50 and ( dispName == "Primary" or dispName == "AOE" ) and class.primaryResource and state[ class.primaryResource ].percent > 20 then
Hekili:Print( "Unable to make recommendation for " .. dispName .. " #" .. i .. "; triggering auto-snapshot..." )
Hekili:Print( format( L["Unable to make recommendation for %s #%d; triggering auto-snapshot..."], dispName, i ) )
hasSnapped = dispName
UI:SetThreadLocked( false )
return "AutoSnapshot"
Expand Down Expand Up @@ -2058,9 +2060,9 @@ function Hekili.Update()

if Hekili:SaveDebugSnapshot( dispName ) then
if snaps then
snaps = snaps .. ", " .. dispName
snaps = snaps .. ", " .. L[ dispName ]
else
snaps = dispName
snaps = L[ dispName ]
end

if Hekili.Config then LibStub( "AceConfigDialog-3.0" ):SelectGroup( "Hekili", "snapshots" ) end
Expand All @@ -2080,7 +2082,7 @@ function Hekili.Update()
end

if snaps then
Hekili:Print( "Snapshots saved: " .. snaps .. "." )
Hekili:Print( format( L["Snapshots saved: %s."], snaps ) )
end
end
Hekili:ProfileCPU( "ThreadedUpdate", Hekili.Update )
Expand All @@ -2090,17 +2092,17 @@ function Hekili_GetRecommendedAbility( display, entry )
entry = entry or 1

if not rawget( Hekili.DB.profile.displays, display ) then
return nil, "Display not found."
return nil, L["Display not found."]
end

if not ns.queue[ display ] then
return nil, "No queue for that display."
return nil, L["No queue for that display."]
end

local slot = ns.queue[ display ][ entry ]

if not slot or not slot.actionID then
return nil, "No entry #" .. entry .. " for that display."
return nil, format( L["No entry #%s for that display."], entry )
end

return slot.actionID
Expand Down
Loading