11local lastQuestFrameEvent = nil
2+ local macroSpellID = nil
23local translationFrame = CreateFrame (" Frame" )
34local activeItemSpellOrUnitLines = {}
45local activeItemSpellOrUnitId = nil
@@ -495,6 +496,32 @@ local function OnTooltipSetData(self)
495496 local npcTranslationsEnabled = MultiLanguageOptions [" NPC_TRANSLATIONS" ]
496497 local questTranslationsEnabled = MultiLanguageOptions [" QUEST_TRANSLATIONS" ]
497498
499+ if TooltipDataProcessor and TooltipDataProcessor .AddTooltipPostCall then
500+ TooltipDataProcessor .AddTooltipPostCall (TooltipDataProcessor .AllTypes , function (tooltip , data )
501+ macroSpellID = nil
502+
503+ if tooltip ~= GameTooltip then return end
504+ if not data or not data .type then return end
505+
506+ local spellTranslationsEnabled = MultiLanguageOptions [" SPELL_TRANSLATIONS" ]
507+ if not spellTranslationsEnabled then return end
508+
509+ if data .type == Enum .TooltipDataType .Spell then
510+ macroSpellID = data .id
511+ elseif data .type == Enum .TooltipDataType .Macro then
512+ if tooltip .GetPrimaryTooltipData then
513+ local primaryData = tooltip :GetPrimaryTooltipData ()
514+
515+ if primaryData and primaryData .lines then
516+ if primaryData .lines [1 ] then
517+ macroSpellID = primaryData .lines [1 ].tooltipID
518+ end
519+ end
520+ end
521+ end
522+ end )
523+ end
524+
498525 if itemLink and itemTranslationsEnabled then
499526 local itemID = GetItemIDFromLink (itemLink )
500527
@@ -509,8 +536,14 @@ local function OnTooltipSetData(self)
509536 else
510537 TranslationTooltipFrame :Hide ()
511538 end
512- elseif spellID and spellTranslationsEnabled then
513- local spell = GetDataByID (MultiLanguageSpellData , spellID )
539+ elseif (spellID and spellTranslationsEnabled ) or (macroSpellID and spellTranslationsEnabled ) then
540+ local spell = nil
541+
542+ if spellID then
543+ spell = GetDataByID (MultiLanguageSpellData , spellID )
544+ elseif macroSpellID then
545+ spell = GetDataByID (MultiLanguageSpellData , macroSpellID )
546+ end
514547
515548 if spell then
516549 UpdateTranslationTooltipFrame (spell .name , spell .additional_info , spellID , " spell" )
0 commit comments