WoW:API GetLocale: Difference between revisions

From AddOn Studio
Jump to navigation Jump to search
(Added spanish locale)
No edit summary
Line 1: Line 1:
{{wowapi}} __NOTOC__
locale = GetLocale();
== Description ==
Taken from http://forums.curse-gaming.com/showthread.php?p=1777#post1777
Taken from http://forums.curse-gaming.com/showthread.php?p=1777#post1777


The locale is what makes it possible to know what language the interface is using and thus determine which specific code is going to be executed in a localized addon.
The locale is what makes it possible to know what language the interface is using and thus determine which specific code is going to be executed in a localized addon.


typically, this is used in a GetLocale block:
Typically, this is used in a GetLocale block:


Code:
== Example ==
 
----


<pre>
if (GetLocale() == "frFR") then
if (GetLocale() == "frFR") then
     -- things for the french client
     -- things for the french client
Line 14: Line 18:
     -- for the rest, usually english since it's the default language
     -- for the rest, usually english since it's the default language
end
end
</pre>


== Known results ==


----
"frFR": French<br>
 
"deDE": German<br>
Known results:<br>
"frFR": french<br>
"deDE": german<br>
"enUS": American english<br>
"enUS": American english<br>
"enGB": British english<br>
"enGB": British english<br>
"koKR": korean<br>
"koKR": Korean<br>
"zhCN": chinese (simplified)<br>
"zhCN": Chinese (simplified)<br>
"zhTW": chinese (traditional)<br>
"zhTW": Chinese (traditional)<br>
"ruRU": russian (UI AddOn)<br>
"ruRU": Russian (UI AddOn)<br>
"esES": spanish<br>
"esES": Spanish<br>
 
{{template:WoW API}}

Revision as of 17:21, 31 October 2006

WoW API < GetLocale

locale = GetLocale();

Description

Taken from http://forums.curse-gaming.com/showthread.php?p=1777#post1777

The locale is what makes it possible to know what language the interface is using and thus determine which specific code is going to be executed in a localized addon.

Typically, this is used in a GetLocale block:

Example

if (GetLocale() == "frFR") then
    -- things for the french client
else
    -- for the rest, usually english since it's the default language
end

Known results

"frFR": French
"deDE": German
"enUS": American english
"enGB": British english
"koKR": Korean
"zhCN": Chinese (simplified)
"zhTW": Chinese (traditional)
"ruRU": Russian (UI AddOn)
"esES": Spanish