Training courses

Kernel and Embedded Linux

Bootlin training courses

Embedded Linux, kernel,
Yocto Project, Buildroot, real-time,
graphics, boot time, debugging...

Bootlin logo

Elixir Cross Referencer

@pindex gettext
@cindex @code{gettext} program, usage
@example
gettext [@var{option}] [[@var{textdomain}] @var{msgid}]
gettext [@var{option}] -s [@var{msgid}]...
@end example

@cindex lookup message translation
The @code{gettext} program displays the native language translation of a
textual message.

@noindent @strong{Arguments}

@table @samp
@item -d @var{textdomain}
@itemx --domain=@var{textdomain}
@opindex -d@r{, @code{gettext} option}
@opindex --domain@r{, @code{gettext} option}
Retrieve translated messages from @var{textdomain}.  Usually a @var{textdomain}
corresponds to a package, a program, or a module of a program.

@item -e
@opindex -e@r{, @code{gettext} option}
Enable expansion of some escape sequences.  This option is for compatibility
with the @samp{echo} program or shell built-in.  The escape sequences
@samp{\a}, @samp{\b}, @samp{\c}, @samp{\f}, @samp{\n}, @samp{\r}, @samp{\t},
@samp{\v}, @samp{\\}, and @samp{\} followed by one to three octal digits, are
interpreted like the System V @samp{echo} program did.

@item -E
@opindex -E@r{, @code{gettext} option}
This option is only for compatibility with the @samp{echo} program or shell
built-in.  It has no effect.

@item -h
@itemx --help
@opindex -h@r{, @code{gettext} option}
@opindex --help@r{, @code{gettext} option}
Display this help and exit.

@item -n
@opindex -n@r{, @code{gettext} option}
Suppress trailing newline.  By default, @code{gettext} adds a newline to
the output.

@item -V
@itemx --version
@opindex -V@r{, @code{gettext} option}
@opindex --version@r{, @code{gettext} option}
Output version information and exit.

@item [@var{textdomain}] @var{msgid}
Retrieve translated message corresponding to @var{msgid} from @var{textdomain}.

@end table

If the @var{textdomain} parameter is not given, the domain is determined from
the environment variable @code{TEXTDOMAIN}.  If the message catalog is not
found in the regular directory, another location can be specified with the
environment variable @code{TEXTDOMAINDIR}.

When used with the @code{-s} option the program behaves like the @samp{echo}
command.  But it does not simply copy its arguments to stdout.  Instead those
messages found in the selected catalog are translated.