| PRINTF_NGETTEXT(1) | User Commands | PRINTF_NGETTEXT(1) |
printf_ngettext - translate format string and apply it
printf_ngettext [OPTION] FORMAT FORMAT-PLURAL COUNT [ARGUMENT]...
The printf_ngettext program translates a format string into the user's language, by looking up the translation in a message catalog and then choosing the appropriate plural form, which depends on the number COUNT and the language of the message catalog where the translation was found, and applies the translated format string to the specified arguments.
Produces formatted output, applying the native language translation of FORMAT and FORMAT-PLURAL, depending on COUNT, to the ARGUMENTs.
Each format string consists of
A directive that consumes an argument
Additionally there is the directive '%%', that prints a single '%'.
If a directive specifies the argument by its number ('%m$' notation), all directives that consume an argument must do so.
The escape sequences are:
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
Written by Bruno Haible.
Report bugs in the bug tracker at <https://savannah.gnu.org/projects/gettext> or by email to <bug-gettext@gnu.org>.
Copyright © 2025 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.
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
should give you access to the complete manual.
| July 2025 | GNU gettext-runtime 0.26 |