commands.sh

gettext

all

Translates a string using stored translations in a compiled `.mo` file. Translations are stored in `/usr/share/locale/locale_name/LC_MESSAGES/` with `domain` being the filename without its extension. See also: `msgfmt`, `msgunfmt`.

More info →

Options (3)

-d, --domainboolean

Get the translation of a string as specified in the domain file (falls back to given `msgid` if no translation exists)

Example: LANGUAGE={{locale}} gettext {{[-d|--domain]}} {{domain}} "{{msgid}}"
-h, --helpboolean

Display help

Example: gettext {{[-h|--help]}}
-V, --versionboolean

Display version

Example: gettext {{[-V|--version]}}

Examples (3)

Get the translation of a string as specified in the domain file (falls back to given `msgid` if no translation exists)

LANGUAGE=locale gettext [-d|--domain] domain "msgid"

Display help

gettext [-h|--help]

Display version

gettext [-V|--version]
made by @shridhargupta | data from tldr-pages