Skip to content

gettext: refresh page #16555

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 32 commits into from
May 26, 2025
Merged
Changes from 12 commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
eb63df5
Update gettext.md
KristopherLeads May 21, 2025
78c7d1b
Update gettext.md
KristopherLeads May 21, 2025
ad7e3dc
Update gettext.md
KristopherLeads May 21, 2025
8128f93
Update gettext.md
KristopherLeads May 21, 2025
e65d165
Update pages/common/gettext.md
KristopherLeads May 21, 2025
b8d56b6
Update pages/common/gettext.md
KristopherLeads May 21, 2025
e326f4e
Update gettext.md
KristopherLeads May 21, 2025
1c155b1
Update pages/common/gettext.md
KristopherLeads May 21, 2025
5a4e98e
Update gettext.md
KristopherLeads May 21, 2025
e5327a0
Update gettext.md
KristopherLeads May 21, 2025
fc14447
Update gettext.md
KristopherLeads May 21, 2025
f0e65b5
Update gettext.md
KristopherLeads May 21, 2025
031f270
Update gettext.md
KristopherLeads May 21, 2025
f14a0fb
Update gettext.md
KristopherLeads May 21, 2025
6b3e0b2
Merge branch 'main' into gettext-update
KristopherLeads May 22, 2025
0036146
Update gettext.md
KristopherLeads May 22, 2025
c975e7e
Update gettext.md
KristopherLeads May 22, 2025
bc79a98
Update pages/common/gettext.md
KristopherLeads May 23, 2025
10ee5a4
Update pages/common/gettext.md
KristopherLeads May 23, 2025
75a9e38
Update pages/common/gettext.md
KristopherLeads May 23, 2025
c7a7f7b
Update pages/common/gettext.md
KristopherLeads May 23, 2025
69f4ad1
Update pages/common/gettext.md
KristopherLeads May 23, 2025
865d3da
Update pages/common/gettext.md
KristopherLeads May 23, 2025
62c55d2
Update pages/common/gettext.md
KristopherLeads May 23, 2025
8d64e83
Update pages/common/gettext.md
KristopherLeads May 23, 2025
9c544b5
Update gettext.md
KristopherLeads May 23, 2025
4d0c4fa
Update pages/common/gettext.md
KristopherLeads May 23, 2025
aa357ae
Update pages/common/gettext.md
KristopherLeads May 23, 2025
e7bfdac
Update gettext.md
KristopherLeads May 24, 2025
2537b39
Update gettext.md
KristopherLeads May 24, 2025
afdcd72
Update gettext.md
KristopherLeads May 24, 2025
8236954
Update gettext.md
Managor May 26, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 15 additions & 2 deletions pages/common/gettext.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,25 @@
# gettext

> Get string translations.
> Takes a string and tries to return the translated version based on your current language and app settings.
> By default, gettext looks for translations here: '<LOCALEDIR>/<LANG>/LC_MESSAGES/<domain>.mo'.
> For example, gettext would look for a Spanish translation file called asd.mo in 'locale/es/LC_MESSAGES/asd.mo'.
> Note that gettext looks in the global 'messages' domain. If you want to use any other domain, you need to use the 'context' or 'textdomain' optional flags.
> If no translation exists when gettext is invoked, it returns in English.
> See also: `msgfmt`.
> More information: <https://www.gnu.org/software/gettext/manual/html_node/gettext-Invocation.html>.

- Get the translation of a string or output a default string if it doesn't exist:
- Get the translation of a string, or output a default string if no translation exists:

`LANGUAGE={{locale}} gettext {{msgid}} {{default_value}}`

- Use context to disambiguate where you want the string origin to be located (e.g. Open "File" as a menu item, or linguistically as in "file away the burr"?):

`gettext {{[-c|--context]}} {{context}}`

- Specify the domain (e.g., package, program, module - the namespace or "filename") you want gettext to look inside for the translation:

`gettext {{[-d|--domain]}} {{textdomain}}`

- Display help:

`gettext {{[-h|--help]}}`
Loading