Adobe COLDFUSION 9 Manual page 374

Developing applications
Hide thumbs Also See for COLDFUSION 9:
Table of Contents

Advertisement

DEVELOPING COLDFUSION 9 APPLICATIONS
Developing CFML Applications
For example, en_US represents United States English and es_MX represents Mexican Spanish. For a list of the
Java locale identifiers supported in the Sun 1.4.2 JVM and their meanings, see
http://java.sun.com/j2se/1.4.2/docs/guide/intl/locale.doc.html.
Previous to ColdFusion MX 7, ColdFusion supported a limited set of locales, and used identifiers that consisted of the
name of the language, followed, for most languages, by a regional identifier in parentheses, such as English (US) or
German (Standard). ColdFusion continues to support these names; for a list, see
The
Server.coldfusion.supportedlocales
specify.
ColdFusion also includes a
GetLocaleDisplayName
to users. It lets you display the locale using words in the user's language; for example, français (France).
Determining the locale
ColdFusion determines the locale value as follows:
• By default, ColdFusion uses the JVM locale, and the default JVM locale is the operating system locale. You can set
the JVM locale value explicitly in ColdFusion in the JVM Arguments field on the Java and JVM Settings page in the
ColdFusion Administrator; for example:
-Duser.language=de -Duser.country=DE.
• A locale set using the
SetLocale
function in the request.
• If a request has multiple
SetLocale
tags and functions (such as the functions that start with LS) format data. The last
ColdFusion processes before sending a response to the requestor (typically the client browser) determines the value
of the response
Content-Language
according to the rules for the language specified by the
• ColdFusion ignores any
SetLocale
Using the locale
The
function determines the default formats that ColdFusion uses to output date, time, number, and
SetLocale
currency values. You use the
use the
GetLocaleDisplayName
not made a call to
SetLocale
The current locale has two effects:
• When ColdFusion formats date, time, currency, or numeric output, it determines how to format the output. You
can change the locale multiple times on a ColdFusion page to format information according to different locale
conventions. This enables you to output a page that properly formats different currency values, for example.
• When ColdFusion returns a page to the client, it includes the HTTP
the last locale setting on the page for this information.
Note: In earlier versions of ColdFusion, the default locale was always English, not the operating system's locale. For the
Japanese version of ColdFusion, the default was Japanese.
The following example uses the
ColdFusion-supported locales. You can run this code to see how the locale affects the data returned to a browser.
variable is a comma-delimited list of the locale names that you can
function that returns a locale name in a format that is meaningful
function persists for the current request or until it is reset by another
functions, the current locale setting affects how locale-sensitive ColdFusion
HTTP header. The browser that requested the page displays the response
functions that follow a
function to determine the current locale setting of ColdFusion, or you can
GetLocale
function to get the locale name in a format that is meaningful to users. If you have
,
returns the locale of the JVM.
GetLocale
function to output the value 100,000 in monetary units for all the
LSCurrencyFormat
Last updated 8/5/2010
SetLocale
SetLocale
header.
Content-Language
tag.
cfflush
Content-Language
369
in the CFML Reference.
SetLocale
function that
header. ColdFusion uses

Advertisement

Table of Contents
loading

Table of Contents