Syntax

string llGetAgentLanguage( key avatar );

Forced delay: 0.0 seconds. Energy: 10.0.

Parameters

key avatar
avatar UUID that is in the same region

Return value

Returns a string that is the language code of the preferred interface language of the user avatar.

Constants

ReturnDescription
"en"English
"az"Azerbaycanca (Azerbaijani)
"da"Dansk (Danish)
"de"Deutsch (German)
"es"Español (Spanish)
"fr"Français (French)
"it"Italiano (Italian)
"hu"Magyar (Hungarian)
"nl"Nederlands (Dutch)
"pl"Polski (Polish)
"pt"Portugués (Portuguese)
"ru"Русский (Russian)
"tr"Türkçe (Turkish)
"uk"Українська (Ukrainian)
"zh"中文 (简体) (Chinese)
"ja"日本語 (Japanese)
"ko"한국어 (Korean)
If the viewer is set to "System Default" the possible return may not be in this list. See List of ISO 639-1 codes for reference.

The value can also be modified by directly editing the settings.xml file or with debug settings. So the value returned by llGetAgentLanguage may not be an ISO 639-1 value at all.

Caveats

Examples

default{
    touch_start( integer num_detected ){
        //-- loop through all detected touches
        for (num_detected -= 1; num_detected > -1; num_detected -= 1 ){
            key agent = llDetectedKey( num_detected );
            string name = llGetDisplayName( agent );
            string language = llGetAgentLanguage( agent );

            if (("" == name) || ("???" == name))
                name = llDetectedName( num_detected );

            //-- PUBLIC_CHANNEL is 0
            if (language == "es"){
                llSay( PUBLIC_CHANNEL, "¡Hola, " + name + "!" );
            }else if (language == "fr"){
                llSay( PUBLIC_CHANNEL, "Salut, " + name + " !" );
            }else if (language == "ja"){
                llSay( PUBLIC_CHANNEL, "やあ、 " + name + "!" );
            }else if (language == "de"){
                llSay( PUBLIC_CHANNEL, "Hallo, " + name + "!" );
            }else if (language == "en"){ //-- returned by some TPVs
                llSay( PUBLIC_CHANNEL, "Hello, " + name + "!" );
            }else if (language == "pt"){
                llSay( PUBLIC_CHANNEL, "Olá!, " + name + "!" );
            }else if (language == "ko"){
                llSay( PUBLIC_CHANNEL, "안녕하세요, " + name + "!" );
            }else if (language == "zh"){
                llSay( PUBLIC_CHANNEL, "你好啊, " + name + "!" );
            }else{ //-- Default to 'en-us' if language is unrecognized / not provided.
                llSay( PUBLIC_CHANNEL, "Hi there, " + name + "!" );
            }
        }
    }
}

Deep notes

Issues

History