-- Localized Functions for the European Version; I am too lazy to exclude the localizations in a more seperate way!
-- Outsorced functions:
-- _GFind

if ( GetLocale() == "deDE" or GetLocale() == "enGB" or GetLocale() == "enUS" or GetLocale() == "frFR") then

	NECB_client_known = true;

	function CEnemyCastBar_Gfind(arg1, event) --Gfind

		if (CEnemyCastBar.bStatus and arg1 and type(arg1) == "string") then
	
			if (NECB_PvP_Module_loaded) then
				CEnemyCastBar_Gfind_PvP(arg1, event); --load on demand
			end

			for mob in string.gmatch(arg1, CEnemyCastBar_MOB_DIES) do

				if (NECB_PvE_death) then -- use func check, because of 2 sec delay if instance entered
					NECB_PvE_death(mob);
				end

				CEnemyCastBar_Control(mob, mob, "died");
				return;
			end

			for spell, mob in string.gmatch(arg1, CEnemyCastBar_SPELL_FADE) do

				CEnemyCastBar_Control(mob, spell, "fades");
				return;
			end


			for spell, mob in string.gmatch(arg1, CEnemyCastBar_SPELL_REMOVED) do

				if (GetLocale() == "deDE") then
					CEnemyCastBar_Control(mob, spell, "fades");
				else
					CEnemyCastBar_Control(spell, mob, "fades");
				end
				return;
			end
		
			if (CEnemyCastBar_Gfind_PvE) then -- use func check, because of 2 sec delay if instance entered
				CEnemyCastBar_Gfind_PvE(arg1, event); --load on demand
			end

			if (NECB_Debuffs_Module_loaded) then

				-- spell miss check for ALL languages (created by GlobalStrings.lua in CECB_Debuffs.lua)
				if (necb_fauxtimer) then

					local spell = necb_fauxtimer[2];
					if (necb_fauxtimer[7]) then
						spell = spell .." ".. necb_fauxtimer[7]; -- rebuild spell's brackets '(feral)', '(cat)' etc.
					end

					for k,v in pairs (necb_spellmisses) do
						for a,b in string.gmatch(arg1, v) do

							--another check, because some other patterns are catched by 'otherself' with german client
							if ((spell == a and necb_fauxtimer[3] == b) or (spell == b and necb_fauxtimer[3] == a) ) then

								CEnemyCastBar_FauxUpdater("clear");--

									--[[
									local down, up, latency = GetNetStats(); -- debug info
									if ((GetTime() - necb_fauxtimer[1]) > 0.20) then
										down = "|cffffaa00";
									else
										down = "";
									end
									DEFAULT_CHAT_FRAME:AddMessage(down..GetTime() - necb_fauxtimer[1] .. "l: "..latency.." v: "..v.." | "..a..", "..b); -- debug info (time fired: 2 - 9ms!)
									CEnemyCastBar_FauxUpdater("clear");
									return; -- only to prevent message below!
									]]--
									
							end
									--DEFAULT_CHAT_FRAME:AddMessage("|cffff0000PENG: "..GetTime() - necb_fauxtimer[1] .. " v: "..v.." | '"..a.."', '"..b.."'".." 1: "..necb_fauxtimer[2].." 2: "..necb_fauxtimer[3]) --
							return;
						end
					end
				end

				CEnemyCastBar_Gfind_Debuffs(arg1, event); --load on demand
			end
	
		end

	end
end