LibBabble-Zone-3.0
From WowAce Wiki
Contents |
[edit]
API Documentation
Note: This documentation is auto-generated. Please note that direct modifications may be overwritten on next autogenerate.
[edit]
:GetBaseLookupTable()
[edit]
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.
[edit]
Returns
A lookup table for english to localized words.
[edit]
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)
[edit]
:GetLookupTable()
[edit]
Notes
- If you try to access a nonexistent key, it will warn but allow the code to pass through.
[edit]
Returns
A lookup table for english to localized words.
[edit]
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!
[edit]
:GetReverseIterator("key")
[edit]
Arguments
- "key"
- string - the localized word to chek for.
[edit]
Returns
An iterator to traverse all English words that map to the given key
[edit]
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
[edit]
:GetReverseLookupTable()
[edit]
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")
[edit]
Returns
A lookup table for localized to english words.
[edit]
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)
[edit]
:GetUnstrictLookupTable()
[edit]
Notes
- If you try to access a nonexistent key, it will return nil.
[edit]
Returns
A lookup table for english to localized words.
[edit]
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)
[edit]
:Iterate()
[edit]
Returns
An iterator to traverse all translations English to localized.
[edit]
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

