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

File: gettext.info,  Node: sh,  Next: bash,  Prev: Ruby,  Up: List of Programming Languages

16.5.15 sh - Shell Script
-------------------------

RPMs
     bash, gettext

Ubuntu packages
     bash, gettext-base

File extension
     ‘sh’

String syntax
     ‘"abc"’, ‘'abc'’, ‘abc’

gettext shorthand
     ‘"`gettext \"abc\"`"’

gettext/ngettext functions
     ‘gettext’, ‘ngettext’ programs
     ‘eval_gettext’, ‘eval_ngettext’, ‘eval_pgettext’, ‘eval_npgettext’
     shell functions
     ‘printf_gettext’, ‘printf_ngettext’ commands

textdomain
     environment variable ‘TEXTDOMAIN’

bindtextdomain
     environment variable ‘TEXTDOMAINDIR’

setlocale
     automatic

Prerequisite
     For the shell functions approach: ‘. gettext.sh’

Use or emulate GNU gettext
     use

Extractor
     ‘xgettext’

Formatting with positions
     There are three approaches; see below for details.

Portability
     fully portable

po-mode marking
     --

   An example is available in the ‘examples’ directory: ‘hello-sh’.

* Menu:

* sh - Three approaches::       Three approaches for Shell Scripts
* The gettext.sh approach::     The ‘gettext.sh’ approach
* The printf approach::         The ‘printf’ approach
* The printf_gettext approach:: The ‘printf_gettext’ approach
* Preparing for gettext.sh::    Preparing Shell Scripts for the ‘gettext.sh’ approach
* Preparing for printf::        Preparing Shell Scripts for the ‘printf’ approach
* Preparing for printf_gettext:: Preparing Shell Scripts for the ‘printf_gettext’ approach
* gettext Invocation::          Invoking the ‘gettext’ program
* ngettext Invocation::         Invoking the ‘ngettext’ program
* printf_gettext Invocation::   Invoking the ‘printf_gettext’ program
* printf_ngettext Invocation::  Invoking the ‘printf_ngettext’ program
* envsubst Invocation::         Invoking the ‘envsubst’ program
* eval_gettext Invocation::     Invoking the ‘eval_gettext’ function
* eval_ngettext Invocation::    Invoking the ‘eval_ngettext’ function
* eval_pgettext Invocation::    Invoking the ‘eval_pgettext’ function
* eval_npgettext Invocation::   Invoking the ‘eval_npgettext’ function

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