getLocaleInfo

Returns a structure containing info to a specific locale. This function combines the locale functions getLocaleCountry, getLocaleDisplayName, and getLocaleLanguage to a single function.

getLocaleInfo() → returns struct

This function requires Lucee. Not supported on Adobe ColdFusion.

getLocaleInfo Argument Reference

locale string
Default: getLocale()

Geographic/language locale value, where the format is a combination of an ISO 639-1 code and an optional ISO 3166-1 code separated by a dash or an underscore.
Values:
  • en
  • de-DE
  • de-CH
  • ...

dspLocale string
Default: getLocaleDisplayName()

Locale's display name/output language
Values:
  • English
  • German
  • French
  • ...

Links more information about getLocaleInfo

Examples sample code invoking the getLocaleInfo function

getLocaleInfo()

Outputs the locale of the page in French.

getLocaleInfo(dspLocale='French').display.country

Expected Result: Etats-Unis

Outputs the German locale in the language defined for the page.

getLocaleInfo(locale='de-DE', dspLocale=getLocaleDisplayName()).display.country

Expected Result: Germany


Fork me on GitHub