local ENABLE_iWOWQuery;
local iWOWQuery_MOD_TITLE;
if (GetLocale() == "zhCN") then
	ENABLE_iWOWQuery = "启用任务查询";	
	iWOWQuery_MOD_TITLE = {"任务查询", "renwuchaxun"};
elseif (GetLocale() == "zhTW") then
	ENABLE_iWOWQuery = "啟用任務查詢";
	iWOWQuery_MOD_TITLE = {"任務查詢", "renwuchaxun"};
else 
	ENABLE_iWOWQuery = "Enable iWoWQuery";	
	iWOWQuery_MOD_TITLE = "Quest Query";
end

if ((GetLocale() == "zhCN" or GetLocale() == "zhTW") and IsConfigurableAddOn("iWOWQuery")) then
	ModManagement_RegisterMod(
		"iWOWQuery",
		"Interface\\Icons\\INV_Misc_Note_02",
		iWOWQuery_MOD_TITLE,
		"",
		nil
	);
	ModManagement_RegisterCheckBox(
		"iWOWQuery",
		ENABLE_iWOWQuery,
		nil,
		"EnableiWOWQuery",
		1,
		function (arg)
			if (arg == 1) then
				if (not IsAddOnLoaded("iWOWQuery")) then
					LoadAddOn("iWOWQuery");					
				end
				
				if (IsAddOnLoaded("iWOWQuery")) then
					QuestLibrary_Toggle(true);									
				end
			else
				if (IsAddOnLoaded("iWOWQuery")) then
					QuestLibrary_Toggle(false);									
				end
			end
		end
	);
end