View Single Post
05-30-21, 02:23 PM   #13
Ketho
A Pyroguard Emberseer
 
Ketho's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2010
Posts: 1,026
Slight necro since this pops up in google

The mentioned Globalstrings won't work since those are flagged for gluescreens only
You can get the localized names from wow.tools

https://github.com/Ketho/WoWtoolsPar...ssionNames.lua
Lua Code:
  1. local ProfessionNames = {
  2.     enUS = {
  3.         [164] = "Blacksmithing",
  4.         [165] = "Leatherworking",
  5.         [171] = "Alchemy",
  6.         [182] = "Herbalism",
  7.         [185] = "Cooking",
  8.         [186] = "Mining",
  9.         [197] = "Tailoring",
  10.         [202] = "Engineering",
  11.         [333] = "Enchanting",
  12.         [356] = "Fishing",
  13.         [393] = "Skinning",
  14.         [755] = "Jewelcrafting",
  15.         [773] = "Inscription",
  16.     },
  17.     deDE = {
  18.         [164] = "Schmiedekunst",
  19.         [165] = "Lederverarbeitung",
  20.         [171] = "Alchemie",
  21.         [182] = "Kräuterkunde",
  22.         [185] = "Kochkunst",
  23.         [186] = "Bergbau",
  24.         [197] = "Schneiderei",
  25.         [202] = "Ingenieurskunst",
  26.         [333] = "Verzauberkunst",
  27.         [356] = "Angeln",
  28.         [393] = "Kürschnerei",
  29.         [755] = "Juwelierskunst",
  30.         [773] = "Inschriftenkunde",
  31.     },
  32.     frFR = {
  33.         [164] = "Forge",
  34.         [165] = "Travail du cuir",
  35.         [171] = "Alchimie",
  36.         [182] = "Herboristerie",
  37.         [185] = "Cuisine",
  38.         [186] = "Minage",
  39.         [197] = "Couture",
  40.         [202] = "Ingénierie",
  41.         [333] = "Enchantement",
  42.         [356] = "Pêche",
  43.         [393] = "Dépeçage",
  44.         [755] = "Joaillerie",
  45.         [773] = "Calligraphie",
  46.     },
  47.     esMX = {
  48.         [164] = "Herrería",
  49.         [165] = "Peletería",
  50.         [171] = "Alquimia",
  51.         [182] = "Herboristería",
  52.         [185] = "Cocina",
  53.         [186] = "Minería",
  54.         [197] = "Sastrería",
  55.         [202] = "Ingeniería",
  56.         [333] = "Encantamiento",
  57.         [356] = "Pesca",
  58.         [393] = "Desuello",
  59.         [755] = "Joyería",
  60.         [773] = "Inscripción",
  61.     },
  62.     ptBR = {
  63.         [164] = "Ferraria",
  64.         [165] = "Couraria",
  65.         [171] = "Alquimia",
  66.         [182] = "Herborismo",
  67.         [185] = "Culinária",
  68.         [186] = "Mineração",
  69.         [197] = "Alfaiataria",
  70.         [202] = "Engenharia",
  71.         [333] = "Encantamento",
  72.         [356] = "Pesca",
  73.         [393] = "Esfolamento",
  74.         [755] = "Joalheria",
  75.         [773] = "Escrivania",
  76.     },
  77.     ruRU = {
  78.         [164] = "Кузнечное дело",
  79.         [165] = "Кожевничество",
  80.         [171] = "Алхимия",
  81.         [182] = "Травничество",
  82.         [185] = "Кулинария",
  83.         [186] = "Горное дело",
  84.         [197] = "Портняжное дело",
  85.         [202] = "Инженерное дело",
  86.         [333] = "Наложение чар",
  87.         [356] = "Рыбная ловля",
  88.         [393] = "Снятие шкур",
  89.         [755] = "Ювелирное дело",
  90.         [773] = "Начертание",
  91.     },
  92.     zhCN = {
  93.         [164] = "锻造",
  94.         [165] = "制皮",
  95.         [171] = "炼金术",
  96.         [182] = "草药学",
  97.         [185] = "烹饪",
  98.         [186] = "采矿",
  99.         [197] = "裁缝",
  100.         [202] = "工程学",
  101.         [333] = "附魔",
  102.         [356] = "钓鱼",
  103.         [393] = "剥皮",
  104.         [755] = "珠宝加工",
  105.         [773] = "铭文",
  106.     },
  107.     zhTW = {
  108.         [164] = "鍛造",
  109.         [165] = "製皮",
  110.         [171] = "鍊金術",
  111.         [182] = "草藥學",
  112.         [185] = "烹飪",
  113.         [186] = "採礦",
  114.         [197] = "裁縫",
  115.         [202] = "工程學",
  116.         [333] = "附魔",
  117.         [356] = "釣魚",
  118.         [393] = "剝皮",
  119.         [755] = "珠寶設計",
  120.         [773] = "銘文學",
  121.     },
  122.     koKR = {
  123.         [164] = "대장기술",
  124.         [165] = "가죽세공",
  125.         [171] = "연금술",
  126.         [182] = "약초채집",
  127.         [185] = "요리",
  128.         [186] = "채광",
  129.         [197] = "재봉술",
  130.         [202] = "기계공학",
  131.         [333] = "마법부여",
  132.         [356] = "낚시",
  133.         [393] = "무두질",
  134.         [755] = "보석세공",
  135.         [773] = "주문각인",
  136.     },
  137. }

Here is an example for getting localized profession names
Lua Code:
  1. local profNames = ProfessionNames[GetLocale()]
  2. print(profNames[185]) -- "Cooking"

and for going through the list of profession skills.
Lua Code:
  1. local profNames = ProfessionNames[GetLocale()]
  2. local profNames_rev = tInvert(profNames)
  3.  
  4. for i = 1, GetNumSkillLines() do
  5.     local name, _, _, skillRank = GetSkillLineInfo(i)
  6.     if profNames_rev[name] then
  7.         print(name, skillRank)
  8.     end
  9. end


The table structure is not ideal for every situation so consider changing it if needed and/or using enums
Lua Code:
  1. local profNames = ProfessionNames[GetLocale()]
  2. local enums = {
  3.         Cooking = 185,
  4.         Engineering = 202,
  5. }
  6. print(profNames[enums.Cooking])

Last edited by Ketho : 05-30-21 at 02:46 PM.
  Reply With Quote