Difference between revisions of "LlGetAgentLanguage"

From Second Life Wiki
Jump to navigation Jump to search
m
m
Line 6: Line 6:
|return_text=that is the language code of the preferred language of the user '''avatar'''.  
|return_text=that is the language code of the preferred language of the user '''avatar'''.  
|func_desc
|func_desc
|func_footnote=<!--The value returned is the same as the directory name of the XUI skin the user has selected. The value may not necessarily be one of those list below.-->
|func_footnote
|caveats=*If the user has "{{HoverText|Share language with objects|LanguageIsPublic}}" disabled then this function returns an empty string.
|caveats=*If the user has "{{HoverText|Share language with objects|LanguageIsPublic}}" disabled then this function returns an empty string.
|examples=<lsl>default {
|examples=<lsl>default {
Line 28: Line 28:
                 llSay(0,"Hallo, "+name+"!");
                 llSay(0,"Hallo, "+name+"!");
             }else if(lang=="pt") {
             }else if(lang=="pt") {
                 llSay(0,"Czesc, "+name+"!");
                 llSay(0,"Olá!, "+name+"!");
             }else if(lang=="ko") {
             }else if(lang=="ko") {
                 llSay(0,"안녕하세요, "+name+"!");
                 llSay(0,"안녕하세요, "+name+"!");

Revision as of 12:57, 6 July 2008

Emblem-important-red.png Pre-release Documentation Warning!

This function is not available yet. This documentation was written prior to its final release so it may not match the final implementation.

Summary

Function: string llGetAgentLanguage( key avatar );

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

• key avatar avatar UUID that is in the same region

Return Description
"en" English
"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)

Caveats

  • If the user has "Share language with objects" disabled then this function returns an empty string.
All Issues ~ Search JIRA for related Bugs

Examples

<lsl>default {

   state_entry() {
   }
   touch_start(integer n) {
       integer i;
       for(i=0;i<n;i++) {
           string name=llDetectedName(i);
           string lang=llGetAgentLanguage(llDetectedKey(i));
           if(lang=="") lang="en-us"; // Default to English.
           if(lang=="en-us") {
               llSay(0,"Hi there, "+name+"!");
           }else if(lang=="es") {
               llSay(0,"Hola, "+name+"!");
           }else if(lang=="fr") {
               llSay(0,"Salut, "+name+"!");
           }else if(lang=="ja") {
               llSay(0,"やあ、 "+name+"!");
           }else if(lang=="de") {
               llSay(0,"Hallo, "+name+"!");
           }else if(lang=="pt") {
               llSay(0,"Olá!, "+name+"!");
           }else if(lang=="ko") {
               llSay(0,"안녕하세요, "+name+"!");
           }else if(lang=="zh") {
               llSay(0,"喜有, "+name+"!");
           }
       }
   }

}

</lsl>

Deep Notes

History

Search JIRA for related Issues

Signature

function string llGetAgentLanguage( key avatar );