HP 9000 User Manual page 125

Computers
Hide thumbs Also See for 9000:
Table of Contents

Advertisement

The command findstr will examine a
C
source program and find all string
constants (other than those that appear in comments). These strings, along
with their quotes, are written to standard output along with information
indicating the position of the string in the source file. A typical use would be:
findstr prog.c
>
prog.str
The string file prog. str would now contain a copy of each string found in
prog. c.
The findstr command expects the strings of your program to be syntactically
correct with the quotes properly matched. To ensure that this is the case, it is
a good policy to use f indstr only on tested programs.
Step 2. Removing Non-Messages from the Strings
Most of these strings in the string file are messages and would need to be
localized. Some of the strings, however, would never be localized. For example,
the type specifier for fopen is a string such as IIrll or IIW+ II . These strings
are not messages and would not be localized. Some format strings would be
localized but some would not. The string file must be reviewed and any entries
for non-message strings should be removed.
When editing the string file, take care not to modify the location information
for strings that are left in the file. Also, note that if the source file is changed,
the string file may be invalidated and should be re-generated.
7
Step 3. Inserting catgets Calls
Once the string file contains only the strings that will need localization, you are
ready to create a messaging version of your program.
This is done using the insertmsg command which takes care of a few
administrative details:
• It
assigns a message number to each string in the string file and writes the
numbered messages to standard out in a format suitable for use by gencat.
This is the message text source file for the program .
• It
creates a copy of the source program in which each string identified in the
string file is replaced by a catgets call with the assigned message number.
The name of the new source program file is the name of the original source
file with the prefix nl_.
7 -18
The Message Catalog System

Advertisement

Table of Contents
loading

Table of Contents