Class Reference
IRIS for UNIX 2019.2
InterSystems: The power behind what matters   
Documentation  Search
  [%SYS] >  [Config] >  [NLS] >  [Locales]
Private  Storage   

persistent class Config.NLS.Locales extends %Persistent, %XML.Adaptor, %SYSTEM.Help

This class is a description of a locale. A locale contains:


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.

Inventory

Parameters Properties Methods Queries Indices ForeignKeys Triggers
1 56 48 3 1


Summary

Properties
AM CharacterSet CollationTable CollationTables
Country CountryAbbr Currency DateFormat
DateMaximum DateMinimum DateSeparator DecimalSeparator
Description IdentifierTable IdentifierTables Language
LanguageAbbr LowerCaseTable LowerCaseTables Midnight
MinusSign MonthAbbr MonthName Name
Noon NumericGroupSeparator NumericGroupSize PM
PatternTable PatternTables PhysicalCursor PlusSign
Resource TimeFormat TimePrecision TimeSeparator
TitleCaseTable TitleCaseTables TranDDP TranDTMDCP
TranMagTape TranPrinter TranProgrammer TranSequential
TranSystemCall TranTCP TranTerminal TranZCVT
UpperCaseTable UpperCaseTables WeekdayAbbr WeekdayName
XLTTables XYTable XYTables YearOption

Methods
%AddToSaveSet %AddToSyncSet %BMEBuilt %CheckConstraints
%CheckConstraintsForExtent %ClassIsLatestVersion %ClassName %ComposeOid
%ConstructClone %Delete %DeleteExtent %DeleteId
%DispatchClassMethod %DispatchGetModified %DispatchGetProperty %DispatchMethod
%DispatchSetModified %DispatchSetMultidimProperty %DispatchSetProperty %Exists
%ExistsId %Extends %GUID %GUIDSet
%GetLock %GetParameter %GetSwizzleObject %Id
%InsertBatch %IsA %IsModified %IsNull
%KillExtent %KillExtentData %LoadFromMemory %LockExtent
%LockId %New %NormalizeObject %ObjectIsNull
%ObjectModified %Oid %OnBeforeAddToSync %OnDetermineClass
%Open %OpenId %OriginalNamespace %PackageName
%PhysicalAddress %PurgeIndices %Reload %RemoveFromSaveSet
%ResolveConcurrencyConflict %RollBack %Save %SaveDirect
%SaveIndices %SerializeObject %SetModified %SortBegin
%SortEnd %SyncObjectIn %SyncTransport %UnlockExtent
%UnlockId %ValidateIndices %ValidateObject Compile
CompileAll Create Delete Exists
Export ExportAllToNls ExportDir ExportList
ExportToNls Get GetTables Help
Import ImportAll ImportAllFromNls ImportDir
ImportFromNls ImportLegacy Install IsInstallable
IsLoadable IsValid Load Modify
OpenCurrent Reload ValidateConfigDefaults XMLDTD
XMLExport XMLExportToStream XMLExportToString XMLNew
XMLSchema XMLSchemaNamespace XMLSchemaType


Parameters

• parameter DOMAIN = "%Utility";
Default Localization Domain

Properties

• property AM as %String;
Sufix which may optionally be appended to time values prior to 12 noon.

Example: "AM"
• property CharacterSet as %String(MAXLEN=64,MINLEN=1) [ Required ];
Name of character set on which this locale is based.

Examples: "Latin1", "CP1251", "Unicode"
• property CollationTable as %String(MAXLEN=64,MINLEN=1) [ Required ];
The default collation table.
• property CollationTables as list of %String(MAXLEN=64,MINLEN=1) [ Required ];
List of available collation tables.
• property Country as %String(MAXLEN=64,MINLEN=1) [ Required ];
Country supported by this locale.
• property CountryAbbr as %String(MAXLEN=2,MINLEN=2) [ Required ];
ISO 3166 two-letter abbreviation of Country.

Example: US
• property Currency as %String(MINLEN=1);
Currency symbol (string) encoded in native character set.
• property DateFormat as %Integer;
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
• property DateMaximum as %Integer;
The maximum value for a date allowed in $ZDATE, $ZDATEH, $ZDATETIME or $ZDATETIMEH functions.

Example: 94232 (12/30/2098)
• property DateMinimum as %Integer;
The minimum value for a date allowed in $ZDATE, $ZDATEH, $ZDATETIME or $ZDATETIMEH functions.

Example: 1
• property DateSeparator as %String(MAXLEN=1,MINLEN=1) [ Required ];
The character used to delimit the months, days, and years of those dates which are otherwise entirely numeric.

Example: "/"
• property DecimalSeparator as %String(MAXLEN=1,MINLEN=1) [ Required ];
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: "."
• property Description as %String(MAXLEN=128);
Simple description of locale. Usually in one of these formats:
  • <country>,<language>,<character set>
  • <comment>,<character set>
• property IdentifierTable as %String(MAXLEN=64,MINLEN=1) [ Required ];
The default identifier table.
• property IdentifierTables as list of %String(MAXLEN=64,MINLEN=1) [ Required ];
List of available identifier tables.
• property Language as %String(MAXLEN=64,MINLEN=1) [ Required ];
Localization language for this locale.
• property LanguageAbbr as %String(MAXLEN=5,MINLEN=2) [ Required ];
ISO 639-2 two-letter abbreviation of Language possibly followed by "-" and CountryAbbr.

Examples: fr, en-US
• property LowerCaseTable as %String(MAXLEN=64,MINLEN=1);
The default lower-case table.
• property LowerCaseTables as list of %String(MAXLEN=64,MINLEN=1);
List of available lower-case tables.
• property Midnight as %String;
The suffix which may optionally be appended to time values corresponding to exactly 12 midnight.

Example: "MIDNIGHT"
• property MinusSign as %String(MAXLEN=1,MINLEN=1) [ Required ];
The character which may precede or follow a negative numeric quantity formatted by the $FNUMBER function.

Example: "-"
• property MonthAbbr as %String(MAXLEN=100,MINLEN=1) [ Required ];
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"
• property MonthName as %String(MAXLEN=100,MINLEN=1) [ Required ];
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"
• property Name as %String(MAXLEN=64) [ Required ];
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.
• property Noon as %String;
The suffix which may optionally be appended to time values corresponding to exactly 12 noon.

Example: "NOON"
• property NumericGroupSeparator as %String(MAXLEN=1,MINLEN=1) [ Required ];
The character used to separate groups of numeric digits within the whole number portion of a number formatted by the $FNUMBER function.

Example: ","
• property NumericGroupSize as %Integer;
The number of digits in a numeric group formatted by the $FNUMBER function.

Example: 3
• property PM as %String;
The suffix which may optionally be appended to time values at or after 12 noon.

Example: "PM"
• property PatternTable as %String(MAXLEN=64,MINLEN=1) [ Required ];
The default pattern match table.
• property PatternTables as list of %String(MAXLEN=64,MINLEN=1) [ Required ];
List of available pattern match tables.
• property PhysicalCursor as %Boolean;
True if terminals should have Physical Cursor set by default.
Used by Japanese locales
• property PlusSign as %String(MAXLEN=1,MINLEN=1) [ Required ];
The character which may optionally precede or follow a non-negative numeric quantity formatted by the $FNUMBER function.

Example: "+"
• property Resource as %Integer;
Deprecated. For compatibility with previous versions.
• property TimeFormat as %Integer;
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
• property TimePrecision as %Integer;
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
• property TimeSeparator as %String(MAXLEN=1,MINLEN=1) [ Required ];
The character used to delimit the hours, minutes and seconds in a time value.

Example: ":"
• property TitleCaseTable as %String(MAXLEN=64,MINLEN=1);
The default title-case table.
• property TitleCaseTables as list of %String(MAXLEN=64,MINLEN=1);
List of available title-case tables.
• property TranDDP as %String(MAXLEN=64,MINLEN=1) [ Required ];
The default translation table for DDP.
• property TranDTMDCP as %String(MAXLEN=64,MINLEN=1) [ Required ];
The default translation table for DTM-DCP.
• property TranMagTape as %String(MAXLEN=64,MINLEN=1) [ Required ];
The default translation table for magtapes.
• property TranPrinter as %String(MAXLEN=64,MINLEN=1) [ Required ];
The default translation table for printers.
• property TranProgrammer as %String(MAXLEN=64,MINLEN=1) [ Required ];
The default translation table for the InterSystems IRIS Terminal.
• property TranSequential as %String(MAXLEN=64,MINLEN=1) [ Required ];
The default translation table for files and other sequential devices.
• property TranSystemCall as %String(MAXLEN=64,MINLEN=1) [ Required ];
The default translation table for OS system calls.
• property TranTCP as %String(MAXLEN=64,MINLEN=1) [ Required ];
The default translation table for TCP/IP connections.
• property TranTerminal as %String(MAXLEN=64,MINLEN=1) [ Required ];
The default translation table for LAT and Telnet terminals.
• property TranZCVT as %String(MAXLEN=64,MINLEN=1) [ Required ];
The default translation table for $ZCVT().
• property UpperCaseTable as %String(MAXLEN=64,MINLEN=1);
The default upper-case table.
• property UpperCaseTables as list of %String(MAXLEN=64,MINLEN=1);
List of available upper-case tables.
• property WeekdayAbbr as %String(MAXLEN=100,MINLEN=1) [ Required ];
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"
• property WeekdayName as %String(MAXLEN=100,MINLEN=1) [ Required ];
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"
• property XLTTables as array of %List;
("table name")=$LB(InputFrom,InputTo,OutputFrom,OutputTo)
Example: TranslationTables("LatinG")=$LB("LatinG","Unicode","Unicode","LatinG")
• property XYTable as %String(MAXLEN=64,MINLEN=1) [ Required ];
The default $X/$Y table.
• property XYTables as list of %String(MAXLEN=64,MINLEN=1) [ Required ];
List of available $X/$Y tables.
• property YearOption as %Integer;
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

Methods

• classmethod Compile(Name As %String) as %Status
Compiles a single Locale

Parameters:
  • Name - Locale name
• classmethod CompileAll() as %Status
Compiles all Tables from all Locales

• classmethod Create(Name As %String, ByRef Properties As %String) as %Status
Creates a Locale in the NLS database.

Parameters:
  • Name - Name of the Locale to create
  • Properties - Array of properties corresponding to the class properties
• classmethod Delete(Name As %String) as %Status
Deletes a Locale from the NLS database.

Parameters:
  • Name - Name of Locale to delete
• classmethod Exists(Name As %String, ByRef Locale As %ObjectHandle, ByRef Status As %Status) as %Boolean
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
• classmethod Export(FileName As %String = "Locales.xml", ByRef NumExported As %Integer, Locales As %String = "*") as %Status
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
• classmethod ExportAllToNls(ByRef NumExported As %Integer, Deep As %Integer = 0) as %Status
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
• classmethod ExportDir(Dir As %String, ByRef NumExported As %Integer, Locales As %String = "*") as %Status
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
• classmethod ExportList(FileName As %String = "LocalesExport.xml", ByRef NumExported As %Integer, ByRef Locales As %String) as %Status
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
• classmethod ExportToNls(Name As %String, Deep As %Integer = 0) as %Status
Exports one Locale record to ^%nls.

Parameters:
  • Name - Locale name
  • Deep - If true exports all associated Tables.
• classmethod Get(Name As %String, ByRef Properties As %String) as %Status
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
• method GetTables(ByRef Tables As %String)
Gets all tables defined in a locale and creates an array with Table(,,)
• classmethod Import(FileName As %String = "Locales.xml", ByRef NumImported As %Integer, Flags As %Integer = 0) as %Status
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
• classmethod ImportAll(FileName As %String = "LocalesExport.xml", ByRef NumImported As %String, SelBits As %Integer = -1) as %Status
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):
    • 1 - SubTables
    • 2 - Tables
    • 4 - Locales
Note: On failure, no records will be imported
• classmethod ImportAllFromNls(ByRef NumImported As %Integer, Flags As %Integer = 0, Deep As %Integer = 0, Ref As %String = "^%nls") as %Status
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
• classmethod ImportDir(Dir As %String, ByRef NumImported As %String, forcemulticompile As %Boolean = "") as %Status
Imports locale files from a directory.

Parameters:
  • Dir - Directory to import NLS files from
  • NumImported (byref) - Returns number of locales imported.
• classmethod ImportFromNls(Name As %String, Ref As %String = "^%nls") as %Status
Imports one Locale record from ^%nls.

Parameters:
  • Name - Locale name
  • Ref - Source global reference
• classmethod ImportLegacy(FileName As %String, ByRef NumImported As %String, SelBits As %Integer = -1, ByRef Warnings As %String) as %Status
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):
    • 1 - SubTables
    • 2 - Tables
    • 4 - Locales
  • Warnings - Returned list of warnings
Note: System records are skipped
• classmethod Install(Locale As %String) as %Status
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
• classmethod IsInstallable(Name As %String, ByRef Errors As %String, ByRef Warnings As %String) as %Boolean
Checks whether a locale can be installed in the current system

Parameters:
  • Name - Locale name
  • Errors - Returned list of errors
  • Warnings - Returned list of warnings
  • Returns: True if the locale can be installed
    False otherwise
    • classmethod IsLoadable(Name As %String, ByRef Locale As %ObjectHandle, ByRef Errors As %String) as %Boolean
    Verifies whether a locale can be loaded

    Parameters:
    • Name - Locale name
    • Locale - Returned locale reference
    • Errors - Returned list of errors
    Returns: True if all its tables are loadable
    False otherwise
    • classmethod IsValid(Name As %String, ByRef Errors As %String, ByRef Warnings As %String) as %Boolean
    Verifies validity of locale

    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
    • classmethod Load(Locale As %String) as %Status
    Loads all the tables from a Locale and sets the defaults as approprate
    • classmethod Modify(Name As %String, ByRef Properties As %String) as %Status
    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.
    • classmethod OpenCurrent(ByRef Status As %Status = 1) as %ObjectHandle
    Opens current Locale
    • classmethod Reload() as %Status
    Reload the current locale to activate changes in configured defaults
    • method ValidateConfigDefaults() as %Status
    Remove any configured table default not available in this locale

    Queries

    • query Detail(Names As %String)
    Selects Name As %String, Description As %String
    List all Locale records, brief display.
    Names - Comma separated list of Locale names, "*" = All
    Note: This query may change in future versions
    • query List(Names As %String)
    Selects Name As %String, Description As %String

    Indices

    •index (NameIndex on Name) [IdKey];


    Copyright (c) 2019 by InterSystems Corporation. Cambridge, Massachusetts, U.S.A. All rights reserved. Confidential property of InterSystems Corporation.