2025-03-11 06:50:50 +02:00
|
|
|
# gettext
|
|
|
|
|
2025-05-26 07:04:19 -07:00
|
|
|
> 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`.
|
2025-03-11 06:50:50 +02:00
|
|
|
> More information: <https://www.gnu.org/software/gettext/manual/html_node/gettext-Invocation.html>.
|
|
|
|
|
2025-05-26 07:04:19 -07:00
|
|
|
- Get the translation of a string as specified in the domain file (falls back to given `msgid` if no translation exists):
|
2025-03-11 06:50:50 +02:00
|
|
|
|
2025-05-26 07:04:19 -07:00
|
|
|
`LANGUAGE={{locale}} gettext {{[-d|--domain]}} {{domain}} "{{msgid}}"`
|
2025-03-26 00:36:41 +02:00
|
|
|
|
|
|
|
- Display help:
|
|
|
|
|
|
|
|
`gettext {{[-h|--help]}}`
|
2025-05-26 07:04:19 -07:00
|
|
|
|
|
|
|
- Display gettext version:
|
|
|
|
|
|
|
|
`gettext {{[-V|--version]}}`
|