XFA Specification
Chapter 24, Picture Clause Specification
Picture-Clause Building Blocks
904
Locale Identifier Strings
Locale influences date, time, and number picture clause processing. For example, the format used for full
date presentations differs between English-language (October 25, 2002) and French-language locales
(25 octobre, 2002). This section describes what a locale is, how the locale is determined and how locales
are identified in picture clauses.
What a Locale Is
When developing
internationalized applications, a locale is the standard term used to identify a particular
cultural context (language and/or country). A locale defines (but is not limited to) the format of dates,
times, numeric and currency punctuation that are culturally relevant to a specific cultural context. A
properly internationalized application will always rely on the locale to supply it with the format of dates
and times. This way, users operating in their locale will always be presented with the date and time formats
they are accustomed to.
A locale is identified by a language code and/or a country code. Usually, both elements of a locale are
important. For example, the names of weekdays and months in English Canada and in the United
Kingdom are formatted identically, but dates are formatted differently. So, specifying an English language
locale would not suffice. Conversely, specifying only a country as the locale may not suffice either — for
example, Canada, has different date formats for English and French.
Determining the Prevailing Locale
There are several sources for locale information. For example, the hosting operating system may provide
an XFA processing application with a locale to use and the picture clause may provide a locale. The
prevailing locale
is the locale that should be used for input parsing or output formatting.
An XFA processing application determines prevailing locale by examining the following, in order:
1. Explicit declaration in the picture clause (“Convention
for Explicitly Naming Locale”).
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
).
“Localization and Canonicalization” on page 140
in the chapter
“Exchanging Data Between an External
Application and a Basic XFA Form”
provides additional information about localization.
Convention for Explicitly Naming Locale
Picture clauses may include locale identifier strings. Such designators conform to the following syntax,
where the square brackets show optional parts:
language[_country[_modifier]]
The syntax includes codes for the following:
language
. Language codes use the 2-character representation for languages specified in [ISO
639-1].
country
. Country codes use the 2-character country representations specified in [ISO-3166-1].
modifier
. Modifier codes can be used to mean a variety of things. For example, en_GB_EURO uses
the modifer to select an alternate default currency. By contrast th_TH_TH and ko_KR_Hani use the
modifier to select an alternate default script.
Home Index Bookmark Pages
Pages: Home Index All Pages