From e881881ab48539317bd4b14916ff956cb1611607 Mon Sep 17 00:00:00 2001 From: p3lim-52096 Date: Wed, 4 Mar 2009 21:01:50 +0000 Subject: [PATCH] Added deDE localization Added icon textures to menu git-svn-id: svn://svn.wowinterface.com/Broker_Equipment-429/trunk@4 ec0254a7-aafd-4d69-bcb1-797bd6548cda --- Broker_Equipment/Broker_Equipment.lua | 33 ++++++++++++++++++++++++++++----- 1 file changed, 28 insertions(+), 5 deletions(-) diff --git a/Broker_Equipment/Broker_Equipment.lua b/Broker_Equipment/Broker_Equipment.lua index af108cb..2cc418a 100644 --- a/Broker_Equipment/Broker_Equipment.lua +++ b/Broker_Equipment/Broker_Equipment.lua @@ -1,3 +1,4 @@ +local locale = GetLocale() local dummy = CreateFrame('Frame', 'Broker_EquipmentDummy', UIParent, 'UIDropDownMenuTemplate') local broker = LibStub:GetLibrary('LibDataBroker-1.1'):NewDataObject('Broker_Equipment', { type = 'data source', @@ -6,13 +7,36 @@ local broker = LibStub:GetLibrary('LibDataBroker-1.1'):NewDataObject('Broker_Equ iconCoords = {0.065, 0.935, 0.065, 0.935} }) +local CHANGESET +if(locale == 'frFR') then + CHANGESET = 'Click here to change your set' -- todo +elseif(locale == 'deDE') then + CHANGESET = 'Klicke hier um das set zu wechsein' +elseif(locale == 'koKR') then + CHANGESET = 'Click here to change your set' -- todo +elseif(locale == 'zhCN') then + CHANGESET = 'Click here to change your set' -- todo +elseif(locale == 'zhTW') then + CHANGESET = 'Click here to change your set' -- todo +elseif(locale == 'ruRU') then + CHANGESET = 'Click here to change your set' -- todo +elseif(locale == 'esES') then + CHANGESET = 'Click here to change your set' -- todo +elseif(locale == 'esMX') then + CHANGESET = 'Click here to change your set' -- todo +else + CHANGESET = 'Click here to change your set' +end + function broker.OnClick(self, button) local menu = {} - for i = 1, GetNumEquipmentSets() do - local name, texture = GetEquipmentSetInfo(i) + for index = 1, GetNumEquipmentSets() do + local name, texture = GetEquipmentSetInfo(index) table.insert(menu, { tooltipTitle = name, + index = index, text = name, + icon = texture, func = function() EquipmentManager_EquipSet(name) broker.text = name @@ -21,7 +45,7 @@ function broker.OnClick(self, button) }) end - table.sort(menu, function(a,b) return a.text > b.text end) + table.sort(menu, function(a,b) return a.index < b.index end) EasyMenu(menu, dummy, self, 20, 0, 'MENU') if(GameTooltip:GetOwner() == self) then GameTooltip:Hide() end @@ -29,12 +53,11 @@ end function broker.OnTooltipShow(self) self:AddLine('|cff0090ffBroker Equipment|r') - self:AddLine('Click here to change your set') + self:AddLine(CHANGESET) end dummy:RegisterEvent('PLAYER_LOGIN') dummy:SetScript('OnEvent', function() - -- force the equipmanager to enable SetCVar('equipmentManager', 1) GearManagerToggleButton:Show() -- 1.7.9.5