WoW:API GetLocale: Difference between revisions

From AddOn Studio
Jump to navigation Jump to search
No edit summary
m (Move page script moved page API GetLocale to API GetLocale without leaving a redirect)
 
(9 intermediate revisions by 9 users not shown)
Line 1: Line 1:
Taken from http://forums.curse-gaming.com/showthread.php?p=1777#post1777
{{wowapi}}Returns information about the client locale.


locale = GetLocale();
== Description ==
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 15:
     -- 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>


== Locales ==


----
* "frFR": French (France)
 
* "deDE": German (Germany)
Known results:<br>
* "enGB": English (Great Britain) ''if returned, can substitute 'enUS' for consistancy''
"frFR": french<br>
* "enUS": English (America)
"deDE": german<br>
* "itIT": Italian (Italy)
"enUS": American english<br>
* "koKR": Korean (Korea) ''RTL - right-to-left''
"enGB": British english<br>
* "zhCN": Chinese (China) (simplified) ''implemented LTR left-to-right in WoW''
"koKR": korean<br>
* "zhTW": Chinese (Taiwan) (traditional) ''implemented LTR left-to-right in WoW''
"zhCN": chinese (simplified)<br>
* "ruRU": Russian (Russia)
"zhTW": chinese (traditional)<br>
* "esES": Spanish (Spain)
"ruRU": russian (UI AddOn)
* "esMX": Spanish (Mexico)
 
* "ptBR": Portuguese (Brazil)
{{template:WoW API}}

Latest revision as of 04:46, 15 August 2023

WoW API < GetLocaleReturns information about the client locale.

locale = GetLocale();

Description

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

Locales

  • "frFR": French (France)
  • "deDE": German (Germany)
  • "enGB": English (Great Britain) if returned, can substitute 'enUS' for consistancy
  • "enUS": English (America)
  • "itIT": Italian (Italy)
  • "koKR": Korean (Korea) RTL - right-to-left
  • "zhCN": Chinese (China) (simplified) implemented LTR left-to-right in WoW
  • "zhTW": Chinese (Taiwan) (traditional) implemented LTR left-to-right in WoW
  • "ruRU": Russian (Russia)
  • "esES": Spanish (Spain)
  • "esMX": Spanish (Mexico)
  • "ptBR": Portuguese (Brazil)