XFA Specification
Chapter 23, FormCalc Specification
FormCalc Support for Locale
828
Specifying a Locale (Locale Identifier String)
A
locale identifier string
is a unique string representing a locale, as described in
“Convention for Explicitly
Naming Locale” on page 904
in the
“Picture Clause Specification”.
Determining Which Locale to Use
FormCalc functions that are influenced by locale consider several sources for locale information. Such
functions accept an optional stand-alone locale identifier string. If such an argument is not supplied,
FormCalc functions determine the locale to use (called the
prevailing locale),
by examining the following:
1. Locale identifier string enclosed in the picture clause argument (“Locale-Specific
Picture Clauses” on
page 908)
2. Template field or subform declarations, using the
locale
property.
3. Ambient locale.
Ambient locale
is the system locale declared by the application or in effect at the time
the XFA processing application is started. In the event the application is operating on a system or
within an environment where a locale is not present, the ambient locale defaults to English United
States (
en_US
).
Date Format Styles
FormCalc functions support date format styles. A
date format style
is a locale-independent style of
representing date. Supported date styles include short, medium, long, and full. One date style is
designated the default. The date/time format styles may be defined in the
localeSet
element, described
in
“The localeSet Element” on page 149.
The format of dates is governed by an ISO standards body whereby each nation gets to specify the form of
its default, short, medium, long, and full date formats. Specifically, the locale (as described in the localeSet
element) is responsible for identifying the format of dates that conform to the standards of that nation.
Style
short
medium
Appearance example (en_US)
10/2/70
10-Feb-70
Description
Short date format styles tend to be purely numeric
Medium date format styles specify use of abbreviated
month names
The medium date style tends to be the default style.
long
full
February 10, 1970
Thursday, February 10, 1970
Full date format styles tend to include the weekday
name
Properly internationalized applications then, will always query the locale for a date format. The form
designer has the option of choosing from either the default, short, medium, long or full formats, and will
never present to the user a hand-crafted date format. Except for the need of a common format for data
interchange, use of hand-crafted date formats are best avoided.
Date Picture Clauses
A
date picture clause
specifies the format for a date. It consists of punctuations, literals, and pattern
symbols, e.g., "D/M/YY" is a date picture clause.
Home Index Bookmark Pages
Pages: Home Index All Pages