Software Internationalization Guide
POSIX and XPG Internationalization Model
Software Internationalization Guide—526225-002
3-8
Creating Message Source Files
symbolic identifiers into numeric constants, then produces a set of commands suitable
for passing to the gencat utility.
gencat creates and modifies a message catalog from a message text source file.
runcat runs mkcatdefs and sends its output to gencat.
Two other messaging system utilities are available. The dspcat utility displays all or
part of a message catalog; the dspmsg utility writes a selected message to standard
output.
For more information about these messaging system utilities, see Generating Message
Catalogs on page 3-9 and the associated reference pages either online or in the Open
System Services Shell and Utilities Reference Manual.
Creating Message Source Files
To create message source files, programmers separate user-visible text from the
program source code and store it in one or more message source files. User-visible
text includes messages, errors, warnings, help text, command prompts, and responses
to prompts. Isolating messages beginning in the early stages of development avoids
later rework to extract message text from the source code.
Example: Source Code That is not Internationalized
This example shows the source code of a program that has not been internationalized:
/*Existing program source code that has not been internationalized*/
/*Use of hard-coded message text*/
#include <stdio.h>
main()
{
char response;
printf("Main Menu\n");
printf("1 - Add Record\n");
printf("2 - Delete Record\n");
printf("3 - Modify Record\n");
printf("4 - Quit\n\n\n\n\n");
printf("Make A Selection:");
scanf("%c",&response);
switch (response)
{
case '1': add_record_module();
break;
case '2': delete_record_module();
break;
case '3': modify_record_module();
break;
case '4': break;
default: printf("You pressed an invalid key. Try Again\n");
}
}