From 3df1bd1ebf4dcf9d36007edbd6c2a6e95524e6e1 Mon Sep 17 00:00:00 2001 From: Kristopher Date: Mon, 26 May 2025 07:04:19 -0700 Subject: [PATCH] gettext: refresh page (#16555) Co-authored-by: Managor <42655600+Managor@users.noreply.github.com> --- pages/common/gettext.md | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/pages/common/gettext.md b/pages/common/gettext.md index 0201ac60b8..5f5b2bf4b9 100644 --- a/pages/common/gettext.md +++ b/pages/common/gettext.md @@ -1,12 +1,18 @@ # gettext -> Get string translations. +> Translates a string using stored translations in a compiled `.mo` file. +> Translations are stored in `/usr/share/locale//LC_MESSAGES/` with `domain` being the filename without its extension. +> See also: `msgfmt`, `msgunfmt`. > More information: . -- Get the translation of a string or output a default string if it doesn't exist: +- Get the translation of a string as specified in the domain file (falls back to given `msgid` if no translation exists): -`LANGUAGE={{locale}} gettext {{msgid}} {{default_value}}` +`LANGUAGE={{locale}} gettext {{[-d|--domain]}} {{domain}} "{{msgid}}"` - Display help: `gettext {{[-h|--help]}}` + +- Display gettext version: + +`gettext {{[-V|--version]}}`