std-get-locale-info


Synopsis

(std-get-locale-info locale-info)

Description

STD-GET-LOCALE-INFO returns detailed options for the current specific locale settings, country, language or codepage specific system options, according the locale-info argument, which must be a string.

The options can be subdivided into numeric, monetary and time formatting information.

Under the MS Windows platform 118 options are supported, under other platforms just 18, which return only the default C locale information for now. (defined by the ANSI standard)

The info returned may be used to format output user-friendly.

Note

The values returned are not static, they may be changed at run-time by the user, eg under Windows in the Control Panel - Language and Country settings

Note

We don't define bitcodes (2^18) to access the structure members, instead we use strings to maintain readability.

Arguments and Return Values

locale-info: A string, which must be equal any of the above described values. Other values are rejected with an error.

Possible values of locale-info, their return types and values. The examples provided are for the locale settings "DEA" Deutsch-Austrian, Österreich.

All platforms

Numeric (non-monetary) formatting information:

"decimal_point" <STR>
Decimal-point character for nonmonetary quantities.

Default: "."


"thousands_sep" <STR>
Character that separates groups of digits to left of decimal point for nonmonetary quantities.
"grouping" <INT | INT-LIST>
Size of each group of digits in nonmonetary quantities.
  1. Do not perform any further grouping.

  2. Use previous element for each of remaining digits.

    n Number of digits that make up current group. Next element is examined to determine size of next group of digits before current group.

Either a list of integers or a single integer or nil is returned.

Monetary formatting information:

"int_curr_symbol" <STR>
International currency symbol for current locale. First three characters specify alphabetic international currency symbol as defined in the ISO 4217 Codes for the Representation of Currency and Funds standard. Fourth character (immediately preceding null character) separates international currency symbol from monetary quantity.

The first three characters specify the alphabetic international currency symbol as defined in the ISO 4217 Codes for the Representation of Currency and Funds standard.

The fourth character (immediately preceding the null character) separates the international currency symbol from the monetary quantity.

Example: "ATS" for Austria

"currency_symbol" <STR>
Local currency symbol for current locale.
Example: "öS" for Austria

"mon_decimal_point" <STR>
Decimal-point character for monetary quantities.
"mon_thousands_sep" <STR>
Separator for groups of digits to left of decimal place in monetary quantities.
"mon_grouping" <INT | INT-LIST>
Size of each group of digits in monetary quantities.
  1. Do not perform any further grouping.

  2. Use previous element for each of remaining digits.

    n Number of digits that make up current group. Next element is examined to determine size of next group of digits before current group.

Either a list of integers or a single integer or nil is returned.


"positive_sign" <STR>
String denoting sign for nonnegative monetary quantities.
"negative_sign" <STR>
String denoting sign for negative monetary quantities.
"int_frac_digits" <INT>
Number of digits to right of decimal point in internationally formatted monetary quantities.
"frac_digits" <INT>
Number of digits to right of decimal point in formatted monetary quantities.
"p_cs_precedes" <INT>
Set to 1 if currency symbol precedes value for nonnegative formatted monetary quantity. Set to 0 if symbol follows value.
  1. Currency symbol follows value for nonnegative formatted monetary value.

  2. Currency symbol precedes value for nonnegative formatted monetary value.

"p_sep_by_space" <INT>
Set to 1 if currency symbol is separated by space from value for nonnegative formatted monetary quantity. Set to 0 if there is no space separation.
  1. Currency symbol is separated from value by space for nonnegative formatted monetary value.

  2. There is no space separation between currency symbol and value for nonnegative formatted monetary value.

"n_cs_precedes" <INT>
Set to 1 if currency symbol precedes value for negative formatted monetary quantity. Set to 0 if symbol succeeds value.
  1. Currency symbol follows value for nonnegative negative formatted monetary value.

  2. Currency symbol precedes value for nonnegative negative formatted monetary value.

"n_sep_by_space" <INT>
Set to 1 if currency symbol is separated by space from value for negative formatted monetary quantity. Set to 0 if there is no space separation.
  1. Currency symbol is separated from value by space for negative formatted monetary value.

  2. There is no space separation between currency symbol and value for negative formatted monetary value.

"p_sign_posn" <INT>
Position of positive sign in nonnegative formatted monetary quantities.
  1. Parentheses surround quantity and currency symbol

  2. Sign string precedes quantity and currency symbol

  3. Sign string follows quantity and currency symbol

  4. Sign string immediately precedes currency symbol

  5. Sign string immediately follows currency symbol

"n_sign_posn" <INT>
Position of positive sign in negative formatted monetary quantities.
  1. Parentheses surround quantity and currency symbol

  2. Sign string precedes quantity and currency symbol

  3. Sign string follows quantity and currency symbol

  4. Sign string immediately precedes currency symbol

  5. Sign string immediately follows currency symbol

Additional Windows-only specific locale information
(Note: some not in R12 Windows):

The following options always a string. Numbers are converted to strings accordingly. Empty values are returned as "", the empty string and not as nil.

The "S" prefix denotes a string return value, the "I" prefix a integer number converted to a string.

The examples are for the default Windows NT 4 locale settings for "DEA", Deutsch-Austrian, Österreich. But any information can be changed at run-time by running "Control Panel" - "Country Settings".

"ILANGUAGE"
Language identifier indicating the language. The LCID as hex number.
Example: "0c07"

"SLANGUAGE"
Full localized name of the language.
Example: "Deutsch (Österreich)" 

"SENGLANGUAGE"
Full English name of the language from the International Organization for Standardization (ISO) Standard 639. This is always restricted to characters mappable into the ASCII 127-character subset.
Example: "German"

"SABBREVLANGNAME"
Abbreviated name of the language, created by taking the 2-letter language abbreviation from the ISO Standard 639 and adding a third letter, as appropriate, to indicate the sublanguage.
Example: "DEA"

"SNATIVELANGNAME"
Native name of the language.
Example: "Deutsch"

"ICOUNTRY"
Country code, based on international phone codes, also referred to as IBM country codes.
Example: "43"

"SCOUNTRY"
Full localized name of the country.
Example: "Österreich"

"SENGCOUNTRY"
Full English name of the country. This is always restricted to characters mappable into the ASCII 127-character subset.
Example: "Austria"

"SABBREVCTRYNAME"
Abbreviated name of the country from the ISO Standard 3166.
Example: "AUT"

"SNATIVECTRYNAME"
Native name of the country.
Example: "Österreich"

"IDEFAULTLANGUAGE"
Language identifier for the principal language spoken in this locale. This is provided so that partially specified locales can be completed with default values.
Example: "0c07"

"IDEFAULTCOUNTRY"
Country code for the principal country in this locale. This is provided so that partially specified locales can be completed with default values.
Example: "43"

"IDEFAULTANSICODEPAGE" (not in R12 Windows)
American National Standards Institute (ANSI) code page associated with this locale.
Example: "1252"

"IDEFAULTCODEPAGE"
Original equipment manufacturer (OEM) code page associated with the country.
Example: "850"

"SLIST"
Character(s) used to separate list items. For example, a comma is used in many locales.
Example: ";"

"IMEASURE"
System of measurement. This value is 0 if the metric system (Systéme International d'Unités, or S.I.) is used and 1 if the U.S. system is used.
Example: "0"

"SDECIMAL"
Character(s) used as the decimal separator.
Example: ","

"STHOUSAND"
Character(s) used to separate groups of digits to the left of the decimal.
Example: "."

"SGROUPING"
Sizes for each group of digits to the left of the decimal. An explicit size is needed for each group; sizes are separated by semicolons. If the last value is zero, the preceding value is repeated. To group thousands, specify 3;0, for example.
Example: "3;0"

"IDIGITS"
Number of fractional digits.
Example: "2"

"ILZERO"
Specifier for leading zeros in decimal fields.The specifier can be one of the following values:

0 No leading zeros

1 Leading zeros

Example: "1"

"INEGNUMBER" (not in R12 Windows)
Negative number mode. The mode can be one of these values:

0 (1.1)

1 -1.1

2 - 1.1

3 1.1-

4 1.1 -

Example: "1"

"SNATIVEDIGITS"
Native equivalents to ASCII 0 through 9.
Example: "0123456789"

"SCURRENCY"
String used as the local monetary symbol.
Example: "öS"

"SINTLSYMBOL"
Three characters of the international monetary symbol specified in ISO 4217, "Codes for the Representation of Currencies and Funds," followed by the character separating this string from the amount.
Example: "ATS"

"SMONDECIMALSEP"
Character(s) used as the monetary decimal separator.
Example: ","

"SMONTHOUSANDSEP"
Character(s) used as the monetary separator between groups of digits to the left of the decimal.
Example: "."

"SMONGROUPING"
Sizes for each group of monetary digits to the left of the decimal. An explicit size is needed for each group; sizes are separated by semicolons. If the last value is zero, the preceding value is repeated. To group thousands, specify 3;0, for example.
Example: "3;0"

"ICURRDIGITS"
Number of fractional digits for the local monetary format.
Example: "2"

"IINTLCURRDIGITS"
Number of fractional digits for the international monetary format.
Example: "2"

"ICURRENCY"
Positive currency mode.The mode can be one of the following values:

0 Prefix, no separation

1 Suffix, no separation

2 Prefix, 1-char. separation

3 Suffix, 1-char. separation

Example: "2"

"INEGCURR"
Negative currency mode. The mode can be one of the following values:

0 ($1.1)

1 -$1.1

2 $-1.1

3 $1.1-

4 (1.1$)

5 -1.1$

6 1.1-$

7 1.1$-

8 -1.1 $ (space before $)

9 -$ 1.1 (space after $)

10 1.1 $- (space before $)

11 $ 1.1- (space after $)

12 $ -1.1 (space after $)

13 1.1- $ (space before $)

14 ($ 1.1) (space after $)

15 (1.1 $) (space before $)

Example: "9"

"SDATE"
Character(s) for the date separator.
Example: "."

"STIME"
Character(s) for the time separator.
Example: ":"

"STIMEFORMAT"
Time formatting strings for this locale. The string can consist of a combination of the hour, minute, and second format pictures defined in in the Hour, Minute, and Second Format Pictures table in National Language Support Constants.
Example: "dd.MM.yy"

"SSHORTDATE"
Short date formatting string for this locale. The string can consist of a combination of day, month, and year format pictures defined in in Day, Month, Year, and Era Format Pictures table in National Language Support Constants.
Example: 

"SLONGDATE"
Long date formatting string for this locale. The string can consist of a combination of day, month, and year format pictures defined in in the Day, Month, Year, and Era Format Pictures table in National Language Support Constantsand any string of characters enclosed in single quotes. Characters in single quotes remain as given.
Example: "dddd, dd. MMMM yyyy"

"IDATE"
Short date format-ordering specifier. The specifier can be one of the following values:

0 Month-Day-Year

1 Day-Month-Year

2 Year-Month-Day

Example: "1"

"ILDATE"
Long date format-ordering specifier. The specifier can be one of the following values:

0 Month-Day-Year

1 Day-Month-Year

2 Year-Month-Day

Example: "1"

"ITIME"
Time format specifier. The specifier can be one of the following values:

0 AM / PM 12-hour format

1 24-hour format

Example: "1"

"ICENTURY"
Specifier for full 4-digit century. The specifier can be one of the following values:

0 Abbreviated 2-digit century

1 Full 4-digit century

Example: "0" (oops, apparently a year 2000 problem!)


"ITLZERO"
Specifier for leading zeros in time fields. The specifier can be one of the following values:

0 No leading zeros for hours

1 Leading zeros for hours

Example: "1"

"IDAYLZERO"
Specifier for leading zeros in day fields. The specifier can be one of the following values:

0 No leading zeros for days

1 Leading zeros for days

Example: "1"

"IMONLZERO"
Specifier for leading zeros in month fields. The specifier can be one of the following values:

0 No leading zeros for months

1 Leading zeros for months

Example: "1"

"S1159"
String for the AM designator.
Example: ""

"S2359"
String for the PM designator.
Example: ""

"ICALENDARTYPE" (not in R12 Windows)
Current calendar type. This type can be one of these values:

1 Gregorian (as in United States)

2 Gregorian (English strings always)

3 Era: Year of the Emperor (Japan)

4 Era: Year of the Republic of China

5 Tangun Era (Korea)

Example: "1"

"IOPTIONALCALENDAR" (not in R12 Windows)
Additional calendar types. This can be a zero-separated list of one or more of these calendars type values:

0 No additional types valid

1 Gregorian (as in United States)

2 Gregorian (English strings always)

3 Era: Year of the Emperor (Japan)

4 Era: Year of the Republic of China

5 Tangun Era (Korea)

Example: "0"

"IFIRSTDAYOFWEEK" (not in R12 Windows)
Specifier for the first day in a week. The specifier can be one of these values:

0 SDAYNAME1

1 SDAYNAME2

2 SDAYNAME3

3 SDAYNAME4

4 SDAYNAME5

5 SDAYNAME6

6 SDAYNAME7

Example: "0"

"IFIRSTWEEKOFYEAR" (not in R12 Windows)
Specifier for the first week of the year. The specifier can be one of these values:
  1. Week containing 1/1 is the first week of that year.

  2. First full week following 1/1 is the first week of that year.

  3. First week containing at least 4 days is the first week of that year.
    Example: "0"

"SDAYNAME1"
Native long name for Monday.
Example: "Montag"

"SDAYNAME2"
Native long name for Tuesday.
Example: "Dienstag"

"SDAYNAME3"
Native long name for Wednesday.
Example: "Mittwoch"

"SDAYNAME4"
Native long name for Thursday.
Example: "Donnerstag"

"SDAYNAME5"
Native long name for Friday.
Example: "Freitag"

"SDAYNAME6"
Native long name for Saturday.
Example: "Samstag"

"SDAYNAME7"
Native long name for Sunday.
Example: "Sonntag"

"SABBREVDAYNAME1"
Native abbreviated name for Monday.
Example: "Mo"

"SABBREVDAYNAME2"
Native abbreviated name for Tuesday.
Example: "Di"

"SABBREVDAYNAME3"
Native abbreviated name for Wednesday.
Example: "Mi"

"SABBREVDAYNAME4"
Native abbreviated name for Thursday.
Example: "Do"

"SABBREVDAYNAME5"
Native abbreviated name for Friday.
Example: "Fr"

"SABBREVDAYNAME6"
Native abbreviated name for Saturday.
Example: "Sa"

"SABBREVDAYNAME7"
Native abbreviated name for Sunday.
Example: "So"

"SMONTHNAME1"
Native long name for January.
Example: "Jänner"

"SMONTHNAME2"
Native long name for February.
Example: "Februar"

"SMONTHNAME3"
Native long name for March.
Example: "März"

"SMONTHNAME4"
Native long name for April.
Example: "April"

"SMONTHNAME5"
Native long name for May.
Example: "Mai"

"SMONTHNAME6"
Native long name for June.
Example: "Juni"

"SMONTHNAME7"
Native long name for July.
Example: "Juli"

"SMONTHNAME8"
Native long name for August.
Example: "August"

"SMONTHNAME9"
Native long name for September.
Example: "September"

"SMONTHNAME10"
Native long name for October.
Example: "Oktober"

"SMONTHNAME11"
Native long name for November.
Example: "November"

"SMONTHNAME12"
Native long name for December.
Example: "Dezember"

"SMONTHNAME13" (not in R12 Windows)
Native name for 13th month, if exists.
Example: ""

"SABBREVMONTHNAME1"
Native abbreviated name for January.
Example: "Jän"

"SABBREVMONTHNAME2"
Native abbreviated name for February.
Example: "Feb"

"SABBREVMONTHNAME3"
Native abbreviated name for March.
Example: "Mär"

"SABBREVMONTHNAME4"
Native abbreviated name for April.
Example: "Apr"

"SABBREVMONTHNAME5"
Native abbreviated name for May.
Example: "Mai"

"SABBREVMONTHNAME6"
Native abbreviated name for June.
Example: "Jun"

"SABBREVMONTHNAME7"
Native abbreviated name for July.
Example: "Jul"

"SABBREVMONTHNAME8"
Native abbreviated name for August.
Example: "Aug"

"SABBREVMONTHNAME9"
Native abbreviated name for September.
Example: "Sep"

"SABBREVMONTHNAME10"
Native abbreviated name for October.
Example: "Okt"

"SABBREVMONTHNAME11"
Native abbreviated name for November.
Example: "Nov"

"SABBREVMONTHNAME12"
Native abbreviated name for December.
Example: "Dez"

"SABBREVMONTHNAME13" (not in R12 Windows)
Native abbreviated name for 13th month, if exists.
Example: ""

"SPOSITIVESIGN"
String value for the positive sign.
Example: ""

"SNEGATIVESIGN"
String value for the negative sign.
Example: "-"

"IPOSSIGNPOSN"
Formatting index for positive values. The index can be one of the following values:
  1. Parentheses surround the amount and the monetary symbol.

  2. The sign string precedes the amount and the monetary symbol.

  3. The sign string succeeds the amount and the monetary symbol.

  4. The sign string immediately precedes the monetary symbol.

  5. The sign string immediately succeeds the monetary symbol.
Example: "3"

"INEGSIGNPOSN"
Formatting index for negative values. This index uses the same values as IPOSSIGNPOSN.
Example: "3"

"IPOSSYMPRECEDES"
Position of monetary symbol in a positive monetary value. This value is 1 if the monetary symbol precedes the positive amount, 0 if it follows it.
Example: "1"

"IPOSSEPBYSPACE"
Separation of monetary symbol in a positive monetary value. This value is 1 if the monetary symbol is separated by a space from a positive amount, 0 if it is not.
Example: "1"

"INEGSYMPRECEDES"
Position of monetary symbol in a negative monetary value. This value is 1 if the monetary symbol precedes the negative amount, 0 if it follows it.
Example: "1"

"INEGSEPBYSPACE"
Separation of monetary symbol in a negative monetary value. This value is 1 if the monetary symbol is separated by a space from the negative amount, 0 if it is not.
Example: "1"

"SISO639LANGNAME" (not in R12 Windows)
ISO abbreviated language name
Example: "de"

"SISO3166CTRYNAME" (not in R12 Windows)
ISO abbreviated country name
Example: "AT"

List of options not defined in R12- Windows:

IDEFAULTANSICODEPAGE
INEGNUMBER
ICALENDARTYPE
IOPTIONALCALENDAR
IFIRSTDAYOFWEEK
IFIRSTWEEKOFYEAR
SMONTHNAME13
SABBREVMONTHNAME13
SISO639LANGNAME
SISO3166CTRYNAME

Return Value

STD-GET-LOCALE-INFO returns string or a number or a list of numbers (grouping only). The uppercase Windows-only options always return a string.

Side Effects

None.

Module

STDLOCAL-ADS, (std-%require-external-ads "stdlib")

Defined in the external stdlib adsrx only.