Name
gettext
Synopsis
gettext [options
] [domain
]string
Solaris and GNU/Linux only. Retrieve and print the
translated version of string. This provides
shell-level access to the facilities of
gettext (3C). Translations are looked up in
the file lang /LC_MESSAGES/
domain .mo
in the system’s translation directory. lang
is the current locale (e.g., en_US
). If domain
is not supplied, the value of $TEXTDOMAIN is used instead. Without
a domain, or if no translation can be found, gettext simply prints
string. If $TEXTDOMAINDIR exists, its value
is used instead of the system default.
Tip
The GNU version of gettext and the accompanying commands and library functions are an extension of the original Solaris design from the early 1990s. Modern Solaris versions of the commands have picked up some of the features first developed for the GNU version. Thus, for example, even the Solaris version of this command accepts long options.
Options
-d
domain
,--domain=
domain
Retrieve messages from the domain text domain.
-
-e
Enable expansion of some escape sequences. Use with
-s
.-h
,--help
Print a command-line summary and exit. GNU/Linux only.
-
-n
Don’t print the trailing newline. Use with
-s
.-
-s
Enable echo-like features (
-e
and-n
).-V
,--version
Print version information and exit. GNU/Linux only.
Get Unix in a Nutshell, 4th Edition now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.