WoW:API GetDefaultLanguage: Difference between revisions

From AddOn Studio
Jump to navigation Jump to search
No edit summary
m (Okay, actual {{wowapi}} this time.)
Line 1: Line 1:
<center>'''GetDefaultLanguage''' ''-Documentation by Jackson Colorado-''</center>
{{wowapi}} __NOTOC__
 
Returns the Language used by the indicated Player.
Returns the Language used by the indicated Player.
language = GetDefaultLanguage(unit);


GetDefaultLanguage("player");
==Parameters==
 
===Arguments===
----
:;player : [[UnitId]] - unit whose default language you wish to query.
;''Arguments''
===Returns===
 
:;language : the default language of the indicated object, usually the faction's common language (i.e. "Common" and "Orcish").
:String "player" : I haven't tested this thoroughly yet, but it seems that you can use the same constants that are used in the UnitName() function.  Giving it "player" will return your own default language, for example.
 
----
;''Returns''
 
:String language : the default language of the indicated object.
 
 
----
;''Example''
if( GetDefaultLanguage("player") ~= arg3) then ChatFrame:AddMessage(arg2 .. " is not speaking your language!"); end
 
(Remember, arg2 is the author and arg3 is the language in a standard "MSG" event.)
 
;''Result''
If the player doesn't speak the same language as the person who spoke the message, you get:
 
(author) is not speaking your language!
 
----
;''Description''
 
Returns the Language used by the indicated Player.
 
 
----
{{WoW API}}

Revision as of 00:36, 24 December 2006

WoW API < GetDefaultLanguage

Returns the Language used by the indicated Player.

language = GetDefaultLanguage(unit);

Parameters

Arguments

player
UnitId - unit whose default language you wish to query.

Returns

language
the default language of the indicated object, usually the faction's common language (i.e. "Common" and "Orcish").