The locales file, called locales.dat, provides platform-specific locale information in a Sybase proprietary format. This file associates locale names with languages, character sets and collating sequences.
Open Client and Open Server applications use locales.dat to determine what localization information to load. The locales.dat file directs Open Client and Open Server applications to localization information, but it does not contain actual localized messages or character set information.
The locales.dat file is located in the $SYBASE/locales directory. See “Localization files” for a diagram of the $SYBASE/locales directory structure.
locales.dat contains platform-specific sections, each of which contains predefined locale definition entries. These entries vary by platform, but all sections include an entry defining a “default” locale.
Locale definition entries have the form:
locale = locale_name, language_name, charset_name [,sortorder_name]
where:
locale_name is the name of the locale definition. The default values for locale_name are vendor-specified and based on POSIX terminology. Comments at the end of locales.dat list POSIX values for locale names.
, (comma) is the list separator character for the file.
language_name is the subdirectory name by which Sybase products recognize the language.
charset_name is the subdirectory name by which Sybase products recognize the character set.
sortorder_name is the file name by which Sybase products recognize the collating sequence (optional).
The following locales.dat file entry specifies a French locale. Because no sort order is specified, the default sort order “binary” is used with this locale:
locale = fr.FR.88591, french, iso_1
The following portion of locales.dat illustrates a platform-specific section:
[aix]
locale = C, us_english, iso_1
locale = En_US, us_english, iso_1
locale = en_US, us_english, iso_1
locale = default, us_english, iso_1
locale = japanese.sjis, japanese, sjis
locale = japanese, japanese, eucjis
locale = us_english.utf8, us_english, utf8
If the predefined entries in locales.dat do not meet your needs, edit the file with an operating system editor such as vi.
WARNING! Before you edit, make a copy of the original locales.dat. The copy will help you solve any problems with the edited version. Also, review the entries for your platform to see if an entry already exists.
Edit locales.dat to:
Change the “default” locale definition.
Add a locale definition.
Match a locale name used by non-Sybase software. For example, the Sybase predefined locale name is “fr”:
locale = fr, french, iso_1
If a non-Sybase application requires a value of “french” for the LC_ALL environment variable, change the locale name to:
locale = french, french, iso_1
To add a new entry to locales.dat or to change an existing entry:
Choose any value for locale_name.
Determine the value for language_name.
When a Sybase language module is installed, a subdirectory for the language is created in the locales/message directory of the Sybase directory tree. language_name must correspond to this subdirectory’s name.
Determine the value for charset_name.
When a Sybase language module is installed, subdirectories for each supported character set are created in the charsets directory of the Sybase directory tree. charset_name must correspond to one of these subdirectory names.
Determine the value for sortorder_name (if you want a sort order other than binary).
The charsets/charset_name subdirectory contains the sort order (*.srt) files for the character set. sortorder_name must correspond to one of these file names (without the .srt).
In the appropriate platform-specific section of the locales.dat file, type in or change the appropriate entry.
Update localization environment variables (LC_ALL, LC_CTYPE, LC_MESSAGE, LC_TIME, LANG) as appropriate.
If you have added a new locale name and you want existing applications to use this new name in cs_locale calls, edit and recompile the applications as appropriate.
It is not necessary to delete entries from locales.dat,
even if applications no longer use them. If you decide to delete
an entry, make sure no application uses it.