LibBabble-Zone-3.0

From WowAce Wiki
Jump to: navigation, search

API Documentation

Note: This documentation is auto-generated. Please note that direct modifications may be overwritten on next autogenerate.

:GetBaseLookupTable()

Notes

  • If you try to access a nonexistent key, it will return nil.
  • This is useful for checking if the base (English) table has a key, even if the localized one does not have it registered.

Returns

A lookup table for english to localized words.

Example

local B = LibStub("LibBabble-Module-3.0") -- where Module is what you want.
local B_hasBase = B:GetBaseLookupTable()
assert(B_hasBase["Some english word"] == "Some english word")
assert(B_hasBase["Some english word that doesn't exist"] == nil)

:GetLookupTable()

Notes

  • If you try to access a nonexistent key, it will warn but allow the code to pass through.

Returns

A lookup table for english to localized words.

Example

local B = LibStub("LibBabble-Module-3.0") -- where Module is what you want.
local BL = B:GetLookupTable()
assert(BL["Some english word"] == "Some localized word")
DoSomething(BL["Some english word that doesn't exist"]) -- warning!

:GetReverseIterator("key")

Arguments

"key"
string - the localized word to chek for.

Returns

An iterator to traverse all English words that map to the given key

Example

local B = LibStub("LibBabble-Module-3.0") -- where Module is what you want.
for word in B:GetReverseIterator("Some localized word") do
	DoSomething(word)
end

:GetReverseLookupTable()

Notes

  • If you try to access a nonexistent key, it will return nil.
  • This will return only one English word that it maps to, if there are more than one to check, see :GetReverseIterator("word")

Returns

A lookup table for localized to english words.

Example

local B = LibStub("LibBabble-Module-3.0") -- where Module is what you want.
local BR = B:GetReverseLookupTable()
assert(BR["Some localized word"] == "Some english word")
assert(BR["Some localized word that doesn't exist"] == nil)

:GetUnstrictLookupTable()

Notes

  • If you try to access a nonexistent key, it will return nil.

Returns

A lookup table for english to localized words.

Example

local B = LibStub("LibBabble-Module-3.0") -- where Module is what you want.
local B_has = B:GetUnstrictLookupTable()
assert(B_has["Some english word"] == "Some localized word")
assert(B_has["Some english word that doesn't exist"] == nil)

:Iterate()

Returns

An iterator to traverse all translations English to localized.

Example

local B = LibStub("LibBabble-Module-3.0") -- where Module is what you want.
for english, localized in B:Iterate() do
	DoSomething(english, localized)
end