%SYS
Locales Class Reference

This class is a description of a locale. More...

Inheritance diagram for Locales:
Collaboration diagram for Locales:

Public Member Functions

 ConvertCacheToIRIS ()
 Convert Cache standard collation to IRIS standard.
 
 GetTables (_.Library.String Tables)
 Gets all tables defined in a locale and creates an array with. More...
 
_.Library.Status ValidateConfigDefaults ()
 Remove any configured table default not available in this locale.
 
def __init__ (self)
 Deprecated. More...
 

Static Public Member Functions

_.Library.Status Compile (_.Library.String Name)
 Compiles a single Locale<br>
More...
 
_.Library.Status CompileAll ()
 Compiles all Tables from all Locales<br>

 
_.Library.Status Create (_.Library.String Name, _.Library.String Properties)
 Creates a Locale in the NLS database. More...
 
_.Library.Status Delete (_.Library.String Name)
 Deletes a Locale from the NLS database. More...
 
_.Library.Boolean Exists (_.Library.String Name, _.Library.ObjectHandle Locale, _.Library.Status Status)
 Checks for the existence of a Locale in the NLS database. More...
 
_.Library.Status Export (_.Library.String FileName, _.Library.Integer NumExported, _.Library.String Locales)
 Exports Locale Objects to a file in xml format. More...
 
_.Library.Status ExportAllToNls (_.Library.Integer NumExported, _.Library.Integer Deep)
 Exports all Locale records to ^nls. More...
 
_.Library.Status ExportDir (_.Library.String Dir, _.Library.Integer NumExported, _.Library.String Locales)
 Exports Locale Objects to separate xml files. More...
 
_.Library.Status ExportList (_.Library.String FileName, _.Library.Integer NumExported, _.Library.String Locales)
 Similar to Export() but uses a list of Locales to export rather than a. More...
 
_.Library.Status ExportToNls (_.Library.String Name, _.Library.Integer Deep)
 Exports one Locale record to ^nls. More...
 
_.Library.Status Get (_.Library.String Name, _.Library.String Properties)
 Gets a locale's properties from the NLS database. More...
 
_.Library.Status Import (_.Library.String FileName, _.Library.Integer NumImported, _.Library.Integer Flags)
 Imports Locale records from an xml file. More...
 
_.Library.Status ImportAll (_.Library.String FileName, _.Library.String NumImported, _.Library.Integer SelBits)
 Imports all NLS records from an xml file. More...
 
_.Library.Status ImportAllFromNls (_.Library.Integer NumImported, _.Library.Integer Flags, _.Library.Integer Deep, _.Library.String Ref)
 Imports all Locale records from ^nls. More...
 
_.Library.Status ImportDir (_.Library.String Dir, _.Library.String NumImported, _.Library.Boolean forcemulticompile)
 Imports locale files from a directory. More...
 
_.Library.Status ImportFromNls (_.Library.String Name, _.Library.String Ref)
 Imports one Locale record from ^nls. More...
 
_.Library.Status ImportLegacy (_.Library.String FileName, _.Library.String NumImported, _.Library.Integer SelBits, _.Library.String Warnings)
 Imports all NLS records from a legacy goq file. More...
 
_.Library.Status Install (_.Library.String Locale)
 Sets the new "current locale" and loads its tables. More...
 
_.Library.Boolean IsInstallable (_.Library.String Name, _.Library.String Errors, _.Library.String Warnings)
 Checks whether a locale can be installed in the current system<br>
More...
 
_.Library.Boolean IsLoadable (_.Library.String Name, _.Library.ObjectHandle Locale, _.Library.String Errors)
 Verifies whether a locale can be loaded<br>
More...
 
_.Library.Boolean IsValid (_.Library.String Name, _.Library.String Errors, _.Library.String Warnings)
 Verifies validity of locale<br>
More...
 
_.Library.Status Load (_.Library.String Locale)
 Loads all the tables from a Locale and sets the. More...
 
_.Library.Status Modify (_.Library.String Name, _.Library.String Properties)
 Modifies an existing Locale's properties in the NLS database. More...
 
_.Library.ObjectHandle OpenCurrent (_.Library.Status Status)
 Opens current Locale.
 
_.Library.Status Reload ()
 Reload the current locale to activate changes in configured defaults.
 

Public Attributes

 AM
 Sufix which may optionally be appended to time values. More...
 
 AccentTable
 The default accent table. More...
 
 AccentTables
 List of available accent tables. More...
 
 CharacterSet
 Name of character set on which this locale is based. More...
 
 CollationTable
 The default collation table. More...
 
 CollationTables
 List of available collation tables. More...
 
 Country
 Country supported by this locale. More...
 
 CountryAbbr
 ISO 3166 two-letter abbreviation of Country. More...
 
 Currency
 Currency symbol (string) encoded in native character set. More...
 
 DateFormat
 The DateFormat code used whenever a $ZDATE, $ZDATEH,. More...
 
 DateMaximum
 The maximum value for a date allowed in $ZDATE, $ZDATEH,. More...
 
 DateMinimum
 The minimum value for a date allowed in $ZDATE, $ZDATEH,. More...
 
 DateSeparator
 The character used to delimit the months, days, and years. More...
 
 DecimalSeparator
 The character used by the $FNUMBER function to separate. More...
 
 Description
 Simple description of locale. More...
 
 IdentifierTable
 The default identifier table. More...
 
 IdentifierTables
 List of available identifier tables. More...
 
 Language
 Localization language for this locale. More...
 
 LanguageAbbr
 ISO 639-2 two-letter abbreviation of Language. More...
 
 LowerCaseTable
 The default lower-case table. More...
 
 LowerCaseTables
 List of available lower-case tables. More...
 
 Midnight
 The suffix which may optionally be appended to time. More...
 
 MinusSign
 The character which may precede or follow a negative. More...
 
 MonthAbbr
 The abbreviations of the names of the twelve months,. More...
 
 MonthName
 The full names of the twelve months, used whenever a. More...
 
 Name
 Code name of the locale. More...
 
 Noon
 The suffix which may optionally be appended to time values. More...
 
 NumericGroupSeparator
 The character used to separate groups of numeric digits. More...
 
 NumericGroupSize
 The number of digits in a numeric group formatted by the. More...
 
 PM
 The suffix which may optionally be appended to time values. More...
 
 PatternTable
 The default pattern match table. More...
 
 PatternTables
 List of available pattern match tables. More...
 
 PhysicalCursor
 True if terminals should have Physical Cursor set by default. More...
 
 PlusSign
 The character which may optionally precede or follow a. More...
 
 Resource
 
 TimeFormat
 The TimeFormat code used whenever a $ZDATETIME, $ZDATETIMEH,. More...
 
 TimePrecision
 The number of fractional digits displayed in a time value. More...
 
 TimeSeparator
 The character used to delimit the hours, minutes and seconds. More...
 
 TitleCaseTable
 The default title-case table. More...
 
 TitleCaseTables
 List of available title-case tables. More...
 
 TranDDP
 The default translation table for DDP. More...
 
 TranDTMDCP
 The default translation table for DTM-DCP. More...
 
 TranMagTape
 The default translation table for magtapes. More...
 
 TranPrinter
 The default translation table for printers. More...
 
 TranProgrammer
 The default translation table for the InterSystems IRIS Terminal. More...
 
 TranSequential
 The default translation table for files and other sequential devices. More...
 
 TranSystemCall
 The default translation table for OS system calls. More...
 
 TranTCP
 The default translation table for TCP/IP connections. More...
 
 TranTerminal
 The default translation table for LAT and Telnet terminals. More...
 
 TranZCVT
 The default translation table for $ZCVT(). More...
 
 UpperCaseTable
 The default upper-case table. More...
 
 UpperCaseTables
 List of available upper-case tables. More...
 
 WeekdayAbbr
 The abbreviations of the names of the seven days of the. More...
 
 WeekdayName
 The full names of the seven days of the week, starting. More...
 
 XLTTables
 ("table name")=$LB(InputFrom,InputTo,OutputFrom,OutputTo)
More...
 
 XYTable
 The default $X/$Y table. More...
 
 XYTables
 List of available $X/$Y tables. More...
 
 YearOption
 The YearOption code used whenever a $ZDATE, $ZDATEH,. More...
 

Static Public Attributes

 DOMAIN = None
 Default Localization Domain.
 

Detailed Description

This class is a description of a locale.

A locale contains:

  • Basic properties (language, country, character set, etc)
  • Available tables to be loaded at startup
  • Defaults for the various kinds of tables
  • Default time, date and number formats for $ZDATE and $FNUMBER
  • Some localization strings


Warning!

Only locales whose names begin with "y" (e.g. "yda8" or "yptw") are considered custom locales and are preserved during system upgrades. All other locales are restored to their original state and any changes to them made with methods from this class will be lost in an upgrade.

Constructor & Destructor Documentation

◆ __init__()

def __init__ (   self)

Deprecated.

For compatibility with previous versions.

 

Member Function Documentation

◆ Compile()

_.Library.Status Compile ( _.Library.String  Name)
static

Compiles a single Locale<br>

Parameters:

  • Name - Locale name

◆ Create()

_.Library.Status Create ( _.Library.String  Name,
_.Library.String  Properties 
)
static

Creates a Locale in the NLS database.



Parameters:

  • Name - Name of the Locale to create
  • Properties - Array of properties corresponding to the class properties

◆ Delete()

_.Library.Status Delete ( _.Library.String  Name)
static

Deletes a Locale from the NLS database.



Parameters:

  • Name - Name of Locale to delete

◆ Exists()

_.Library.Boolean Exists ( _.Library.String  Name,
_.Library.ObjectHandle  Locale,
_.Library.Status  Status 
)
static

Checks for the existence of a Locale in the NLS database.



Parameters:

  • Name - Name of the Locale to check existence of

Return values:

If Value of the method = 0 (Locale does not exist, or some error occured)

  • Locale = Null
  • Status = Locale "x" does not exist, or other error message

If Value of the method = 1 (Locale exists)

  • Locale = Object handle to Locale
  • Status = $$$OK

◆ Export()

_.Library.Status Export ( _.Library.String  FileName,
_.Library.Integer  NumExported,
_.Library.String  Locales 
)
static

Exports Locale Objects to a file in xml format.



Parameters:

  • FileName - Output file name
  • NumExported (byref) - Returns number of Locale records exported.
  • Locales - Comma separated list of Locales to export, "*" = All

◆ ExportAllToNls()

_.Library.Status ExportAllToNls ( _.Library.Integer  NumExported,
_.Library.Integer  Deep 
)
static

Exports all Locale records to ^nls.



Parameters:

  • NumExported (byref) - Returns number of exported entities ("Locales","Table" and "SubTables") [out]
  • Deep - True if we also want to export associated Tables and SubTables

◆ ExportDir()

_.Library.Status ExportDir ( _.Library.String  Dir,
_.Library.Integer  NumExported,
_.Library.String  Locales 
)
static

Exports Locale Objects to separate xml files.



Parameters:

  • Dir - Directory where the files will be created
  • NumExported (byref) - Returns number of Locale records exported.
  • Locales - Comma separated list of Locales to export, "*" = All

◆ ExportList()

_.Library.Status ExportList ( _.Library.String  FileName,
_.Library.Integer  NumExported,
_.Library.String  Locales 
)
static

Similar to Export() but uses a list of Locales to export rather than a.

query. Used internally by some utilities.

Parameters:

  • FileName - Output file name
  • NumExported (byref) - Returns number of exported entities ("Locales","Table" and "SubTables") [out]
  • Locales (byref) - Array of Locales to export

◆ ExportToNls()

_.Library.Status ExportToNls ( _.Library.String  Name,
_.Library.Integer  Deep 
)
static

Exports one Locale record to ^nls.



Parameters:

  • Name - Locale name
  • Deep - If true exports all associated Tables.

◆ Get()

_.Library.Status Get ( _.Library.String  Name,
_.Library.String  Properties 
)
static

Gets a locale's properties from the NLS database.



Parameters:

  • Name - Name of the Locale to get

Return values:

  • Properties - Array of properties. See the Create() method for a full list

◆ GetTables()

GetTables ( _.Library.String  Tables)

Gets all tables defined in a locale and creates an array with.

Table(<type>,<from>,<to>)

◆ Import()

_.Library.Status Import ( _.Library.String  FileName,
_.Library.Integer  NumImported,
_.Library.Integer  Flags 
)
static

Imports Locale records from an xml file.



Parameters:

  • FileName - Filename to import Locale records from
  • NumImported (byref) - Returns number of records imported
  • Flags - Control import
    • Bit 0 - Do not import records, just return count

Note: On failure, no records will be imported

◆ ImportAll()

_.Library.Status ImportAll ( _.Library.String  FileName,
_.Library.String  NumImported,
_.Library.Integer  SelBits 
)
static

Imports all NLS records from an xml file.



Parameters:

  • FileName - Filename to import NLS records from
  • NumImported (byref) - Returns number of records imported for each type of NLS record:
    • NumImported("Locales")
    • NumImported("Tables")
    • NumImported("SubTables")
  • SelBits - Select which record types to import (can be added):

Note: On failure, no records will be imported

◆ ImportAllFromNls()

_.Library.Status ImportAllFromNls ( _.Library.Integer  NumImported,
_.Library.Integer  Flags,
_.Library.Integer  Deep,
_.Library.String  Ref 
)
static

Imports all Locale records from ^nls.



Parameters:

  • NumImported (byref) - Returns number of records imported
  • Flags - Control import
    • Bit 0 - Do not import records, just return count
  • Deep - If true also import referenced Tables
  • Ref - Source global reference

◆ ImportDir()

_.Library.Status ImportDir ( _.Library.String  Dir,
_.Library.String  NumImported,
_.Library.Boolean  forcemulticompile 
)
static

Imports locale files from a directory.



Parameters:

  • Dir - Directory to import NLS files from
  • NumImported (byref) - Returns number of locales imported.

◆ ImportFromNls()

_.Library.Status ImportFromNls ( _.Library.String  Name,
_.Library.String  Ref 
)
static

Imports one Locale record from ^nls.



Parameters:

  • Name - Locale name
  • Ref - Source global reference

◆ ImportLegacy()

_.Library.Status ImportLegacy ( _.Library.String  FileName,
_.Library.String  NumImported,
_.Library.Integer  SelBits,
_.Library.String  Warnings 
)
static

Imports all NLS records from a legacy goq file.



Parameters:

  • FileName - Filename to import NLS records from
  • NumImported (byref) - Returns number of records imported for each type of NLS record:
    • NumImported("Locales")
    • NumImported("Tables")
    • NumImported("SubTables")
  • SelBits - Select which record types to import (can be added):
  • Warnings - Returned list of warnings

Note: System records are skipped

◆ Install()

_.Library.Status Install ( _.Library.String  Locale)
static

Sets the new "current locale" and loads its tables.

If the desired locale is not loadable, compiles it it before the installation.

Parameter:

  • Locale - Locale name

◆ IsInstallable()

_.Library.Boolean IsInstallable ( _.Library.String  Name,
_.Library.String  Errors,
_.Library.String  Warnings 
)
static

Checks whether a locale can be installed in the current system<br>

Parameters:

  • Name - Locale name
  • Errors - Returned list of errors

Warnings - Returned list of warnings Returns: True if the locale can be installed
False otherwise

◆ IsLoadable()

_.Library.Boolean IsLoadable ( _.Library.String  Name,
_.Library.ObjectHandle  Locale,
_.Library.String  Errors 
)
static

Verifies whether a locale can be loaded<br>

Parameters:

  • Name - Locale name
  • Locale - Returned locale reference
  • Errors - Returned list of errors

Returns: True if all its tables are loadable
False otherwise

◆ IsValid()

_.Library.Boolean IsValid ( _.Library.String  Name,
_.Library.String  Errors,
_.Library.String  Warnings 
)
static

Verifies validity of locale<br>

Parameters:

  • Name - Locale name
  • Errors - Returned list of errors

Warnings - Returned list of warnings Returns: True if the locale has a consistent definition
False otherwise

◆ Load()

_.Library.Status Load ( _.Library.String  Locale)
static

Loads all the tables from a Locale and sets the.

defaults as approprate

◆ Modify()

_.Library.Status Modify ( _.Library.String  Name,
_.Library.String  Properties 
)
static

Modifies an existing Locale's properties in the NLS database.



Parameters:

  • Name - Name of the Locale to modify
  • Properties - Array of properties to modify. If a specific property is not passed in the properties array, or is the same as the existing value, the value is not modified.

Member Data Documentation

◆ AM

AM

Sufix which may optionally be appended to time values.

prior to 12 noon.

Example: "AM"  

◆ AccentTable

AccentTable

The default accent table.

 

◆ AccentTables

AccentTables

List of available accent tables.

 

◆ CharacterSet

CharacterSet

Name of character set on which this locale is based.



Examples: "Latin1", "CP1251", "Unicode"  

◆ CollationTable

CollationTable

The default collation table.

 

◆ CollationTables

CollationTables

List of available collation tables.

 

◆ Country

Country

Country supported by this locale.

 

◆ CountryAbbr

CountryAbbr

ISO 3166 two-letter abbreviation of Country.



Example: US  

◆ Currency

Currency

Currency symbol (string) encoded in native character set.

 

◆ DateFormat

DateFormat

The DateFormat code used whenever a $ZDATE, $ZDATEH,.

$ZDATETIME or $ZDATETIMEH function call omits its second parameter, or specifies a second parameter value of -1.

Example: 1  

◆ DateMaximum

DateMaximum

The maximum value for a date allowed in $ZDATE, $ZDATEH,.

$ZDATETIME or $ZDATETIMEH functions.

Example: 94232 (12/30/2098)  

◆ DateMinimum

DateMinimum

The minimum value for a date allowed in $ZDATE, $ZDATEH,.

$ZDATETIME or $ZDATETIMEH functions.

Example: 1  

◆ DateSeparator

DateSeparator

The character used to delimit the months, days, and years.

of those dates which are otherwise entirely numeric.

Example: "/"  

◆ DecimalSeparator

DecimalSeparator

The character used by the $FNUMBER function to separate.

the whole part of a number from the fractional part of the number. Also used by $ZDATETIME, $ZDATETIMEH, $ZTIME and $ZTIMEH to separate the whole part of the seconds from the optional fractional part of the seconds, if any.

Example: "."  

◆ Description

Description

Simple description of locale.

Usually in one of these formats:

  • <country>,<language>,<character set>
  • <comment>,<character set>

 

◆ IdentifierTable

IdentifierTable

The default identifier table.

 

◆ IdentifierTables

IdentifierTables

List of available identifier tables.

 

◆ Language

Language

Localization language for this locale.

 

◆ LanguageAbbr

LanguageAbbr

ISO 639-2 two-letter abbreviation of Language.

possibly followed by "-" and CountryAbbr.

Examples: fr, en-US  

◆ LowerCaseTable

LowerCaseTable

The default lower-case table.

 

◆ LowerCaseTables

LowerCaseTables

List of available lower-case tables.

 

◆ Midnight

Midnight

The suffix which may optionally be appended to time.

values corresponding to exactly 12 midnight.

Example: "MIDNIGHT"  

◆ MinusSign

MinusSign

The character which may precede or follow a negative.

numeric quantity formatted by the $FNUMBER function.

Example: "-"  

◆ MonthAbbr

MonthAbbr

The abbreviations of the names of the twelve months,.

used whenever a $ZDATE, $ZDATEH, $ZDATETIME or $ZDATETIMEH function call omits its MonthNameList parameter, or specifies a MonthNameList parameter value of -1, and the selected date format uses month name abbreviations (i.e., the effective DateFormat code is 0, 2, 5, 6 or 7)

Example: " Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec"  

◆ MonthName

MonthName

The full names of the twelve months, used whenever a.

$ZDATE, $ZDATEH, $ZDATETIME or $ZDATETIMEH function call omits its MonthNameList parameter, or specifies a MonthNameList parameter value of -1, and the selected date format uses full month names (i.e., the effective DateFormat code is 9).

Example: " January February March April... November December"  

◆ Name

Name

Code name of the locale.

Generally this is a 3-letter code

expressing the language and country followed by a character size indicator: "8" for 8-bit character sets and "w" for Unicode.  

◆ Noon

Noon

The suffix which may optionally be appended to time values.

corresponding to exactly 12 noon.

Example: "NOON"  

◆ NumericGroupSeparator

NumericGroupSeparator

The character used to separate groups of numeric digits.

within the whole number portion of a number formatted by the $FNUMBER function.

Example: ","  

◆ NumericGroupSize

NumericGroupSize

The number of digits in a numeric group formatted by the.

$FNUMBER function.

Example: 3  

◆ PM

PM

The suffix which may optionally be appended to time values.

at or after 12 noon.

Example: "PM"  

◆ PatternTable

PatternTable

The default pattern match table.

 

◆ PatternTables

PatternTables

List of available pattern match tables.

 

◆ PhysicalCursor

PhysicalCursor

True if terminals should have Physical Cursor set by default.


Used by Japanese locales  

◆ PlusSign

PlusSign

The character which may optionally precede or follow a.

non-negative numeric quantity formatted by the $FNUMBER function.

Example: "+"  

◆ Resource

Resource

◆ TimeFormat

TimeFormat

The TimeFormat code used whenever a $ZDATETIME, $ZDATETIMEH,.

$ZTIME or $ZTIMEH function call omits its TimeFormat parameter, or specifies a TimeFormat parameter value of -1.

Example: 1  

◆ TimePrecision

TimePrecision

The number of fractional digits displayed in a time value.

whenever a $ZDATETIME or $ZTIME function call omits its Precision parameter, or specifies a Precision parameter value of -1.

Example: 0  

◆ TimeSeparator

TimeSeparator

The character used to delimit the hours, minutes and seconds.

in a time value.

Example: ":"  

◆ TitleCaseTable

TitleCaseTable

The default title-case table.

 

◆ TitleCaseTables

TitleCaseTables

List of available title-case tables.

 

◆ TranDDP

TranDDP

The default translation table for DDP.

 

◆ TranDTMDCP

TranDTMDCP

The default translation table for DTM-DCP.

 

◆ TranMagTape

TranMagTape

The default translation table for magtapes.

 

◆ TranPrinter

TranPrinter

The default translation table for printers.

 

◆ TranProgrammer

TranProgrammer

The default translation table for the InterSystems IRIS Terminal.

 

◆ TranSequential

TranSequential

The default translation table for files and other sequential devices.

 

◆ TranSystemCall

TranSystemCall

The default translation table for OS system calls.

 

◆ TranTCP

TranTCP

The default translation table for TCP/IP connections.

 

◆ TranTerminal

TranTerminal

The default translation table for LAT and Telnet terminals.

 

◆ TranZCVT

TranZCVT

The default translation table for $ZCVT().

 

◆ UpperCaseTable

UpperCaseTable

The default upper-case table.

 

◆ UpperCaseTables

UpperCaseTables

List of available upper-case tables.

 

◆ WeekdayAbbr

WeekdayAbbr

The abbreviations of the names of the seven days of the.

week, starting with Sunday and ending with Saturday, used whenever a $ZDATE or $ZDATEIME function call selects a date format which uses weekday name abbreviations (i.e., the effective DateFormat code is 11).

Example: " Sun Mon Tue Wed Thu Fri Sat"  

◆ WeekdayName

WeekdayName

The full names of the seven days of the week, starting.

with Sunday and ending with Saturday, used whenever a $ZDATE or $ZDATEIME function call selects a date format which uses full weekday names (i.e., the effective DateFormat code is 12).

Example: " Sunday Monday Tuesday... Friday Saturday"  

◆ XLTTables

XLTTables

("table name")=$LB(InputFrom,InputTo,OutputFrom,OutputTo)

Example: TranslationTables("LatinG")=$LB("LatinG","Unicode","Unicode","LatinG")  

◆ XYTable

XYTable

The default $X/$Y table.

 

◆ XYTables

XYTables

List of available $X/$Y tables.

 

◆ YearOption

YearOption

The YearOption code used whenever a $ZDATE, $ZDATEH,.

$ZDATETIME or $ZDATETIMEH function call omits its YearOption parameter, or specifies a YearOption parameter value of -1.

Example: 0