getLocale()

Returns the language identifier

Synopsis

string getLocale( int langIdx, int format);

string getLocale( string|OaLanguage lang, int format);

Parameters

Parameter Description
langIdx Index of the language entry
lang string or OaLanguage Enum of the language entry
format

The format can be one of the constants:

  • LOCALE_FORMAT_ISO_WITH_ENCODING e.g.: de_AT.utf8

  • LOCALE_FORMAT_ISO e.g.: de_AT

  • LOCALE_FORMAT_HTTP e.g.: de-AT

Return value

The function returns the Language in the defined format, for example, "de_AT.iso88591" or in the event of an error, an empty string ("").

Error

In the event of a missing argument of the function.

Description

Returns the langs entry of the file config with index langIdx, the given string or the given OaLanguage Enum. The langIdx lies in the range of 0 to the number of languages that are available, minus 1 (query with getNoOfLangs()).

Example

main()
{
  DebugN(getLocale(getActiveLang()));
}

Assignment

Multiligualism

Availability

CTRL