manpagez: man pages & more
info gettext
Home | html | info | man

File: gettext.info,  Node: The printf_gettext approach,  Next: sh.php">Preparing for gettext.sh,  Prev: The printf approach,  Up: sh

16.5.15.4 The ‘printf_gettext’ approach
.......................................

   This approach uses the ‘printf_gettext’ and ‘printf_ngettext’
programs, contained in the run-time package of GNU gettext 0.26 or
newer.

   Here's an example that references a shell variable ‘pid’:
     printf_gettext 'Running as process number %u.' $pid; echo

   An example is available in the ‘hello-3.sh’ file in the
‘examples/hello-sh’ directory.

Advantages and Drawbacks
------------------------

   Advantages:
   • Portability: The only requirement is GNU gettext 0.26 or newer.
   • Speed: Since no subshell needs to be created, this approach is
     about 30% faster than the two other approaches.

   An example is available in the ‘hello-3.sh’ file in the
‘examples/hello-sh’ directory.

© manpagez.com 2000-2026
Individual documents may contain additional copyright information.