Thread Tools Display Modes
02-08-12, 07:20 AM   #21
p3lim
A Pyroguard Emberseer
 
p3lim's Avatar
AddOn Author - Click to view addons
Join Date: Feb 2007
Posts: 1,710
I'd use GetCurrentMapAreaID(), that way you don't have to think about localizations.
  Reply With Quote
02-08-12, 07:26 AM   #22
Animor
A Flamescale Wyrmkin
AddOn Author - Click to view addons
Join Date: Mar 2011
Posts: 136
Originally Posted by p3lim View Post
I'd use GetCurrentMapAreaID(), that way you don't have to think about localizations.
Great idea, thanks!
  Reply With Quote
02-08-12, 07:04 PM   #23
Phanx
Cat.
 
Phanx's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2006
Posts: 5,617
For anything that can't use a locale-independent API, just set up localization as usual:

Code:
local L = setmetatable({}, { __index = function(t, k)
	local v = tostring(k)
	rawset(t, k, v)
	return v
end })

if GetLocale() == "deDE" then
	L["Battle for Gilneas"] = "German name here"
	-- etc
end
... and then use localized values for your table keys:

Code:
local hasGlobalInfo = {
	-- BGs in which the first info line is global (not faction score)
	[L["Eye of the Storm"]] = true,
	[L["Twin Peaks"]]       = true,
	[L["Warsong Gulch"]]    = true,
}
See also:
http://forums.wowace.com/showthread.php?t=19658#10
  Reply With Quote

WoWInterface » Developer Discussions » Lua/XML Help » Pattern matching and "player playing" status


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