
if (GetLocale() == "zhCN") then
	RAID_TOOLKIT_TITLE = {"团队工具", "tuanduigongju"};

	RECOUNT_ENABLE_TEXT = "开启伤害统计 (|cff808080Recount|r)";
	DBM_ENABLE_TEXT = "开启首领报警模块 (|cff808080DBM|r)";
	GRID_ENABLE_TEXT = "开启团队框架 (|cff808080Grid|r)";
	ORA2_ENABLE_TEXT = "开启团队助手 (|cff808080oRA2|r)";
	DECURSIVE_ENABLE_TEXT = "开启一键驱散 (|cff808080Decursive|r)";
	THREAT_ENABLE_TEXT = "开启仇恨统计 (|cff808080Omen2|r)";

	DBM_DISABLE_DELAY_TEXT = "|cff00c0c0<首领报警>|r 你已经关闭首领报警(DBM)模块，该设置将在下次插件载入时生效。";
	GRID_DISABLE_DELAY_TEXT = "|cff00c0c0<团队框架>|r 你已经关闭团队框架(Grid)模块，该设置将在下次插件载入时生效。";
	ORA2_DISABLE_DELAY_TEXT = "|cff00c0c0<团队助手>|r 你已经关闭团队助手(oRA2)模块，该设置将在下次插件载入时生效。";
	DECURSIVE_DISABLE_DELAY_TEXT = "|cff00c0c0<一键驱散>|r 你已经关闭一键驱散(Decursive)模块，该设置将在下次插件载入时生效。";
	RECOUNT_DISABLE_DELAY_TEXT = "|cff00c0c0<伤害统计>|r 你已经关闭伤害统计(Recount)模块，该设置将在下次插件载入时生效。";
	THREAT_DISABLE_DELAY_TEXT = "|cff00c0c0<仇恨统计>|r 你已经关闭仇恨统计(Omen2)模块，该设置将在下次插件载入时生效。";
elseif (GetLocale() == "zhTW") then
	RAID_TOOLKIT_TITLE = {"團隊工具", "tuanduigongju"};

	RECOUNT_ENABLE_TEXT = "開啟傷害統計 (|cff808080Recount|r)";
	DBM_ENABLE_TEXT = "開啟首領報警模組 (|cff808080DBM|r)";
	GRID_ENABLE_TEXT = "開啟團隊框架 (|cff808080Grid|r)";
	ORA2_ENABLE_TEXT = "開啟團隊助手 (|cff808080oRA2|r)";
	DECURSIVE_ENABLE_TEXT = "開啟一鍵驅散 (|cff808080Decursive|r)";
	THREAT_ENABLE_TEXT = "開啟仇恨統計 (|cff808080Omen2|r)";

	DBM_DISABLE_DELAY_TEXT = "|cff00c0c0<首領報警>|r 你已經關閉首領報警(DBM)模組，該設置將在下次外掛程式載入時生效。";
	GRID_DISABLE_DELAY_TEXT = "|cff00c0c0<團隊框架>|r 你已經關閉團隊框架(Grid)模組，該設置將在下次外掛程式載入時生效。";
	ORA2_DISABLE_DELAY_TEXT = "|cff00c0c0<團隊助手>|r 你已經關閉團隊助手(oRA2)模組，該設置將在下次外掛程式載入時生效。";
	DECURSIVE_DISABLE_DELAY_TEXT = "|cff00c0c0<一鍵驅散>|r 你已經關閉一鍵驅散(Decursive)模組，該設置將在下次外掛程式載入時生效。";
	RECOUNT_DISABLE_DELAY_TEXT = "|cff00c0c0<傷害統計>|r 你已經關閉傷害統計(Recount)模組，該設置將在下次外掛程式載入時生效。";
	THREAT_DISABLE_DELAY_TEXT = "|cff00c0c0<仇恨統計>|r 你已經關閉仇恨統計(Omen2)模組，該設置將在下次外掛程式載入時生效。";
else
	RAID_TOOLKIT_TITLE = "Raid Toolkit";

	RECOUNT_ENABLE_TEXT = "Enable Recount";
	DBM_ENABLE_TEXT = "Enable Boss Mod (DBM)";
	GRID_ENABLE_TEXT = "Enable Grid";
	ORA2_ENABLE_TEXT = "Enable oRA2";
	DECURSIVE_ENABLE_TEXT = "Enable Decursive";
	THREAT_ENABLE_TEXT = "Enable Omen2";

	DBM_DISABLE_DELAY_TEXT = "|cff00c0c0<DBM>|r DBM has been disabled. This setting will be available next time.";
	GRID_DISABLE_DELAY_TEXT = "|cff00c0c0<Grid>|r Grid has been disabled. This setting will be available next time.";
	ORA2_DISABLE_DELAY_TEXT = "|cff00c0c0<oRA2>|r oRA2 has been disabled. This setting will be available next time.";
	DECURSIVE_DISABLE_DELAY_TEXT = "|cff00c0c0<Descursive>|r Descursive has been disabled. This setting will be available next time.";
	RECOUNT_DISABLE_DELAY_TEXT = "|cff00c0c0<Recount>|r Recount has been disabled. This setting will be available next time.";
	THREAT_DISABLE_DELAY_TEXT = "|cff00c0c0<Omen>|r Omen has been disabled. This setting will be available next time.";
end

if (IsConfigurableAddOn("Recount") or IsConfigurableAddOn("DBM_API") or IsConfigurableAddOn("Omen") or IsConfigurableAddOn("Grid") or IsConfigurableAddOn("oRA2")) then
	ModManagement_RegisterMod(
		"RaidToolkit",
		"Interface\\Icons\\INV_Bijou_Orange",
		RAID_TOOLKIT_TITLE
	);
end

if (IsConfigurableAddOn("Recount")) then

	ModManagement_RegisterCheckBox(
		"RaidToolkit",
		RECOUNT_ENABLE_TEXT,
		nil,
		"EnableRecount",
		0,
		function (arg)
			if (arg == 1) then
				if (not IsAddOnLoaded("Recount")) then
					LoadAddOn("Recount");
				end
			else
				if (IsAddOnLoaded("Recount")) then
					BigFoot_RequestReloadUI(function() BigFoot_Print(RECOUNT_DISABLE_DELAY_TEXT); end);
				end
			end
		end
	);
end

if (IsConfigurableAddOn("DBM_API")) then
	ModManagement_RegisterCheckBox(
		"RaidToolkit",
		DBM_ENABLE_TEXT,
		nil,
		"EnableDBM",
		0,
		function (arg)
			if (arg == 1) then
				if (not IsAddOnLoaded("DBM_API")) then
					LoadAddOn("DBM_API");
				end
			else
				if (IsAddOnLoaded("DBM_API")) then
					BigFoot_RequestReloadUI(function() BigFoot_Print(DBM_DISABLE_DELAY_TEXT); end);
				end
			end
		end
	);
end

if (IsConfigurableAddOn("Grid")) then
	ModManagement_RegisterCheckBox(
		"RaidToolkit",
		GRID_ENABLE_TEXT,
		nil,
		"EnableGrid",
		0,
		function (arg)
			if (arg == 1) then
				if (not IsAddOnLoaded("Grid")) then
					LoadAddOn("Grid");
				end

				if (IsAddOnLoaded("Grid")) then
					Grid:Enable();
				end
			else
				if (IsAddOnLoaded("Grid")) then
					BigFoot_RequestReloadUI(function() BigFoot_Print(GRID_DISABLE_DELAY_TEXT); end);
				end
			end
		end
	);
end

if (IsConfigurableAddOn("oRA2")) then
	ModManagement_RegisterCheckBox(
		"RaidToolkit",
		ORA2_ENABLE_TEXT,
		nil,
		"EnableoRA2",
		0,
		function (arg)
			if (arg == 1) then
				if (not IsAddOnLoaded("oRA2")) then
					LoadAddOn("oRA2");
				end
			else
				if (IsAddOnLoaded("oRA2")) then
					BigFoot_RequestReloadUI(function() BigFoot_Print(ORA2_DISABLE_DELAY_TEXT); end);
				end
			end
		end
	);
end

if (IsConfigurableAddOn("Decursive")) then
	ModManagement_RegisterCheckBox(
		"RaidToolkit",
		DECURSIVE_ENABLE_TEXT,
		nil,
		"EnableDecursive",
		0,
		function (arg)
			if (arg == 1) then
				if (not IsAddOnLoaded("Decursive")) then
					LoadAddOn("Decursive");
				end
			else
				if (IsAddOnLoaded("Decursive")) then
					BigFoot_RequestReloadUI(function() BigFoot_Print(DECURSIVE_DISABLE_DELAY_TEXT); end);
				end
			end
		end
	);
end

if (IsConfigurableAddOn("Omen")) then
	ModManagement_RegisterCheckBox(
		"RaidToolkit",
		THREAT_ENABLE_TEXT,
		nil,
		"EnableThreat",
		0,
		function (arg)
			if (arg == 1) then
				if (not IsAddOnLoaded("Omen")) then
					LoadAddOn("Omen");
				end
			else
				if (IsAddOnLoaded("Omen")) then
					BigFoot_RequestReloadUI(function() BigFoot_Print(THREAT_DISABLE_DELAY_TEXT); end);
				end
			end
		end
	);
end