local DF = LibStub('AceAddon-3.0'):GetAddon('DragonflightUI')

local locale = GetLocale()

function DragonflightUILocalizationData:Getss()
    print('GETSSssss')
end

-- Professions

local ProfessionNamesToSkillID = {}

local DF_CHARACTER_PROFESSIONALCHEMY
local DF_CHARACTER_PROFESSIONBLACKSMITHING
local DF_CHARACTER_PROFESSIONENCHANTING
local DF_CHARACTER_PROFESSIONENGINEERING
local DF_CHARACTER_PROFESSIONFIRST_AID
local DF_CHARACTER_PROFESSIONHERBALISM
local DF_CHARACTER_PROFESSIONINSCRIPTION
local DF_CHARACTER_PROFESSIONJEWELCRAFTING
local DF_CHARACTER_PROFESSIONLEATHERWORKING
local DF_CHARACTER_PROFESSIONMINING
local DF_CHARACTER_PROFESSIONSKINNING
local DF_CHARACTER_PROFESSIONTAILORING

local DF_PROFESSIONS_COOKING
local DF_PROFESSIONS_FISHING

local DF_PROFESSIONS_POISON
local DF_PROFESSIONS_BEAST
local DF_PROFESSIONS_SMELTING
local DF_PROFESSIONS_RUNEFORGING

-- https://github.com/tekkub/wow-globalstrings/blob/master/GlueStrings/deDE.lua
if locale == 'deDE' then
    DF_CHARACTER_PROFESSIONALCHEMY = "Alchemie";
    if DF.Era then DF_CHARACTER_PROFESSIONALCHEMY = "Alchimie"; end -- TODO: blizzard bug?!
    DF_CHARACTER_PROFESSIONBLACKSMITHING = "Schmiedekunst";
    DF_CHARACTER_PROFESSIONENCHANTING = "Verzauberkunst";
    DF_CHARACTER_PROFESSIONENGINEERING = "Ingenieurskunst";
    DF_CHARACTER_PROFESSIONFIRST_AID = "Erste Hilfe";
    DF_CHARACTER_PROFESSIONHERBALISM = "Kräuterkunde";
    DF_CHARACTER_PROFESSIONINSCRIPTION = "Inschriftenkunde";
    DF_CHARACTER_PROFESSIONJEWELCRAFTING = "Juwelierskunst";
    DF_CHARACTER_PROFESSIONLEATHERWORKING = "Lederverarbeitung";
    DF_CHARACTER_PROFESSIONMINING = "Bergbau";
    DF_CHARACTER_PROFESSIONSKINNING = "Kürschnerei";
    DF_CHARACTER_PROFESSIONTAILORING = "Schneiderei";

    DF_PROFESSIONS_COOKING = "Kochkunst";
    DF_PROFESSIONS_FISHING = "Angeln";

    DF_PROFESSIONS_POISON = "Gifte"
    DF_PROFESSIONS_BEAST = "Wildtierausbildung"
    DF_PROFESSIONS_SMELTING = "Verhüttung"
elseif locale == 'enUS' then
    DF_CHARACTER_PROFESSIONALCHEMY = "Alchemy";
    DF_CHARACTER_PROFESSIONBLACKSMITHING = "Blacksmithing";
    DF_CHARACTER_PROFESSIONENCHANTING = "Enchanting";
    DF_CHARACTER_PROFESSIONENGINEERING = "Engineering";
    DF_CHARACTER_PROFESSIONFIRST_AID = "First Aid";
    DF_CHARACTER_PROFESSIONHERBALISM = "Herbalism";
    DF_CHARACTER_PROFESSIONINSCRIPTION = "Inscription";
    DF_CHARACTER_PROFESSIONJEWELCRAFTING = "Jewelcrafting";
    DF_CHARACTER_PROFESSIONLEATHERWORKING = "Leatherworking";
    DF_CHARACTER_PROFESSIONMINING = "Mining";
    DF_CHARACTER_PROFESSIONSKINNING = "Skinning";
    DF_CHARACTER_PROFESSIONTAILORING = "Tailoring";

    DF_PROFESSIONS_COOKING = "Cooking";
    DF_PROFESSIONS_FISHING = "Fishing";

    DF_PROFESSIONS_POISON = "Poisons"
    DF_PROFESSIONS_BEAST = "Beast Training"
    DF_PROFESSIONS_SMELTING = "Smelting"
elseif locale == 'esMX' or (not DF.Era and locale == 'esES') then
    DF_CHARACTER_PROFESSIONALCHEMY = "Alquimia";
    DF_CHARACTER_PROFESSIONBLACKSMITHING = "Herrería";
    DF_CHARACTER_PROFESSIONENCHANTING = "Encantamiento";
    DF_CHARACTER_PROFESSIONENGINEERING = "Ingeniería";
    DF_CHARACTER_PROFESSIONFIRST_AID = "Primeros auxilios";
    DF_CHARACTER_PROFESSIONHERBALISM = "Herboristería";
    DF_CHARACTER_PROFESSIONINSCRIPTION = "Inscripción";
    DF_CHARACTER_PROFESSIONJEWELCRAFTING = "Joyería";
    DF_CHARACTER_PROFESSIONLEATHERWORKING = "Peletería";
    DF_CHARACTER_PROFESSIONMINING = "Minería";
    DF_CHARACTER_PROFESSIONSKINNING = "Desuello";
    DF_CHARACTER_PROFESSIONTAILORING = "Sastrería";

    DF_PROFESSIONS_COOKING = "Cocina";
    DF_PROFESSIONS_FISHING = "Pesca";

    DF_PROFESSIONS_POISON = "Venenos"
    DF_PROFESSIONS_BEAST = "Doma de bestias"
    DF_PROFESSIONS_SMELTING = "Fundición"
elseif (DF.Era and locale == 'esES') then
    DF_CHARACTER_PROFESSIONALCHEMY = "Alquimia";
    DF_CHARACTER_PROFESSIONBLACKSMITHING = "Herrería";
    DF_CHARACTER_PROFESSIONENCHANTING = "Encantamiento";
    DF_CHARACTER_PROFESSIONENGINEERING = "Ingeniería";
    DF_CHARACTER_PROFESSIONFIRST_AID = "Primeros auxilios";
    DF_CHARACTER_PROFESSIONHERBALISM = "Botánica";
    DF_CHARACTER_PROFESSIONINSCRIPTION = "Inscripción";
    DF_CHARACTER_PROFESSIONJEWELCRAFTING = "Joyería";
    DF_CHARACTER_PROFESSIONLEATHERWORKING = "Marroquinería";
    DF_CHARACTER_PROFESSIONMINING = "Minería";
    DF_CHARACTER_PROFESSIONSKINNING = "Desollar";
    DF_CHARACTER_PROFESSIONTAILORING = "Costura";

    DF_PROFESSIONS_COOKING = "Cocina";
    DF_PROFESSIONS_FISHING = "Pesca";

    DF_PROFESSIONS_POISON = "Venenos"
    DF_PROFESSIONS_BEAST = "Doma de bestias"
    DF_PROFESSIONS_SMELTING = "Fundición"
elseif locale == 'frFR' then
    DF_CHARACTER_PROFESSIONALCHEMY = "Alchimie";
    DF_CHARACTER_PROFESSIONBLACKSMITHING = "Forge";
    DF_CHARACTER_PROFESSIONENCHANTING = "Enchantement";
    DF_CHARACTER_PROFESSIONENGINEERING = "Ingénierie";
    DF_CHARACTER_PROFESSIONFIRST_AID = "Secourisme";
    DF_CHARACTER_PROFESSIONHERBALISM = "Herboristerie";
    DF_CHARACTER_PROFESSIONINSCRIPTION = "Calligraphie";
    DF_CHARACTER_PROFESSIONJEWELCRAFTING = "Joaillerie";
    DF_CHARACTER_PROFESSIONLEATHERWORKING = "Travail du cuir";
    DF_CHARACTER_PROFESSIONMINING = "Minage";
    DF_CHARACTER_PROFESSIONSKINNING = "Dépeçage";
    DF_CHARACTER_PROFESSIONTAILORING = "Couture";

    DF_PROFESSIONS_COOKING = "Cuisine";
    DF_PROFESSIONS_FISHING = "Pêche";

    DF_PROFESSIONS_POISON = "Poisons"
    DF_PROFESSIONS_BEAST = "Dressage des bêtes"
    DF_PROFESSIONS_SMELTING = "Fondre"
elseif locale == 'itIT' then
    DF_CHARACTER_PROFESSIONALCHEMY = "Alchimia";
    DF_CHARACTER_PROFESSIONBLACKSMITHING = "Forgiatura";
    DF_CHARACTER_PROFESSIONENCHANTING = "Incantamento";
    DF_CHARACTER_PROFESSIONENGINEERING = "Ingegneria";
    DF_CHARACTER_PROFESSIONFIRST_AID = "Primo Soccorso";
    DF_CHARACTER_PROFESSIONHERBALISM = "Erbalismo";
    DF_CHARACTER_PROFESSIONINSCRIPTION = "Runografia";
    DF_CHARACTER_PROFESSIONJEWELCRAFTING = "Oreficeria";
    DF_CHARACTER_PROFESSIONLEATHERWORKING = "Conciatura";
    DF_CHARACTER_PROFESSIONMINING = "Estrazione";
    DF_CHARACTER_PROFESSIONSKINNING = "Scuoiatura";
    DF_CHARACTER_PROFESSIONTAILORING = "Sartoria";

    DF_PROFESSIONS_COOKING = "Cucina";
    DF_PROFESSIONS_FISHING = "Pesca";

    DF_PROFESSIONS_POISON = "Poisons"
    DF_PROFESSIONS_BEAST = "Beast Training"
    DF_PROFESSIONS_SMELTING = "Smelting"
elseif locale == 'koKR' then
    DF_CHARACTER_PROFESSIONALCHEMY = "연금술";
    DF_CHARACTER_PROFESSIONBLACKSMITHING = "대장기술";
    DF_CHARACTER_PROFESSIONENCHANTING = "마법부여";
    DF_CHARACTER_PROFESSIONENGINEERING = "기계공학";
    DF_CHARACTER_PROFESSIONFIRST_AID = "응급치료";
    DF_CHARACTER_PROFESSIONHERBALISM = "약초채집";
    DF_CHARACTER_PROFESSIONINSCRIPTION = "주문각인";
    DF_CHARACTER_PROFESSIONJEWELCRAFTING = "보석세공";
    DF_CHARACTER_PROFESSIONLEATHERWORKING = "가죽세공";
    DF_CHARACTER_PROFESSIONMINING = "채광";
    DF_CHARACTER_PROFESSIONSKINNING = "무두질";
    DF_CHARACTER_PROFESSIONTAILORING = "재봉술";

    DF_PROFESSIONS_COOKING = "요리";
    DF_PROFESSIONS_FISHING = "낚시";

    DF_PROFESSIONS_POISON = "독 조제"
    DF_PROFESSIONS_BEAST = "야수 조련"
    DF_PROFESSIONS_SMELTING = "제련술"
elseif locale == 'ptBR' then
    DF_CHARACTER_PROFESSIONALCHEMY = "Alquimia";
    DF_CHARACTER_PROFESSIONBLACKSMITHING = "Ferraria";
    DF_CHARACTER_PROFESSIONENCHANTING = "Encantamento";
    DF_CHARACTER_PROFESSIONENGINEERING = "Engenharia";
    DF_CHARACTER_PROFESSIONFIRST_AID = "Primeiros Socorros";
    DF_CHARACTER_PROFESSIONHERBALISM = "Herborismo";
    DF_CHARACTER_PROFESSIONINSCRIPTION = "Escrivania";
    DF_CHARACTER_PROFESSIONJEWELCRAFTING = "Joalheria";
    DF_CHARACTER_PROFESSIONLEATHERWORKING = "Couraria";
    DF_CHARACTER_PROFESSIONMINING = "Mineração";
    DF_CHARACTER_PROFESSIONSKINNING = "Esfolamento";
    DF_CHARACTER_PROFESSIONTAILORING = "Alfaiataria";

    DF_PROFESSIONS_COOKING = "Culinária";
    DF_PROFESSIONS_FISHING = "Pesca";

    DF_PROFESSIONS_POISON = "Venenos"
    DF_PROFESSIONS_BEAST = "Treinamento de Feras"
    DF_PROFESSIONS_SMELTING = "Fundição"
elseif locale == 'ruRU' then
    DF_CHARACTER_PROFESSIONALCHEMY = "Алхимия";
    DF_CHARACTER_PROFESSIONBLACKSMITHING = "Кузнечное дело";
    DF_CHARACTER_PROFESSIONENCHANTING = "Наложение чар";
    DF_CHARACTER_PROFESSIONENGINEERING = "Инженерное дело";
    DF_CHARACTER_PROFESSIONFIRST_AID = "Первая помощь";
    DF_CHARACTER_PROFESSIONHERBALISM = "Травничество";
    DF_CHARACTER_PROFESSIONINSCRIPTION = "Начертание";
    DF_CHARACTER_PROFESSIONJEWELCRAFTING = "Ювелирное дело";
    DF_CHARACTER_PROFESSIONLEATHERWORKING = "Кожевничество";
    DF_CHARACTER_PROFESSIONMINING = "Горное дело";
    DF_CHARACTER_PROFESSIONSKINNING = "Снятие шкур";
    DF_CHARACTER_PROFESSIONTAILORING = "Портняжное дело";

    DF_PROFESSIONS_COOKING = "Кулинария";
    DF_PROFESSIONS_FISHING = "Рыбная ловля";

    DF_PROFESSIONS_POISON = "Яды"
    DF_PROFESSIONS_BEAST = "Дрессировка"
    DF_PROFESSIONS_SMELTING = "Выплавка металлов"
elseif locale == 'zhCN' then
    DF_CHARACTER_PROFESSIONALCHEMY = "炼金术";
    DF_CHARACTER_PROFESSIONBLACKSMITHING = "锻造";
    DF_CHARACTER_PROFESSIONENCHANTING = "附魔";
    DF_CHARACTER_PROFESSIONENGINEERING = "工程学";
    DF_CHARACTER_PROFESSIONFIRST_AID = "急救";
    DF_CHARACTER_PROFESSIONHERBALISM = "草药学";
    DF_CHARACTER_PROFESSIONINSCRIPTION = "铭文";
    DF_CHARACTER_PROFESSIONJEWELCRAFTING = "珠宝加工";
    DF_CHARACTER_PROFESSIONLEATHERWORKING = "制皮";
    DF_CHARACTER_PROFESSIONMINING = "采矿";
    DF_CHARACTER_PROFESSIONSKINNING = "剥皮";
    DF_CHARACTER_PROFESSIONTAILORING = "裁缝";

    DF_PROFESSIONS_COOKING = "烹饪";
    DF_PROFESSIONS_FISHING = "钓鱼";

    DF_PROFESSIONS_POISON = "毒药"
    DF_PROFESSIONS_BEAST = "训练野兽"
    DF_PROFESSIONS_SMELTING = "熔炼"
elseif locale == 'zhTW' then
    DF_CHARACTER_PROFESSIONALCHEMY = "鍊金術";
    DF_CHARACTER_PROFESSIONBLACKSMITHING = "鍛造";
    DF_CHARACTER_PROFESSIONENCHANTING = "附魔";
    DF_CHARACTER_PROFESSIONENGINEERING = "工程學";
    DF_CHARACTER_PROFESSIONFIRST_AID = "急救";
    DF_CHARACTER_PROFESSIONHERBALISM = "草藥學";
    DF_CHARACTER_PROFESSIONINSCRIPTION = "銘文";
    DF_CHARACTER_PROFESSIONJEWELCRAFTING = "珠寶設計";
    DF_CHARACTER_PROFESSIONLEATHERWORKING = "製皮";
    DF_CHARACTER_PROFESSIONMINING = "採礦";
    DF_CHARACTER_PROFESSIONSKINNING = "剝皮";
    DF_CHARACTER_PROFESSIONTAILORING = "裁縫";

    DF_PROFESSIONS_COOKING = "烹飪";
    DF_PROFESSIONS_FISHING = "釣魚";

    DF_PROFESSIONS_POISON = "毒藥"
    DF_PROFESSIONS_BEAST = "訓練野獸"
    DF_PROFESSIONS_SMELTING = "熔炼"
end

--[[ First Aid 	129										
Blacksmithing	164	
Leatherworking	165	
Alchemy	171	
Herbalism	182
Cooking	185	
Mining	186
Tailoring	197	
Engineering	202	
Enchanting	333	
Fishing	356
Skinning	393	
Jewelcrafting 	755
Inscription 	773	
Archeology 	794
 ]]

ProfessionNamesToSkillID[DF_CHARACTER_PROFESSIONALCHEMY] = 171
ProfessionNamesToSkillID[DF_CHARACTER_PROFESSIONBLACKSMITHING] = 164
ProfessionNamesToSkillID[DF_CHARACTER_PROFESSIONENCHANTING] = 333
ProfessionNamesToSkillID[DF_CHARACTER_PROFESSIONENGINEERING] = 202
ProfessionNamesToSkillID[DF_CHARACTER_PROFESSIONFIRST_AID] = 129
ProfessionNamesToSkillID[DF_CHARACTER_PROFESSIONHERBALISM] = 182
ProfessionNamesToSkillID[DF_CHARACTER_PROFESSIONINSCRIPTION] = 773
ProfessionNamesToSkillID[DF_CHARACTER_PROFESSIONJEWELCRAFTING] = 755
ProfessionNamesToSkillID[DF_CHARACTER_PROFESSIONLEATHERWORKING] = 165
ProfessionNamesToSkillID[DF_CHARACTER_PROFESSIONMINING] = 186
ProfessionNamesToSkillID[DF_CHARACTER_PROFESSIONSKINNING] = 393
ProfessionNamesToSkillID[DF_CHARACTER_PROFESSIONTAILORING] = 197

ProfessionNamesToSkillID[DF_PROFESSIONS_COOKING] = 185
ProfessionNamesToSkillID[DF_PROFESSIONS_FISHING] = 356

ProfessionNamesToSkillID[DF_PROFESSIONS_POISON] = 666 -- custom
ProfessionNamesToSkillID[DF_PROFESSIONS_BEAST] = 667 -- custom

if DF.Cata then
    local name, rank, icon, castTime, minRange, maxRange, spellID, originalIcon = GetSpellInfo(53428)
    DF_PROFESSIONS_RUNEFORGING = name;
    ProfessionNamesToSkillID[DF_PROFESSIONS_RUNEFORGING] = 668 -- custom
end

function DragonflightUILocalizationData:GetSkillIDFromProfessionName(name)
    return ProfessionNamesToSkillID[name]
end

-- fix beast training
DragonflightUILocalizationData.DF_PROFESSIONS_BEAST = DF_PROFESSIONS_BEAST
DragonflightUILocalizationData.DF_CHARACTER_PROFESSIONMINING = DF_CHARACTER_PROFESSIONMINING
DragonflightUILocalizationData.DF_PROFESSIONS_SMELTING = DF_PROFESSIONS_SMELTING
