AT&T Home | AT&T Labs | Research
AT&T Labs, Inc. - Research

The Yoix® Scripting Language

Home | What's New | Grammar | Documentation | Download | License | YChart | YDAT | YWAIT | Byzgraf | FAQs
Locale typedict
 
A Locale is the Yoix representation of the Java Locale class. The fields in a Locale are:
country A String that is normally the two-letter, upper-case ISO-3166 code for the country described by this Locale. Any string will be accepted, however only recognized ISO-3166 codes will allow one to take advantage of Java locale-related capabilities. See iso3country, below. Once the Locale is created, this field becomes read-only.
displaycountry A read-only String that gives the longer name of the specified country in the language of the default Locale currently active, when such language information is available. In the worst case, the value is the same as country.
displaylanguage A read-only String that gives the longer name of the specified language in the language of the default Locale currently active, when such language information is available. In the worst case, the value is the same as language.
displayname A read-only String that gives the values of displaylanguage, displaycountry and displayvariant assembled into a trimmed string. The second and third non-empty values are enclosed in parentheses.
displayvariant A read-only String that gives the longer name of the specified variant in the language of the default Locale currently active, when such language information is available. In the worst case, the value is the same as variant.
iso3country A read-only String that gives the three-letter ISO country code, when available. If this field is empty and country is non-empty, it is a good bet that Java does not recognize the specified country.
iso3language A read-only String that gives the three-letter ISO language code, when available. If this field is empty and language is non-empty, it is a good bet that Java does not recognize the specified language.
language A String that is normally the two-letter, lower-case ISO-3166 code for the language described by this Locale. Any string will be accepted, however only recognized ISO-3166 codes will allow one to take advantage of Java locale-related capabilities. See iso3language, above. Once the Locale is created, this field becomes read-only.
variant A String providing variant identifier information, such as POSIX, Mac and so on. Once the Locale is created, this field becomes read-only.
Several permanent fields have not been documented and should not be used in Yoix applications.
 
 Example:   The following script retrieves the timezone object for western Europe, builds locale information for Italy and the Italian language and then prints the current time for Florence, Italy in Italian.
import yoix.*.*;

TimeZone zone = getTimeZone("ECT");

Locale loc = {
    String country = "IT";
    String language = "it";
};

String format = getDateFormat(
    loc,
    0,
    DateFormat.DATETIME,
    DateFormat.FULL,
    DateFormat.FULL
);

puts("A Firenze è " + date(loc, zone, format, time()));
The text on standard output would look something like:
A Firenze è lunedì 15 aprile 2002 20.22.43 CEST
 
 See Also:   Calendar, date, getDateFormat, getLocale, getLocales, setLocale, TimeZone

 

Yoix is a registered trademark of AT&T Inc.