local BIGFOOTGATHER;
local BIGFOOTGATHER_ENABLE;
if (GetLocale() == "zhCN") then
	BIGFOOTGATHER = {"采集助手", "caijizhushou"};
	BIGFOOTGATHER_ENABLE = "启用大脚采集助手";
elseif (GetLocale() == "zhTW") then
	BIGFOOTGATHER = {"采集助手", "caijizhushou"};
	BIGFOOTGATHER_ENABLE = "啓用大腳采集助手";
else
	BIGFOOTGATHER = "BigFoot Gather";
	BIGFOOTGATHER_ENABLE = "Enable BigFoot Gather";
end

local function BFG_DelayShow()
	if (BIGFOOTGATHER_LOADED) then
		BFG_Toggle(1);
		BFG_Option_Toggle(1);
		ModManagement_Refresh();
	else
		BigFoot_DelayCall(BFG_DelayShow, 0.1);
	end
end

if (IsAddOnLoadOnDemand("BigFootGather")) then
	ModManagement_RegisterMod(
		"BigFootGather",
		"Interface\\ICONS\\Spell_Nature_SpiritArmor.blp",		
		BIGFOOTGATHER,
		"",
		nil,
		{["frame"] = "BigFootOptionFrame", ["offsetx"] = 300, ["offsety"] = -75}
	);	
	ModManagement_RegisterCheckBox(
		"BigFootGather",
		BIGFOOTGATHER_ENABLE,
		nil,
		"EnableBigFootGather",
		1,
		function (arg)
			if (arg == 1) then
				if (not IsAddOnLoaded("BigFootGather")) then
					LoadAddOn("BigFootGather");
				end
				if (IsAddOnLoaded("BigFootGather")) then
					BFG_DelayShow();
				end
			else
				if (IsAddOnLoaded("BigFootGather")) then
					BFG_Toggle(false);	
					BFG_Option_Toggle(false);
				end
			end
		end
	);
end




