ItemNameDB

ItemNameDB

433 Downloads

ItemNameDB

Library Description:

ItemNameDB consists of 2 parts. A core addon ItemNameDB to translate item links, and a set of localization tables implemented as LoadOnDemand addons named "ItemNameDB_" .. Locale. When loaded each of the localization table addons populates a global map for that locale in ItemNameDB[Locale]. There are no saved variables. The core addon places an ItemNameDB table into the global table to hold the currently loaded locales. It also adds a method in the same table named TranslateItemLink(Link, Locale) where Link is an item link such as one returned by select(2, GetItemInfo(ItemID)) for some cached item and Locale is a locale as if returned by GetLocale().

Link and Locale must not be nil and must be well formed as if sourced from select(2, GetItemInfo(ItemID)) or an incoming chat message. The method returns nil if the item is not found in the table or the tables could not be loaded, and the localized link otherwise. Parts of the link aside from the name are unmodified. Assuming the data is current for your version of the game, the names are fully valid and the translated link is able to be sent through game chat or other systems that validate links. All data is sourced from the World of Warcraft Web API.

Suggested Use Cases:

  • Addon Localization

Addons which use item links in chat might benefit from allowing users to send links in locales other than the user's installed locale. This could help for example when a user who plays the game in a language other than English wishes to play on a primarily English speaking server but would rather send chat links in English so other users can more easily read them.

  • User Generated Content

Whenever a link is displayed from another user, one could translate it to the current locale even if the information from select(2, GetItemInfo(Link)) is not available. Contrast this with localizing outgoing links above.

  • Education and Fun

Discover names of items in new languages and share them with your friends!

Available Locales:

The following locales are available in World of Warcraft. These 4 character strings are suitable arguments for the Locale parameter.

Locale Description
"deDE" German (Federal Republic of Germany)
"enUS" English (United States of America)
"enGB" English (United Kingdom of Great Britain and Northern Ireland)
"esES" Spanish (Kingdom of Spain)
"esMX" Spanish (United Mexican States)
"frFR" French (French Republic)
"itIT" Italian (Republic of Italy)
"koKR" Korean (Republic of Korea)
"ptBR" Portuguese (Federative Republic of Brazil)
"ruRU" Russian (Russian Federation)
"zhCN" Chinese (People's Republic of China)
"zhTW" Chinese (Republic of China)