'\"macro stdmacro
.if n .pH g1a.mkmsgs @(#)mkmsgs	41.2 of 12/29/89
.\" Copyright 1989 AT&T
.nr X
.if \nX=0 .ds x} mkmsgs 1 "System Administration Utilities" "\&"
.if \nX=1 .ds x} mkmsgs 1 "System Administration Utilities"
.if \nX=2 .ds x} mkmsgs 1 "" "\&"
.if \nX=3 .ds x} mkmsgs "" "" "\&"
.TH \*(x}
.SH NAME
\f4mkmsgs\f1 \- create message files for use by \f4gettxt\fP
.SH SYNOPSIS
\f4mkmsgs\f1
\f1[\f4\-o\f1]
\f1[\f4\-i\f1
.IR locale ]
.I inputstrings
.I msgfile
.SH DESCRIPTION
The 
\f4mkmsgs\fP
utility is used to create a file of text strings that can
be accessed using the text retrieval tools
(see
\f4gettxt\fP(1),
\f4srchtxt\fP(1),
\f4exstr\fP(1),
and
\f4gettxt\fP(3C)).
It will take as input a file of text strings for a particular
geographic locale
(see
\f4setlocale\fP(3C))
and create a file of text strings in a format that can be retrieved by both
\f4gettxt\fP(1) and \f4gettxt\fP(3C).
By using the
\f4\-i\f1
option,
you can install the created file under the
\f4/usr/lib/locale/\f2locale\f4/\s-1LC_MESSAGES\s0\f1
directory
.RI ( locale
corresponds to the language in which the text strings are written).
.P
.TP 12
.I inputstrings
the name of the file that contains the original text strings.
.TP 12
.I msgfile
the name of the output file where
\f4mkmsgs\fP
writes the strings in a format that is readable by
\f4gettxt\fP(1)
and
\f4gettxt\fP(3C).
The name of
.I msgfile
can be up to 14 characters in length,
but may not contain either \e\^\^\f40\fP (null)
or the
.SM ASCII
code for
\f4/\f1
(slash) or
\f4:\f1
(colon).
.TP 12
\f4\-i\f2\ locale\f1
install
.I msgfile
in the
\f4/usr/lib/locale/\f2locale\f4/\s-1LC_MESSAGES\s0\f1
directory.
Only
someone who is super-user
or a member of group \f4bin\f1
can create or overwrite files in this directory.
Directories under
\f4/usr/lib/locale\f1
will be created if they don't exist.
.TP 12
\f4\-o\f1
overwrite
.IR msgfile ,
if it exists.
.P
The input file contains a set of text strings for the particular
geographic locale.
Text strings are separated by a new-line character.
Nongraphic characters must be represented as alphabetic
escape sequences.
Messages are transformed and copied sequentially
from
.I inputstrings
to
.IR msgfile .
To generate an empty message in
.IR msgfile ,
leave an empty line at the correct place in
.IR inputstrings .
.P
Strings can be changed simply by editing the file
.IR inputstrings .
New strings must be added only at the end of the file;
then a new
.I msgfile
file must be created and installed in the correct place.
If this procedure is not followed,
the retrieval function will retrieve the wrong string 
and software compatibility will be broken.
.SH EXAMPLES
The following example shows an input message source file
\f4\s-1C\s0.str\f1:
.sp .5
.RS
.nf
.ft 4
File %s:\\t cannot be opened\\n
%s: Bad directory\\n
	.
	.
	.
write error\\n
	.
	.
.ft
.fi
.RE
.P
The following command uses the input strings from
\f4\s-1C\s0.str\f1
to create text strings in the appropriate format in the file
.SM
\f4UX\f1
in the current directory:
.sp .5
.RS
.ft 4
mkmsgs \s-1C\s0.str \s-1UX\s0
.RE
.P
The following command uses the input strings from
\f4\s-1FR\s0.str\f1
to create text strings in the appropriate format in the file
.SM
\f4UX\f1
in the directory
\f4/usr/lib/locale/french/\s-1LC_MESSAGES\s0/\s-1UX\s0\f1.
.sp .5
.RS
.ft 4
mkmsgs \-i french \s-1FR\s0.str \s-1UX\s0
.ft
.RE
.PP
These text strings would be accessed if you had set the
environment variable
\f4LC_MESSAGES=french\f1
and then invoked one of the text retrieval tools listed at the beginning of the
.SM
DESCRIPTION
section.
.SH FILES
.TP 39
\f4/usr/lib/locale/\f2locale\f4/\s-1LC_MESSAGES\s0/\(**\f1
message files created by
\f4mkmsgs\fP(1M)
.SH SEE ALSO
\f4exstr\fP(1), \f4gettxt\fP(1), \f4srchtxt\fP(1).
.br
\f4gettxt\fP(3C), \f4setlocale\fP(3C) in the
.IR "Programmer's Reference Manual" .
.Ee
