string llGetAgentLanguage( key avatar );
Forced delay: 0.0 seconds. Energy: 10.0.
Returns a string that is the language code of the preferred interface language of the user avatar.
|
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. |
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 + "!" );
}
}
}
}