I was fiddling with the github code for this extension, and I think I have a solution for handling portraits when chatting in languages.
If you add the following to the onDesktopInit() function:
Code:
if User.isHost() then
origCommDeliverOOBMesssage = Comm.deliverOOBMessage;
Comm.deliverOOBMessage = myDeliverOOBMessage;
end
And then add this new function, it should display the character portraits for language chat.
Code:
function myDeliverOOBMessage(msg, extra)
if (msg.type == LanguageManager.OOB_MSGTYPE_LANGCHAT) then
insertPortraitToMessage(msg, extra);
end
origCommDeliverOOBMesssage(msg, extra);
end
The challenge was the LanguageManager registers a callback for the ChatManager DeliverMessageCallback and it takes precedence over any callback added by an extension, so the portrait insertion had to be handled afterwards. The LanguageManager calls Comm.deliverOOBMessage after it does the "translation" of a language chat message, so we need to intercept that call, insert the portrait, and then call the real OOBMessage function.
Also, for this work-around, the portrait should only be inserted if the message is originating on the GM host - if a real player is chatting in a language, the icon should already be correct and if the insertPortraitMessage() function were to be called by a player, it instead turns the icon into the GM's token.
It all seems to work in my local testing, but I'd recommend more extensive testing in case I overlooked something.
Cheers,
Brian