home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
OS/2 Shareware BBS: 10 Tools
/
10-Tools.zip
/
i18nv104.zip
/
DOC
/
CVTMSG.DOC
next >
Wrap
Text File
|
1996-02-13
|
8KB
|
209 lines
===============================================================================
CVTMSG Utility January 1995
===============================================================================
/************************/
/*** Contents ***/
/************************/
1. Overview
2. Command parameters
3. Input file
4. Output file
5. Function
1. Overview
============
Convert Message (CVTMSG) is used to convert the source for an OS/2 message file
(Make Message File (MKMSGF) format) into the source for an XPG/4 message file
(Internationalization (I18N) Generate Catalog (GENCAT) format).
2. Command Parameters
======================
CVTMSG is an OS/2 program which expects these parameters:
CVTMSG input_OS2_file output_XPG4_file [options]
where:
input_OS2_file This parameter indicates the name of the input file
which contains the message source for the MKMSGF
utility (from the OS/2 Toolkit).
output_XPG4_file This parameter indicates the name of the output file
to which the converted message source will be written
in a format compatible with the GENCAT utility (from
the I18N package).
options /C Include the text from all OS/2 source comments
in the generated XPG/4 message source. Otherwise,
OS/2 comment text is not included in the output
file.
/P Prompt at the beginning of execution to ensure
that the passed parameters were correctly defined.
The user will have the option to terminate
processing before any conversion is performed.
/S Generate symbolic XPG/4 message IDs which are the
same as the OS/2 message ID (3 character component
plus the 4 digit number, i.e. MSG0001). Otherwise,
the XPG/4 message ID will consist of only the
numeric part of the OS/2 message ID (i.e. 0001).
3. Input file
==============
The input file (which is specified by the first parameter) must contain
source which is compilable by the MKMSGF utility from the OS/2 Toolkit. The
input file will not be modified by this process.
For example:
; comment record. Semicolon must be in column 1.
; The next line defines the message component value.
MSG
;
MSG0001E: Message text for message number one, which is an
error message. %1 %2 %3 %4 %5 %6 %7 %8 %9 indicate
replacement variables.
;
; Message number two is not used because of "?" after the number.
MSG0002?:
;
MSG0003I: Message text for message number three, which is an
informational message.
;
MSG0004I: This shows a special variable: %0
;
MSG0005I: This is the last message in this example.
Special conversion considerations:
A. Comments are lines which have a semicolon ";" in column 1. The
entire line is considered part of the comment text.
B. Replacement variables are defined as: %1 %2 %3 %4 %5 %6 %7 %8 %9.
All replacement variables are considered to be character string
values.
C. The value %0 indicates that a new line character is NOT to be
added to the end of this text line; it is NOT a replacement variable.
Any text which follows the %0 is ignored and discarded.
D. Messages defined with a type of "?" are place-holders and do not
really define a usable message.
4. Output file
===============
The output file (which is specified by the second parameter) will contain
the converted message source which is compilable by the GENCAT utility.
For example, the OS/2 message source shown in the "Input File" section above
will create the following XPG/4 message source when the default options are
used (the /C option was specified to include the converted comment text):
$ comment record. Semicolon must be in column 1.
$ The next line defines the message component value.
$
$quote " (Define message text delimiter)
$set 1 (Message component: MSG)
$
0001 "MSG0001: Message text for message number one, which is an\n\
error message. %1$s %2$s %3$s %4$s %5$s %6$s %7$s %8$s %9$s indicate\n\
replacement variables.\n"
$
$ Message number two is not used because of "?" after the number.
$
0003 "Message text for message number three, which is an\n\
informational message.\n"
$
0004 "This shows a special variable: "
$
0005 "This is the last message in this example.\n"
For example, the OS/2 message source shown in the "Input File" section above
will create the following XPG/4 message source when the /S option was specified
to create symbolic message IDs:
$ comment record. Semicolon must be in column 1.
$quote " (Define message text delimiter)
$set 1 (Message component: MSG)
$
MSG0001 "MSG0001: Message text for message number one, which is an\n\
error message. %1$s %2$s %3$s %4$s %5$s %6$s %7$s %8$s %9$s indicate\n\
replacement variables.\n"
MSG0003 "Message text for message number three, which is an\n\
informational message.\n"
MSG0004 "This shows a special variable: "
MSG0005 "This is the last message in this example.\n"
Special conversion considerations:
A. Comments are lines which have "$" in column 1 and a blank in column 2.
Comment text can also be defined on the "$quote" and "$set" statements.
B. The "$set " line defines the delimiter character which is used to
identify the text of the message.
C. Replacement variables are defined as "%n$s", where "n" is a one digit
number (1-9) and "s" identifies the replacement text is a string of
characters.
5. Function
============
The conversion is performed as follows:
A. OS/2 comments are lines which have a semicolon ";" in column 1, with
comment text starting in column 2. The conversion default is that
comments are not included in the output source. When the "/C" option
is specified, OS/2 comments are converted to XPG/4 comments and are
included in the output source. XPG/4 comments have a "$" in column 1,
a blank in column 2, with comment text starting in column 3.
B. Converted message text will always be delimited with double quotes.
This tool will add a $quote " statement for this purpose.
C. All converted messages will always be added to be XPG/4 message set
number 1. This tool will add a "$set 1" statement for this purpose.
D. The formatting of the OS/2 message text will be preserved in the
converted XPG/4 message text. New line characters "\n" will be added
to maintain formatting.
E. A new line character will be added at the end of the XPG/4 message
text when "%0" is not defined at the end of the OS/2 message text.
F. OS/2 replacement variables are defined as: %1 %2 %3 %4 %5 %6 %7 %8 %9,
and are always considered to be character string values. Each
variable is converted to an equivalent XPG/4 variable format:
%1$s %2$s %3$s %4$s %5$s %6$s %7$s %8$s %9$s. The one digit number
remains the same (to insure proper sequencing) and each variable
must be a character string replacement variable.
G. OS/2 messages defined with a type of "?" are place-holders and do not
really define a usable message. These messages are not included in
the output XPG/4 message file.
H. OS/2 messages which have a message type of "E" (error) or "W" (warning)
will have the message identifier added to the beginning of the message
text (see MSG0001 in the above example). This will simulate the
function provided by DosGetMessage for these types of messages.