Thread Tools Display Modes
10-18-18, 06:07 PM   #1
LudiusMaximus
A Rage Talon Dragon Guard
 
LudiusMaximus's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2018
Posts: 320
Locale-independent itemType identification?

Is there a constant for the localized word for "Recipe"?

As GetItemInfo() only returns the localized value for itemType, I cannot think of another way than to hard code the respective word in my addon for every locale.

Any other thoughts?
  Reply With Quote
10-18-18, 06:53 PM   #2
Xrystal
nUI Maintainer
 
Xrystal's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Feb 2006
Posts: 5,892
If its anywhere it will be here.

https://www.townlong-yak.com/framexm...balStrings.lua

Unfortunately the best match is this line...

AUCTION_CATEGORY_RECIPES = "Recipes"

All the others are part of a sentence.
__________________
  Reply With Quote
10-18-18, 07:34 PM   #3
Kanegasi
A Molten Giant
 
Kanegasi's Avatar
AddOn Author - Click to view addons
Join Date: Apr 2007
Posts: 666
The 12th and 13th return from GetItemInfo is an ID that matches the type and subtype of returns 6 and 7 respectively.

Doing some digging, here are the ID variables ingame you can match to the 12th return:

Code:
LE_ITEM_CLASS_ARMOR = 4
LE_ITEM_CLASS_BATTLEPET = 17
LE_ITEM_CLASS_CONSUMABLE = 0
LE_ITEM_CLASS_CONTAINER = 1
LE_ITEM_CLASS_GEM = 3
LE_ITEM_CLASS_GLYPH = 16
LE_ITEM_CLASS_ITEM_ENHANCEMENT = 8
LE_ITEM_CLASS_KEY = 13
LE_ITEM_CLASS_MISCELLANEOUS = 15
LE_ITEM_CLASS_PROJECTILE = 6
LE_ITEM_CLASS_QUESTITEM = 12
LE_ITEM_CLASS_QUIVER = 11
LE_ITEM_CLASS_REAGENT = 5
LE_ITEM_CLASS_RECIPE = 9
LE_ITEM_CLASS_TRADEGOODS = 7
LE_ITEM_CLASS_WEAPON = 2
LE_ITEM_CLASS_WOW_TOKEN = 18

And here are the variables for the 13th return:

Code:
LE_ITEM_ARMOR_CLOTH = 1
LE_ITEM_ARMOR_COSMETIC = 5
LE_ITEM_ARMOR_GENERIC = 0
LE_ITEM_ARMOR_IDOL = 8
LE_ITEM_ARMOR_LEATHER = 2
LE_ITEM_ARMOR_LIBRAM = 7
LE_ITEM_ARMOR_MAIL = 3
LE_ITEM_ARMOR_PLATE = 4
LE_ITEM_ARMOR_RELIC = 11
LE_ITEM_ARMOR_SHIELD = 6
LE_ITEM_ARMOR_SIGIL = 10
LE_ITEM_ARMOR_TOTEM = 9
LE_ITEM_GEM_AGILITY = 1
LE_ITEM_GEM_ARTIFACTRELIC = 11
LE_ITEM_GEM_CRITICALSTRIKE = 5
LE_ITEM_GEM_HASTE = 7
LE_ITEM_GEM_INTELLECT = 0
LE_ITEM_GEM_MASTERY = 6
LE_ITEM_GEM_MULTIPLESTATS = 10
LE_ITEM_GEM_SPIRIT = 4
LE_ITEM_GEM_STAMINA = 3
LE_ITEM_GEM_STRENGTH = 2
LE_ITEM_GEM_VERSATILITY = 8
LE_ITEM_MISCELLANEOUS_COMPANION_PET = 2
LE_ITEM_MISCELLANEOUS_HOLIDAY = 3
LE_ITEM_MISCELLANEOUS_JUNK = 0
LE_ITEM_MISCELLANEOUS_MOUNT = 5
LE_ITEM_MISCELLANEOUS_OTHER = 4
LE_ITEM_MISCELLANEOUS_REAGENT = 1
LE_ITEM_RECIPE_ALCHEMY = 6
LE_ITEM_RECIPE_BLACKSMITHING = 4
LE_ITEM_RECIPE_BOOK = 0
LE_ITEM_RECIPE_COOKING = 5
LE_ITEM_RECIPE_ENCHANTING = 8
LE_ITEM_RECIPE_ENGINEERING = 3
LE_ITEM_RECIPE_FIRST_AID = 7
LE_ITEM_RECIPE_FISHING = 9
LE_ITEM_RECIPE_INSCRIPTION = 11
LE_ITEM_RECIPE_JEWELCRAFTING = 10
LE_ITEM_RECIPE_LEATHERWORKING = 1
LE_ITEM_RECIPE_TAILORING = 2
LE_ITEM_WEAPON_AXE1H = 0
LE_ITEM_WEAPON_AXE2H = 1
LE_ITEM_WEAPON_BEARCLAW = 11
LE_ITEM_WEAPON_BOWS = 2
LE_ITEM_WEAPON_CATCLAW = 12
LE_ITEM_WEAPON_CROSSBOW = 18
LE_ITEM_WEAPON_DAGGER = 15
LE_ITEM_WEAPON_FISHINGPOLE = 20
LE_ITEM_WEAPON_GENERIC = 14
LE_ITEM_WEAPON_GUNS = 3
LE_ITEM_WEAPON_MACE1H = 4
LE_ITEM_WEAPON_MACE2H = 5
LE_ITEM_WEAPON_POLEARM = 6
LE_ITEM_WEAPON_STAFF = 10
LE_ITEM_WEAPON_SWORD1H = 7
LE_ITEM_WEAPON_SWORD2H = 8
LE_ITEM_WEAPON_THROWN = 16
LE_ITEM_WEAPON_UNARMED = 13
LE_ITEM_WEAPON_WAND = 19
LE_ITEM_WEAPON_WARGLAIVE = 9

Usage source from here: https://www.townlong-yak.com/framexm...pFrame.lua#180

Variables are from my own _G dump, they are not declared in the Interface files.

Last edited by Kanegasi : 10-18-18 at 07:52 PM. Reason: added variables
  Reply With Quote
10-18-18, 09:20 PM   #4
Xrystal
nUI Maintainer
 
Xrystal's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Feb 2006
Posts: 5,892
d'oh of course .. been a long time since I looked at those values.

As pointed out by Kanegasi the itemType and itemSubtype are numbers and are not needed to be localized.

The following demonstrates how to return a complete list of localized itemtypes as strings. If you put these into an indexed table and then use the GetItemInfo itemType to retrieve the string value it should ( in theory and if memory servers ) return a localized string of that type. Or the alternative keyed table with the localized string as a key returning the number that relates to that value. You may have to test it out to see if it will suit your requirements.
https://wow.gamepedia.com/API_GetAuctionItemClasses

It may help with retrieving info from the tooltip but that is not something I have personally needed to do so can't confirm there.
__________________
  Reply With Quote
10-19-18, 03:52 PM   #5
LudiusMaximus
A Rage Talon Dragon Guard
 
LudiusMaximus's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2018
Posts: 320
Originally Posted by Kanegasi View Post
The 12th and 13th return from GetItemInfo is an ID that matches the type and subtype of returns 6 and 7 respectively.
Doing some digging, here are the ID variables ingame you can match to the 12th return:
Variables are from my own _G dump, they are not declared in the Interface files.
Hey, thanks a lot!!
I must have been up too late yesterday for not spotting itemClassID in the API of GetItemInfo myself.
So thanks for the hint and especially for your ready-made list of variable names.

Also thanks @Xrystal for sharing your thoughts!
  Reply With Quote
01-18-23, 05:05 AM   #6
LudiusMaximus
A Rage Talon Dragon Guard
 
LudiusMaximus's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2018
Posts: 320
For the record:

The ID variables (e.g. LE_ITEM_CLASS_RECIPE) do not exist any more.
Instead, you now use this Enum table (e.g. Enum.ItemClass.Recipe).

https://wowpedia.fandom.com/wiki/ItemType
__________________
~ Be the change you want to see in the world... of warcraft interface! ~
  Reply With Quote

WoWInterface » Developer Discussions » Lua/XML Help » Locale-independent itemType identification?

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off