local __L = BLocal("ItemInfo");

if (GetLocale() == "zhCN") then
	__L["Item Info"]				= {"物品信息", "wupinxinxi"};	
	__L["Enable Auction Helper"]	= "启用拍卖助手";
	__L["Enable Item Info"]			= "启用物品信息";
	__L["Enable SellValue"]			= "显示物品出售价格";
	__L["Enable AuctionInfo"]		= "显示物品的拍卖行信息";
	__L["Enable ItemLevel"]			= "显示物品的等级";
	__L["Enable StackCount"]		= "显示物品的可堆叠数";
	__L["Enable UseInfo"]			= "显示物品用途";
	__L["Enable GemInfo"]			= "显示宝石信息";
	__L["Enable Qulity"]			= "显示物品质量";
elseif (GetLocale() == "zhTW") then
	__L["Item Info"]				= {"物品信息", "wupinxinxi"};
	__L["Enable Auction Helper"]	= "啟用拍賣助手";
	__L["Enable Item Info"]			= "啟用物品信息";
	__L["Enable SellValue"]			= "顯示物品出售價格";
	__L["Enable AuctionInfo"]		= "顯示物品的拍賣行資訊";
	__L["Enable ItemLevel"]			= "顯示物品的等級";
	__L["Enable StackCount"]		= "顯示物品的可堆疊數";
	__L["Enable UseInfo"]			= "顯示物品用途";
	__L["Enable GemInfo"]			= "顯示寶石信息";
	__L["Enable Qulity"]			= "顯示物品質量";
end
	
if (IsConfigurableAddOn("ItemInfo")) then
	ModManagement_RegisterMod( 
		"Item Info", 
		"Interface\\ICONS\\INV_Relics_LibramofGrace.blp", 
		__L["Item Info"], 
		"", 
		nil, 
		nil
	);

	ModManagement_RegisterCheckBox(
		"Item Info",
		__L["Enable Item Info"],
		nil,
		"EnableItemInfo",
		1,
		function (__arg)
			if (__arg == 1) then
				if (not IsAddOnLoaded("ItemInfo")) then
					LoadAddOn("ItemInfo");
				end

				if (IsAddOnLoaded("ItemInfo")) then
					ItemInfo_Toggle(true);
				end
			else
				if (IsAddOnLoaded("ItemInfo")) then
					ItemInfo_Toggle(false);
				end
			end
		end
	);
	ModManagement_RegisterCheckBox(
		"Item Info",
		__L["Enable SellValue"],
		nil,
		"EnableSellValue",
		1,
		function (__arg)
			if (IsAddOnLoaded("ItemInfo")) then
				if (__arg == 1) then				
					II_Config['SellValue'] = 1;
				else				
					II_Config['SellValue'] = nil;		
				end
			end
		end,
		1
	);
	ModManagement_RegisterCheckBox(
		"Item Info",
		__L["Enable AuctionInfo"],
		nil,
		"EnableAuctionInfo",
		1,
		function (__arg)
			if (IsAddOnLoaded("ItemInfo")) then
				if (__arg == 1) then				
					II_Config['AuctionInfo'] = 1;
				else				
					II_Config['AuctionInfo'] = nil;		
				end
			end
		end,
		1
	);
	ModManagement_RegisterCheckBox(
		"Item Info",
		__L["Enable ItemLevel"],
		nil,
		"EnableItemLevel",
		1,
		function (__arg)
			if (IsAddOnLoaded("ItemInfo")) then
				if (__arg == 1) then				
					II_Config['ItemLevel'] = 1;
				else				
					II_Config['ItemLevel'] = nil;		
				end
			end
		end,
		1
	);
	ModManagement_RegisterCheckBox(
		"Item Info",
		__L["Enable StackCount"],
		nil,
		"EnableStackCount",
		1,
		function (__arg)
			if (IsAddOnLoaded("ItemInfo")) then
				if (__arg == 1) then				
					II_Config['StackCount'] = 1;
				else				
					II_Config['StackCount'] = nil;		
				end
			end
		end,
		1
	);
	ModManagement_RegisterCheckBox(
		"Item Info",
		__L["Enable UseInfo"],
		nil,
		"EnableUseInfo",
		1,
		function (__arg)
			if (IsAddOnLoaded("ItemInfo")) then
				if (__arg == 1) then				
					II_Config['UseInfo'] = 1;
				else				
					II_Config['UseInfo'] = nil;		
				end
			end
		end,
		1
	);
	ModManagement_RegisterCheckBox(
		"Item Info",
		__L["Enable GemInfo"],
		nil,
		"EnableGemInfo",
		1,
		function (__arg)
			if (IsAddOnLoaded("ItemInfo")) then
				if (__arg == 1) then				
					II_Config['GemInfo'] = 1;
				else				
					II_Config['GemInfo'] = nil;		
				end
			end
		end,
		1
	);
	ModManagement_RegisterCheckBox(
		"Item Info",
		__L["Enable Qulity"],
		nil,
		"EnableQulity",
		nil,
		function (__arg)
			if (IsAddOnLoaded("ItemInfo")) then
				if (__arg == 1) then				
					II_Config['ItemQulity'] = 1;
				else				
					II_Config['ItemQulity'] = nil;		
				end
			end
		end,
		1
	);
	
	ModManagement_RegisterCheckBox(
		"Item Info",
		__L["Enable Auction Helper"],
		nil,
		"EnableAuctionHelper",
		1,
		function (__arg)
			if (__arg == 1) then
				if (not IsAddOnLoaded("ItemInfo")) then
					LoadAddOn("ItemInfo");
				end

				if (IsAddOnLoaded("ItemInfo")) then
					ItemInfo_AuctionToggle(true);
				end
			else
				if (IsAddOnLoaded("ItemInfo")) then
					ItemInfo_AuctionToggle(false);
				end
			end
		end			
	);
end
	