Quantcast

Added deDE localization

p3lim-52096 [03-04-09 - 21:01]
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
Filename
Broker_Equipment/Broker_Equipment.lua
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()