View Single Post
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