PRINTF_NGETTEXT(1)
๐ PRINTF_NGETTEXT ๐
okay bestie, welcome to the printf_ngettext(1) page โ yes it's a User Commands one, yes it lives in section 1, and yes it's about to become your new fave ๐ซถ
โจ NAME โจ
printf_ngettext โ translate a format string and then apply it ๐
๐ธ SYNOPSIS ๐ธ
printf_ngettext [OPTION] FORMAT FORMAT-PLURAL COUNT [ARGUMENT]...
๐ฆ DESCRIPTION ๐ฆ
So printf_ngettext takes a format string and translates it into whatever language the user is vibing in โ it looks the translation up in a message catalog, then picks the right plural form based on the number COUNT and the language of the message catalog where it actually found the translation. Then it applies that translated format string to the arguments you gave it. the way it's multilingual AND plural-aware? iconic, honestly ๐
It produces formatted output, applying the native language translation of FORMAT and FORMAT-PLURAL, depending on COUNT, to the ARGUMENTs. โจ
๐ Options and arguments: ๐
-c,--context=CONTEXTโ specify context forFORMATFORMATโ English singular form of format stringFORMAT-PLURALโ English plural form of format stringCOUNTโ choose singular/plural form based on this valueARGUMENTโ string or numeric argument
๐ Informative output: ๐
-h,--helpโ display this help and exit-V,--versionโ display version information and exit
Each format string consists of
- plain text,
- directives, that start with
%, - escape sequences, that start with a backslash.
A directive that consumes an argument
- starts with
%or%m$where m is a positive integer, - is optionally followed by any of the characters
#,0,-,,+,
each of which acts as a flag,
- is optionally followed by a width specification (a nonnegative integer),
- is optionally followed by
.and a precision specification (an optional nonnegative integer), - is finished by a specifier
c, that prints a character,s, that prints a string,i,d, that print an integer,u,o,x,X, that print an unsigned (nonnegative) integer,e,E, that print a floating-point number in scientific notation,f,F, that print a floating-point number without an exponent,g,G, that print a floating-point number in general notation,a,A, that print a floating-point number in hexadecimal notation.
Additionally there is the directive %%, that prints a single %. ๐
โ ๏ธ Heads up bestie: if a directive specifies the argument by its number (%m$ notation), all directives that consume an argument must do so. it's all-or-nothing, no cap ๐จ
๐ง The escape sequences are: ๐ง
\\โ backslash\aโ alert (BEL)\bโ backspace (BS)\fโ form feed (FF)\nโ new line (LF)\rโ carriage return (CR)\tโ horizontal tab (HT)\vโ vertical tab (VT)\nnnโ octal number with 1 to 3 octal digits
๐ Environment variables: ๐
The translation of the format string is looked up in the translation domain given by the environment variable TEXTDOMAIN. It is looked up in the catalogs directory given by the environment variable TEXTDOMAINDIR or, if not present, in the default catalogs directory. This binary is configured to use the default catalogs directory: /usr/share/locale
๐ AUTHOR ๐
Written by Bruno Haible. (shoutout to the legend fr fr ๐)
๐ฅ REPORTING BUGS ๐ฅ
Report bugs in the bug tracker at <https://savannah.gnu.org/projects/gettext> or by email to <bug-gettext@gnu.org>.
๐ COPYRIGHT ๐
Copyright ยฉ 2025-2026 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later <https://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law.
not the "no warranty" part being in all caps ๐ญ read it, bestie, it matters
๐ SEE ALSO ๐
The full documentation for printf_ngettext is maintained as a Texinfo manual. If the info and printf_ngettext programs are properly installed at your site, the command
info printf_ngettext
should give you access to the complete manual. ๐ฆ
and that's the whole page, bestie!! this was GNU gettext-runtime 1.0, dated January 2026 โ so if you ever need to cite it, that's the vibe ๐
โจ mwah, go translate something gorgeous ๐๐
๐ฆ where this page comes from
- alpine 3.24: gettext-doc 1.0-r0 ยท GPL-3.0-or-later AND LGPL-2.1-or-later AND MIT
- arch rolling: gettext 1.0-2 ยท GFDL-1.2-only AND GPL-2.0-only AND GPL-2.0-or-later AND LGPL-2.0-only
- ubuntu stonking: gettext-base 1.0-3 ยท GPL-3.0-or-later
- ๐ girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms