SCO Visual Tcl Reference Guide
Chapter 2, TclX - the Extended Tcl language

XPG/3 message catalog commands (TCLX)

XPG/3 message catalog commands (TCLX)

These commands provide a Tcl interface to message catalogs that are compliant with the X/Open Portability Guide, Version 3 (XPG/3).

Tcl programmers can use message catalogs to create applications that are language-independent. Through the use of message catalogs, prompts, messages, menus and so forth can exist for any number of languages, and they can be altered, and new languages added, without affecting any Tcl or C source code, greatly easing the maintenance difficulties incurred by supporting multiple languages.

A default text message is passed to the command that fetches entries from message catalogs. This allows the Tcl programmer to create message catalogs containing messages in various languages, but still have a set of default messages available regardless of the presence of any message catalogs, and allow the programs to press on without difficulty when no catalogs are present.

The normal approach to using message catalogs is to ignore errors on catopen, in which case catgets will return the default message that was specified in the call.

The Tcl message catalog commands normally ignore most errors. If it is desirable to detect errors, a special option is provided. This is normally used only during debugging, to insure that message catalogs are being used. If your UNIX implementation does not have XPG/3 message catalog support, stubs will be compiled that will create a version of catgets that always returns the default string. This allows for easy porting of software to environments that do not have support for message catalogs.

Message catalogs are global to the process. An application with multiple Tcl interpreters within the same process may pass and share message catalog handles.

See the manual pages for the following commands: