User Guide
618 Chapter 3: ColdFusion Functions
GetLocaleDisplayName
Description
Gets a locale value and displays the name in a manner that is appropriate to a specific locale. By
default, gets the current locale in the current locale’s language.
Returns
The localized display name of the locale, in the language of the specified locale.
Category
Display and formatting functions, International functions, System functions
Function syntax
GetLocaleDisplayName([locale[, inLocale]])
See also
GetLocale
, SetLocale
History
ColdFusion MX 7: Added this function.
Parameters
Example
The following example expands on the GetLocale example to show the use of the
GetLocaleDisplayName function to display locale names in the current locale and in other
locales. It lets you select a locale from all supported locales, changes the ColdFusion MX locale to
the selected locales, and displays the old and new locale names.
<html>
<head>
<title>Displaying locales</title>
</head>
<body>
<h3>Example: Changing and Displaying Locales</h3>
<cfoutput>
<!--- For each new request, the locale gets reset to the JVM locale --->
Initial locale's ColdFusion name: #GetLocale()#<br>
Initial locale's display name: #GetLocaleDisplayName()#<br>
<br>
<!--- Do this only if the form was submitted. --->
<cfif IsDefined("form.mylocale")>
<b>Changing locale to #form.mylocale#</b><br>
Parameter Description
locale The locale whose name you want. The default is the current ColdFusion locale, or if
no ColdFusion locale has been set, the JVM locale.
inlocale The locale in which to return the name. The default is the current ColdFusion locale,
or if no ColdFusion locale has been set, the JVM locale.