This site makes extensive use of JavaScript.
Please enable JavaScript in your browser.
Live
PTR
10.2.7
PTR
10.2.6
Beta
Language change macro
Post Reply
Return to board index
Post by
212325
This post was from a user who has deleted their account.
Post by
Wanderingfox
If you're looking to make a specific phrase be said in a language (in a macro) that's very easy.
SendChatMessage("Message Here", <CHAT TYPE>, <LANGUAGE>, <CHANNEL>);
Where <CHAT TYPE> is "SAY", "PARTY", "RAID", "WHISPER", "CHANNEL"
and <LANGUAGE> is "COMMON", "DARNASSIAN", "DWARVEN", "DRAENEI", "TAURAHE", "ORCISH", "GUTTERSPEAK", "GNOMISH", "TROLL"
<CHANNEL> is only needed with the "WHISPER" and "CHANNEL" chat types. When used with a whisper it's the name of the person you're sending the whisper to, and with channel it's the channel index.
Example:
/script SendChatMessage("Message Here", "SAY", "ORCISH");
/script SendChatMessage("Message Here", "WHISPER", "COMMON", "MyFriendsName");
If you're looking to set the language for all chat, you can use the following:
/script DEFAULT_CHAT_FRAME.editBox.language = GetLanguageByIndex(x)
Where x is the index of the language you want to set it to.
So to toggle between say, orcish and gutterspeak I could do:
/script if DEFAULT_CHAT_FRAME.editBox.language == "ORCISH" then DEFAULT_CHAT_FRAME.editBox.language = GetLanguageByIndex(2); else DEFAULT_CHAT_FRAME.editBox.language = GetLanguageByIndex(1); end
(Note: The above is completely drycoded but should work)
Post by
pelf
/script if DEFAULT_CHAT_FRAME.editBox.language == "ORCISH" then DEFAULT_CHAT_FRAME.editBox.language = GetLanguageByIndex(2); else DEFAULT_CHAT_FRAME.editBox.language = GetLanguageByIndex(1); end
I suppose you could alias GetLanguageByIndex and DEFAULT_CHAT_FRAME.editBox.language and then not have to hard-code "ORCISH" and also probably have room for a few more.
Post by
Wanderingfox
Of course, but like I said it was just a quickly dry coded proof of concept, I wasn't trying to make a compact macro out of it XD
Post by
212325
This post was from a user who has deleted their account.
Post Reply
You are not logged in. Please
log in
to post a reply or
register
if you don't already have an account.