os_get_language

This function returns a string with the two letter Language Code for the OS that is running the game, as set by the ISO639 standard. If the information is not available, it will hold simply an empty string "", or "en" for "English" language. Note that some languages also have a relevant Regional Code too, so to distinguish between different regions of the same country use the function os_get_region().

The following table shows example of some of the main two letter language codes as defined by ISO 639:

LanguageCode
Arabicar
Chinesezh
Danishda
Englishen
Frenchfr
Germande
Greekel
Italianit
Japaneseja
Norwegianno
Polishpl
Portuguesept
Russianru
Spanishes
Swedishsv

 

NOTE: This is not the location country code that is returned, but the language code of the OS.

 

Syntax:

os_get_language()

 

Returns:

String

 

Example:

switch (os_get_language())
{
    case "es": ini_open("spanish.ini"); break;
    case "fr": ini_open("french.ini"); break;
    case "it": ini_open("italian.ini"); break;
    default: ini_open("english.ini"); break;
}

The above code checks the OS language and opens a different *.ini file depending on the returned value.