DOC HOME SITE MAP MAN PAGES GNU INFO SEARCH PRINT BOOK
 
(1tcl) commands by type

XPG/3 message catalog commands

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 and menus 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 allows the programs to continue without difficulty when no catalogs are present.

Thus, 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.

Available commands are:


catclose(1tcl)
closes the message catalog specified by cathandle

catgets(1tcl)
retrieves a message from a message catalog

catopen(1tcl)
opens the specified message catalog

© 2004 The SCO Group, Inc. All rights reserved.
UnixWare 7 Release 7.1.4 - 27 April 2004