Quantcast

Localization check

Jamie Schembri [02-06-14 - 18:48]
Localization check
Filename
core.lua
diff --git a/core.lua b/core.lua
index c764380..9d6fb83 100644
--- a/core.lua
+++ b/core.lua
@@ -8,9 +8,13 @@ local L = {
 }

 GameTooltip:HookScript("OnShow", function()
-  local tooltipText = GameTooltipTextLeft1
+  local localized = L[GetLocale()]
+
+  -- don't do anything if we don't have a string for this locale
+  if not localized then return end

-  if tooltipText and tooltipText:GetText() == L[GetLocale()] then
+  local tooltipText = GameTooltipTextLeft1
+  if tooltipText and tooltipText:GetText() == localized then
     GameTooltip:Hide()
   end
 end)