Skip site navigation (1)Skip section navigation (2)

FreeBSD Manual Pages

  
 
  

home | help
PRINTF_NGETTEXT(1)		  User Commands 	      PRINTF_NGETTEXT(1)

NAME
     printf_ngettext - translate format string and apply it

SYNOPSIS
     printf_ngettext [OPTION] FORMAT FORMAT-PLURAL COUNT [ARGUMENT]...

DESCRIPTION
     The printf_ngettext program translates a format string into the user's lan-
     guage, by looking up the translation in a message catalog and then choosing
     the appropriate plural form, which depends on the number COUNT and the lan-
     guage  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 FOR-
     MAT and FORMAT-PLURAL, depending on COUNT, to the ARGUMENTs.

   Options and arguments:
     -c, --context=CONTEXT
	    specify context for FORMAT

     FORMAT
	    English singular form of format string

     FORMAT-PLURAL
	    English plural form of format string

     COUNT  choose singular/plural form based on this value

     ARGUMENT
	    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  op-
	    tionally followed by any of the characters '#', '0', '-', ' ', '+',

	    each of which acts as a flag,

	    - is optionally followed by a width specification (a nonnegative in-
	    teger),  -	is optionally followed by '.' and a precision specifica-
	    tion (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 un-
	    signed (nonnegative) integer,  -  'e',  'E',  that	print  a  float-
	    ing-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 '%'.

     If a directive specifies the argument by its number ('%m$'  notation),  all
     directives that consume an argument must do so.

     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 cata-
     logs  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/local/share/locale

AUTHOR
     Written by Bruno Haible.

REPORTING BUGS
     Report  bugs  in the bug tracker at <https://savannah.gnu.org/projects/get-
     text> or by email to <bug-gettext@gnu.org>.

COPYRIGHT
     Copyright (C) 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.

SEE ALSO
     The  full documentation for printf_ngettext is maintained as a Texinfo man-
     ual.  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.

GNU gettext-runtime 1.0 	  January 2026		      PRINTF_NGETTEXT(1)

Want to link to this manual page? Use this URL:
<https://man.freebsd.org/cgi/man.cgi?query=printf_ngettext&sektion=1&manpath=FreeBSD+Ports+15.1.quarterly>

home | help