Next: , Previous: , Up: sh   [Contents][Index]


15.5.2.3 Invoking the gettext program

gettext [option] [[textdomain] msgid]
gettext [option] -s [msgid]...

The gettext program displays the native language translation of a textual message.

Arguments

-d textdomain
--domain=textdomain

Retrieve translated messages from textdomain. Usually a textdomain corresponds to a package, a program, or a module of a program.

-e

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

-E

This option is only for compatibility with the ‘echo’ program or shell built-in. It has no effect.

-h
--help

Display this help and exit.

-n

Suppress trailing newline. By default, gettext adds a newline to the output.

-V
--version

Output version information and exit.

[textdomain] msgid

Retrieve translated message corresponding to msgid from textdomain.

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

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

Note: xgettext supports only the one-argument form of the gettext invocation, where no options are present and the textdomain is implicit, from the environment.


Next: , Previous: , Up: sh   [Contents][Index]