Spec-Zone.ru › ColdFusion

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

  • Lucee5+
  • BL 1.0.0+
  • See Also: getLocaleDisplayName getLocale getLocaleCountry getLocaleLanguage

    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

    • ISO-639-1 - Wikipedia page for ISO-639-1
    • ISO-3166-1 - Wikipedia page for ISO-3166-1

    Examples
    Sample code invoking the getLocaleInfo function

    Get information about the page's locale

    getLocaleInfo()

    Output page's locale in a divergent language

    Outputs the language locale of the page in German.

    getLocaleInfo(dspLocale='German').display.language

    Expected Result: Englisch

    Output German locale in a page's language

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

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

    Expected Result: Germany

    © 2012–present Foundeo, Inc. and the CFDocs contributors.
    Licensed under the MIT License.
    ColdFusion is a trademark of Adobe Systems Incorporated.
    https://cfdocs.org/getlocaleinfo

    Spec-Zone.ru

    Настройки Оффлайн Что нового Помощь О нас
    Spec-Zone .ru
    спецификации, руководства, описания, API