Sign in Join
FPDoc Onlineexperiment

GetLanguageIDFromLocaleName function

In unit Translations

Gets the language identifier found in the specified locale identifier.

Declaration

pascal
function GetLanguageIDFromLocaleName(LocaleName: string): TLanguageID

Arguments

LocaleName

String with the language, region, and optional code page for a locale.

Function result

TLanguageID with the values found in LocaleName.

Description

GetLanguageIDFromLocaleName is a TLanguageID function used to get a language identifier for the values in LocaleName. LocaleName contains a value which consists of the following:

[lang][_region][.codeset][.modifier]
[lang]
Language code (ISO 639-1 or 639-2).
[_region]
Region (ISO 3166 country code).
[.codeset]
Code set (optional/currently ignored).
[.modifier]
Modifier (optional/currently ignored),

For example:

  • EN_US
  • en_GB.UTF-8
  • de_DE
  • es_MX.UTF-8

Values are parsed and stored in the corresponding members in the TLanguageID return value.

GetLanguageIDFromLocaleName is used in the implementation of the GetLanguageID routine for platforms other than Windows.

See also

An experiment, built from development snapshots. Not the official Free Pascal or Lazarus documentation.