API:GetLanguage

__NOTOC__
Check's the client's locale
GetLanguage ( )
== Parameters ==
=== Arguments ===
:None
=== Returns ===
:"PL" - Polish
:;locale
::string - Returns the client's locale:
:::"ENEU" - English (Europe)
:::"ENUS" - English (United States)
:::"DE" - German
:::"FR" - Francais
:::"ES" - Español
:::"CN" - Chinese (China)
:::"TW" - Chinese (Taiwan)
:::"JP" - Japanese
:::"RU" - Russian
:::"PL" - Polish
== Example ==
local MyAddon.location = GetLanguage()
A failsafe version for your addon would be something like:
function MyAddon:GetLanguage()
 local lang=string.upper(_G["GetLanguage"]());
	if lang=="DE" then
		MyAddon.language="DE";
	elseif lang=="ENUS" then --the other supported languages of your addon
		MyAddon.language="ENUS";
	else --fallback to ENEU as default
		MyAddon.language="ENEU";
	end;
	return MyAddon.language;
end;
or
local ClientLanguage = GetLanguage():sub(1,2):upper(); -- No need for two english languages files
local Language = {
	["EN"] = {
		["Hello"] = "Hello World!",
	},
	["DE"] = {
		["Hello"] = "Hallo Welt!",
	},
}
if ( type( Language[ ClientLanguage ] ) ~= "table" ) then -- If your Client Language France or Español
	ClientLanguage = "EN"; -- Default Language
end;
== Notes ==
* If you want to check, which language your client uses, this is the right choice.
== Related Functions ==
Category:Functions