--[[
Name: Babble-Tradeskill-2.2
Revision: $Rev: 23185 $
Author(s): ckknight (ckknight@gmail.com), Kemayo
Website: http://ckknight.wowinterface.com/
Documentation: http://wiki.wowace.com/index.php/Babble-Tradeskill-2.2
SVN: http://svn.wowace.com/root/trunk/Babble-2.2/Babble-Tradeskill-2.2
Description: A library to provide localizations for tradeskills.
Dependencies: AceLibrary, AceLocale-2.2
License: MIT
]]

local MAJOR_VERSION = "Babble-Tradeskill-2.2"
local MINOR_VERSION = tonumber(string.sub("$Revision: 23185 $", 12, -3))

if not AceLibrary then error(MAJOR_VERSION .. " requires AceLibrary") end
if not AceLibrary:HasInstance("AceLocale-2.2") then error(MAJOR_VERSION .. " requires AceLocale-2.2") end

local _, x = AceLibrary("AceLocale-2.2"):GetLibraryVersion()
MINOR_VERSION = MINOR_VERSION * 100000 + x

if not AceLibrary:IsNewVersion(MAJOR_VERSION, MINOR_VERSION) then return end

local BabbleTradeskill = AceLibrary("AceLocale-2.2"):new(MAJOR_VERSION)

-- uncomment below for debug information
-- BabbleTradeskill:EnableDebugging()

BabbleTradeskill:RegisterTranslations("enUS", function()
	return {
--Gathering skills
		["Disenchant"] = true,
		["Fishing"] = true,
		["Herbalism"] = true,
		["Mining"] = true,
		["Pick Pocket"] = true,
		["Prospecting"] = true,
		["Skinning"] = true,
		["Smelting"] = true,
		
--Crafting skills
		["Alchemy"] = true,
		["Armorsmith"] = true,
		["Axesmith"] = true,
		["Blacksmithing"] = true,
		["Cooking"] = true,
		["Dragonscale Leatherworking"] = true,
		["Elemental Leatherworking"] = true,
		["Enchanting"] = true,
		["Engineering"] = true,
		["First Aid"] = true,
		["Gnomish Engineering"] = true,
		["Goblin Engineering"] = true,
		["Hammersmith"] = true,
		["Jewelcrafting"] = true,
		["Leatherworking"] = true,
		["Mooncloth Tailoring"] = true,
		["Shadoweave Tailoring"] = true,
		["Spellfire Tailoring"] = true,
		["Swordsmith"] = true,
		["Tailoring"] = true,
		["Tribal Leatherworking"] = true,
		["Weaponsmith"] = true,
	}
end)

BabbleTradeskill:RegisterTranslations("deDE", function()
	return {
--Gathering skills
		["Disenchant"] = "Entzaubern",
		["Fishing"] = "Angeln",
		["Herbalism"] = "Kr\195\164uterkunde",
		["Mining"] = "Bergbau",
		["Pick Pocket"] = "Taschendiebstahl",
		["Prospecting"] = "Sondieren",
		["Skinning"] = "K\195\188rschnerei",
		["Smelting"] = "Verh\195\188ttung",
		
--Crafting skills
		["Alchemy"] = "Alchimie",
		["Armorsmith"] = "R\195\188stungsschmied",
		["Axesmith"] = "Axtschmied",
		["Blacksmithing"] = "Schmiedekunst",
		["Cooking"] = "Kochkunst",
		["Dragonscale Leatherworking"] = "Drachenschuppenlederverarbeitung",
		["Elemental Leatherworking"] = "Elementarlederverarbeitung",
		["Enchanting"] = "Verzauberkunst",
		["Engineering"] = "Ingenieurskunst",
		["First Aid"] = "Erste Hilfe",
		["Gnomish Engineering"] = "Gnomeningenieur",
		["Goblin Engineering"] = "Gobliningenieur",
		["Hammersmith"] = "Hammerschmied",
		["Jewelcrafting"] = "Juwelenschleifen",
		["Leatherworking"] = "Lederverarbeitung",
		["Mooncloth Tailoring"] = "Mooncloth Tailoring", -- need fix
		["Shadoweave Tailoring"] = "Shadoweave Tailoring", -- need fix
		["Spellfire Tailoring"] = "Spellfire Tailoring", -- need fix
		["Swordsmith"] = "Schwertschmied",
		["Tailoring"] = "Schneiderei",
		["Tribal Leatherworking"] = "Stammeslederverarbeitung",
		["Weaponsmith"] = "Waffenschmied",
	}
end)

BabbleTradeskill:RegisterTranslations("frFR", function()
	return {
--Gathering skills
		["Disenchant"] = "D\195\169senchanter",
		["Fishing"] = "P\195\170che",
		["Herbalism"] = "Herboristerie",
		["Mining"] = "Minage",
		["Pick Pocket"] = "Vol \195\160 la tire",
		["Prospecting"] = "Prospection",
		["Skinning"] = "D\195\169pecage",
		["Smelting"] = "Fondre",
		
--Crafting skills
		["Alchemy"] = "Alchimie",
		["Armorsmith"] = "Fabricant d'armures",
		["Axesmith"] = "Fabricant de haches",
		["Blacksmithing"] = "Forge",
		["Cooking"] = "Cuisine",
		["Dragonscale Leatherworking"] = "Travail du cuir d'\195\169cailles de dragon",
		["Elemental Leatherworking"] = "Travail du cuir \195\169l\195\169mentaire",
		["Enchanting"] = "Enchantement",
		["Engineering"] = "Ing\195\169nieur",
		["First Aid"] = "Premiers soins",
		["Gnomish Engineering"] = "Ing\195\169nieur gnome",
		["Goblin Engineering"] = "Ing\195\169nieur gobelin",
		["Hammersmith"] = "Fabricant de marteaux",
		["Jewelcrafting"] = "Joaillerie",
		["Leatherworking"] = "Travail du cuir",
		["Mooncloth Tailoring"] = "Mooncloth Tailoring", -- need fix
		["Shadoweave Tailoring"] = "Shadoweave Tailoring", -- need fix
		["Spellfire Tailoring"] = "Spellfire Tailoring", -- need fix
		["Swordsmith"] = "Fabricant d'\195\169p\195\169es",
		["Tailoring"] = "Couture",
		["Tribal Leatherworking"] = "Travail du cuir tribal",
		["Weaponsmith"] = "Fabricant d'armes",
	}
end)

BabbleTradeskill:RegisterTranslations("zhCN", function()
	return {
--Gathering skills
		["Disenchant"] = "\229\136\134\232\167\163",
		["Fishing"] = "\233\146\147\233\177\188",
		["Herbalism"] = "\233\135\135\232\141\175",
		["Mining"] = "\233\135\135\231\159\191",
		["Pick Pocket"] = "å·çªƒ",
		--["Prospecting"] = true,
		["Skinning"] = "\229\137\165\231\154\174",
		["Smelting"] = "ç†”ç‚¼",
		
--Crafting skills
		["Alchemy"] = "\231\130\188\233\135\145",
		["Armorsmith"] = "æŠ¤ç”²é”»é€ å¸ˆ",
		["Axesmith"] = true,
		["Blacksmithing"] = "\233\148\187\233\128\160",
		["Cooking"] = "\231\131\185\233\165\170",
		["Dragonscale Leatherworking"] = "\233\190\153\233\179\158\229\136\182\231\154\174",
		["Elemental Leatherworking"] = "\229\133\131\231\180\160\229\136\182\231\154\174",
		["Enchanting"] = "\233\153\132\233\173\148",
		["Engineering"] = "\229\183\165\231\168\139",
		["First Aid"] = "\230\128\165\230\149\145",
		["Gnomish Engineering"] = "\228\190\143\229\132\146\229\183\165\231\168\139\229\173\166",
		["Goblin Engineering"] = "\229\156\176\231\178\190\229\183\165\231\168\139\229\184\136",
		--["Hammersmith"] = true,
		--["Jewelcrafting"] = true,
		["Leatherworking"] = "\229\136\182\231\154\174",
		["Mooncloth Tailoring"] = "Mooncloth Tailoring", -- need fix
		["Shadoweave Tailoring"] = "Shadoweave Tailoring", -- need fix
		["Spellfire Tailoring"] = "Spellfire Tailoring", -- need fix
		--["Swordsmith"] = true,
		["Tailoring"] = "\232\163\129\231\188\157",
		["Tribal Leatherworking"] = "\233\131\168\230\151\143\229\136\182\231\154\174",
		["Weaponsmith"] = "æ­¦å™¨é”»é€ å¸ˆ",
	}
end)

BabbleTradeskill:RegisterTranslations("zhTW", function()
	return {
--Gathering skills
		["Disenchant"] = "分解",
		["Fishing"] = "釣魚",
		["Herbalism"] = "草藥學",
		["Mining"] = "採礦",
		["Pick Pocket"]="偷竊",
		["Prospecting"] = "勘探 ",
		["Skinning"] = "剝皮",
		["Smelting"]="熔煉",
		
--Crafting skills
		["Alchemy"] = "煉金術",
		["Armorsmith"] = "防具鍛造",
		["Axesmith"] = "斧類鍛造",
		["Blacksmithing"] = "鍛造",
		["Cooking"] = "烹飪",
		["Dragonscale Leatherworking"] = "龍鱗製皮",
		["Elemental Leatherworking"] = "元素製皮",
		["Enchanting"] = "附魔",
		["Engineering"] = "工程學",
		["First Aid"] = "急救",
		["Gnomish Engineering"] = "地精工程學",
		["Goblin Engineering"] = "哥布林工程學",
		["Hammersmith"] = "槌類鍛造",
		["Jewelcrafting"] = "珠寶設計",
		["Leatherworking"] = "製皮 ",
		["Mooncloth Tailoring"] = "月系裁縫",
		["Shadoweave Tailoring"] = "闇系裁縫",
		["Spellfire Tailoring"] = "焰系裁縫",
		["Swordsmith"] = "劍類鍛造",
		["Tailoring"] = "裁縫",
		["Tribal Leatherworking"] = "部族製皮",
		["Weaponsmith"] = "武器鑄造",
	}
end)

BabbleTradeskill:RegisterTranslations("koKR", function()
	return {
--Gathering skills
		["Disenchant"] = "마력 추출",
		["Fishing"] = "낚시",
		["Herbalism"] = "약초 채집",
		["Mining"] = "채광",
		["Pick Pocket"] = "훔치기",
		["Prospecting"] = "보석 추출",
		["Skinning"] = "무두질",
		["Smelting"] = "제련술",
		
--Crafting skills
		["Alchemy"] = "연금술",
		["Armorsmith"] = "방어구제작",
		["Axesmith"] = "도끼 제작의 대가",
		["Blacksmithing"] = "대장기술",
		["Cooking"] = "요리",
		["Dragonscale Leatherworking"] = "용비늘 가죽세공",
		["Elemental Leatherworking"] = "원소 가죽세공",
		["Enchanting"] = "마법부여",
		["Engineering"] = "기계공학",
		["First Aid"] = "응급 치료",
		["Gnomish Engineering"] = "노움 기계공학",
		["Goblin Engineering"] = "고블린 기계공학",
		["Hammersmith"] = "망치 제작의 대가",
		["Jewelcrafting"] = "보석세공",
		["Leatherworking"] = "가죽 세공",
		["Mooncloth Tailoring"] = "달빛매듭 재봉술",
		["Shadoweave Tailoring"] = "그림자매듭 재봉술",
		["Spellfire Tailoring"] = "마법불꽃 재봉술",
		["Swordsmith"] = "검 제작의 대가",
		["Tailoring"] = "재봉술",
		["Tribal Leatherworking"] = "전통 가죽세공",
		["Weaponsmith"] = "무기제작",
	}
end)

BabbleTradeskill:RegisterTranslations("esES", function()
	return {
--Gathering skills
		["Disenchant"] = "Desencantar",
		["Fishing"] = "Pesca",
		["Herbalism"] = "Bot\195\161nica",   -- Herborister\195\173a / Bot\195\161nica
		["Mining"] = "Miner\195\173a",
		["Pick Pocket"] = "Robar",
		["Prospecting"] = "Buscando",  -- check
		["Skinning"] = "Desuello",
		["Smelting"] = "Fundici\195\179n",
		
--Crafting skills
		["Alchemy"] = "Alquimia",
		["Armorsmith"] = "Forjador de armaduras",    -- check
		["Axesmith"] = "Forjador de hachas",
		["Blacksmithing"] = "Herrer\195\173a",
		["Cooking"] = "Cocina",
		["Dragonscale Leatherworking"] = "Peleter\195\173a dragontina",   -- check
		["Elemental Leatherworking"] = "Peleter\195\173a elemental",   -- check
		["Enchanting"] = "Encantamiento",
		["Engineering"] = "Ingenier\195\173a",
		["First Aid"] = "Primeros auxilios",
		["Gnomish Engineering"] = "Ingenier\195\173a gn\195\179mica",
		["Goblin Engineering"] = "Ingenier\195\173a goblin",
		["Hammersmith"] = "Forjador de martillos", -- check
		["Jewelcrafting"] = "Joyer\195\173a",
		["Leatherworking"] = "Peleter\195\173a",
		["Mooncloth Tailoring"] = "Mooncloth Tailoring", -- need fix
		["Shadoweave Tailoring"] = "Shadoweave Tailoring", -- need fix
		["Spellfire Tailoring"] = "Spellfire Tailoring", -- need fix
		["Swordsmith"] = "Forjador de espadas", -- check
		["Tailoring"] = "Sastrer\195\173a",
		["Tribal Leatherworking"] = "Peleter\195\173a tribal",      -- check
		["Weaponsmith"] = "Forjador de armas",        -- check
	}
end)

local skillIcons = {
	["Alchemy"] = "Trade_Alchemy",
	--["Armorsmith"] = "",
	--["Axesmith"] = "",
	["Blacksmithing"] = "Trade_BlackSmithing",
	["Cooking"] = "INV_Misc_Food_15",
	["Disenchant"] = "Spell_Holy_RemoveCurse",
	["Dragonscale Leatherworking"] = "INV_Misc_MonsterScales_03",
	--["Elemental Leatherworking"] = "",
	["Enchanting"] = "Trade_Engraving",
	["Engineering"] = "Trade_Engineering",
	["First Aid"] = "Spell_Holy_SealOfSacrifice",
	["Fishing"] = "Trade_Fishing",
	--["Gnomish Engineering"] = "",
	--["Goblin Engineering"] = "",
	--["Hammersmith"] = "",
	["Herbalism"] = "Spell_Nature_NatureTouchGrow",
	["Jewelcrafting"] = "INV_Misc_Gem_02",
	["Leatherworking"] = "INV_Misc_ArmorKit_17",
	["Mining"] = "Spell_Fire_FlameBlades",
	--["Mooncloth Tailoring"] = "",
	--["Shadoweave Tailoring"] = "",
	--["Spellfire Tailoring"] = "",
	["Pick Pocket"] = "INV_Misc_Bag_11",
	["Prospecting"] = "INV_Misc_Gem_Bloodstone_01",
	["Skinning"] = "INV_Misc_Pelt_Wolf_01",
	["Smelting"] = "Spell_Fire_FlameBlades",
	--["Swordsmith"] = "",
	["Tailoring"] = "Trade_Tailoring",
	--["Tribal Leatherworking"] = "",
	--["Weaponsmith"] = "",
}

BabbleTradeskill:Debug()
BabbleTradeskill:SetStrictness(true)

function BabbleTradeskill:GetSkillIcon(skill)
	self:argCheck(skill, 2, "string")
	local icon = skillIcons[skill] or skillIcons[self:HasReverseTranslation(skill) and self:GetReverseTranslation(skill) or false]
	if not icon then
		return nil
	end
	return "Interface\\Icons\\" .. icon
end

function BabbleTradeskill:GetShortSkillIcon(skill)
	self:argCheck(skill, 2, "string")
	return skillIcons[skill] or skillIcons[self:HasReverseTranslation(skill) and self:GetReverseTranslation(skill) or false]
end

AceLibrary:Register(BabbleTradeskill, MAJOR_VERSION, MINOR_VERSION)
BabbleTradeskill = nil
