UniQueryLanguageName

UniQueryLanguageName returns the name of the language in the language specified.

Syntax
int UniQueryLanguageName (UniChar * language, UniChar * isolang, UniChar * * infoitem)

Parameters

 * language (UniChar *) : The two character ID  of the language to query.
 * isolang (UniChar  *) : The two character ID of the language used to return the language name.
 * infoitem (UniChar  *  *) : A pointer to the language name.

Returns
Return Value (int)  -  returns

UniQueryLanguageName returns one of the following values:


 * ULS_INVALID : The language ID supplied is not known.
 * 0 : is returned upon success and the language name has been returned to the caller.

Remarks
This function only queries system provided locales to determine valid language names.

Example
This example shows how to query a language name. 


 * 1) include 

int main(void) { LocaleObject locale_object = NULL; int         result = 0; int         rc = ULS_SUCCESS; UniChar     *pinfo; UniChar     *languageName; UniChar     *mriLanguage; UniChar     uni_char = L'5';    /* Unicode number 5 character */ /*****************************************************************/   /* Assumes LANG environment variable set to a valid locale name, */ /* such as fr_FR                                                */ /*****************************************************************/   rc = UniCreateLocaleObject(UNI_UCS_STRING_POINTER,                                   (UniChar *)L"", &locale_object); if (rc != ULS_SUCCESS) { printf("UniCreateLocaleObject error: return code = %u\n", rc); return 1; }   /* Determine the language to get the language name in */ rc = UniQueryLocaleItem(locale_object, LOCI_sLanguageID,           &mriLanguage);
 * 1) include 
 * 2) include 

if (rc != ULS_SUCCESS) { printf("UniQueryLocaleItem error: return code = %u\n", rc); return 1; }   /* Get the ISO country ID        rc = UniQueryLocaleItem(locale_object, LOCI_sLanguageID, &pinfo);

if (rc != ULS_SUCCESS) { printf("UniQueryLocaleItem error: return code = %u\n", rc); return 1; }   /* Now we can determine the country name in the proper language */ rc = UniQueryCountryName(pinfo, mriLanguage, &languageName);

if (rc != ULS_SUCCESS) { printf("UniQueryCountryName error: return code = %u\n", rc); return 1; }  printf("Language name is = %ls\n", languageName);

return ULS_SUCCESS; } 

Format

 * 1) include 

int UniQueryLanguageName (UniChar * language, UniChar * isolang, UniChar * * infoitem) 

Related Functions

 * UniQueryCountryName