9070 Remove wanboot from gate
[unleashed.git] / usr / src / man / man1 / gettext.1
blob129792825bd44c791b76c52f5ea0827863e7a539
1 '\" te
2 .\"  Copyright (c) 2001, Sun Microsystems, Inc.  All Rights Reserved
3 .\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License").  You may not use this file except in compliance with the License.
4 .\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing.  See the License for the specific language governing permissions and limitations under the License.
5 .\" When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE.  If applicable, add the following below this CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner]
6 .TH GETTEXT 1 "Sep 17, 2001"
7 .SH NAME
8 gettext \- retrieve text string from message database
9 .SH SYNOPSIS
10 .LP
11 .nf
12 \fBgettext\fR [\fB-d\fR \fItextdomain\fR | \fB-\(midomain\fR=\fItextdomain\fR]
13      [\fItextdomain\fR] \fImsgid\fR
14 .fi
16 .LP
17 .nf
18 \fBgettext\fR \fB-s\fR [\fB-e\fR] [\fB-n\fR]
19      [\fB-d\fR \fItextdomain\fR | \fB-\(midomain\fR=\fItextdomain\fR] \fImsgid\fR...
20 .fi
22 .SH DESCRIPTION
23 .sp
24 .LP
25 The \fBgettext\fR utility retrieves a translated text string corresponding to
26 string \fImsgid\fR from a message object generated with \fBmsgfmt\fR(1). The
27 message object name is derived from the optional argument \fItextdomain\fR if
28 present, otherwise from the \fBTEXTDOMAIN\fR environment. If no domain is
29 specified, or if a corresponding string cannot be found, \fBgettext\fR prints
30 \fImsgid\fR.
31 .sp
32 .LP
33 Ordinarily, \fBgettext\fR looks for its message object in
34 \fB/usr/lib/locale/\fIlang\fR/LC_MESSAGES\fR where \fIlang\fR is the locale
35 name. If present, the \fBTEXTDOMAINDIR\fR environment variable replaces the
36 pathname component up to \fIlang\fR.
37 .sp
38 .LP
39 This command interprets C escape sequences such as \fB\et\fR for tab. Use
40 \fB\e\e\fR to print a backslash. To produce a message on a line of its own,
41 either enter \fB\en\fR at the end of \fImsgid\fR, or use this command in
42 conjunction with \fBprintf\fR(1).
43 .sp
44 .LP
45 When used with the \fB-s\fR option, \fBgettext\fR behaves like \fBecho\fR(1).
46 But it does not simply copy its arguments to standard output. Instead, those
47 messages found in the selected catalog are translated.
48 .SH OPTIONS
49 .sp
50 .LP
51 The following options are supported:
52 .sp
53 .ne 2
54 .na
55 \fB\fB-d\fR \fItextdomain\fR\fR
56 .ad
57 .br
58 .na
59 \fB\fB-\(midomain\fR=\fItextdomain\fR\fR
60 .ad
61 .RS 26n
62 Retrieves translated messages from the domain \fItextdomain\fR, if
63 \fItextdomain\fR is not specified as an operand.
64 .RE
66 .sp
67 .ne 2
68 .na
69 \fB\fB-e\fR\fR
70 .ad
71 .RS 26n
72 Enables expansion of some escape sequences if used with the \fB-s\fR option.
73 .RE
75 .sp
76 .ne 2
77 .na
78 \fB\fB-n\fR\fR
79 .ad
80 .RS 26n
81 Suppresses trailing newline if used with the \fB-s\fR option.
82 .RE
84 .sp
85 .ne 2
86 .na
87 \fB\fB-s\fR\fR
88 .ad
89 .RS 26n
90 Behaves like \fBecho\fR(1) (see DESCRIPTION above). If the \fB-s\fR option is
91 specified, no expansion of C escape sequences is performed and a newline
92 character is appended to the output, by default.
93 .RE
95 .SH OPERANDS
96 .sp
97 .LP
98 The following operands are supported:
99 .sp
100 .ne 2
102 \fB\fItextdomain\fR\fR
104 .RS 14n
105 A domain name used to retrieve the messages. This overrides the specification
106 by the \fB-d\fR or \fB-\(midomain\fR options, if present.
110 .ne 2
112 \fB\fImsgid\fR\fR
114 .RS 14n
115 A key to retrieve the localized message.
118 .SH ENVIRONMENT VARIABLES
120 .ne 2
122 \fB\fBLANG\fR\fR
124 .RS 17n
125 Specifies locale name.
129 .ne 2
131 \fB\fBLC_MESSAGES\fR\fR
133 .RS 17n
134 Specifies messaging locale, and if present overrides \fBLANG\fR for messages.
138 .ne 2
140 \fB\fBTEXTDOMAIN\fR\fR
142 .RS 17n
143 Specifies the text domain name, which is identical to the message object
144 filename without \fB\&.mo\fR suffix.
148 .ne 2
150 \fB\fBTEXTDOMAINDIR\fR\fR
152 .RS 17n
153 Specifies the pathname to the message database. If present, replaces
154 \fB/usr/lib/locale\fR.
157 .SH SEE ALSO
160 \fBecho\fR(1), \fBmsgfmt\fR(1), \fBprintf\fR(1), \fBgettext\fR(3C),
161 \fBsetlocale\fR(3C), \fBattributes\fR(5)
162 .SH NOTES
165 This is the shell equivalent of the library routine \fBgettext\fR(3C).