DOC HOME SITE MAP MAN PAGES GNU INFO SEARCH PRINT BOOK
 
Constructing and using message catalogs

Creating a message catalog

Before you can use message catalogs within programs, they need to be constructed first. The following two code fragments are the message source files for the same message in the English and French languages respectively.

English language message catalog (english/hello.text)

  1 $set 1
  2 1 Hello everyone. It's
  3 2 %a %b %d %T %y

line 1
Each message is identified by a set number and then a message number. This line defines the set number to be 1.

line 2
This line defines the message number to be 1 also. Therefore the message is identified as message 1 in set 1. Following the message id is the actual body of the message. Quotation marks are not necessary.

line 3
Similarly, this line defines the message number to be 2, identifying this as message 2 in set 1.

French language message catalog (french/hello.text)

  1 $set 1
  2 1 Bonjour tout le monde.  C'est
  3 2 %a %d %b %Hh%M %Y

lines 1-3
These lines serve the same purpose as in the first example except the body of the message is in French. Thus, if the French language was used, this message would be printed instead.


Next topic: Code example using a message catalog
Previous topic: Constructing and using message catalogs

© 2003 Caldera International, Inc. All rights reserved.
SCO OpenServer Release 5.0.7 -- 11 February 2003