This variable contains a sequence of templates that the catopen() function uses when attempting to locate message catalogues. Each template consists of an optional prefix, one or more substitution fields, a filename and an optional suffix.

For example:


defines that catopen() should look for all message catalogues in the directory /usr/share/nls, where the catalogue name should be constructed from the name parameter passed to catopen() (%N), with the suffix .cat.

Substitution fields consist of a "%" symbol, followed by a single-letter keyword. The following keywords are currently defined:

The value of the name parameter passed to catopen().
The value of the LC_MESSAGES category.
The language element from the LC_MESSAGES category.
The territory element from the LC_MESSAGES category.
The codeset element from the LC_MESSAGES category.
A single % character.

An empty string is substituted if the specified value is not currently defined. The separators underscore (_) and period (.) are not included in %t and %c substitutions.

Templates defined in NLSPATH are separated by colons (:). A leading or two adjacent colons :: is equivalent to specifying %N. For example:


indicates to catopen() that it should look for the requested message catalogue in name, and /usr/share/locale/category/, where category is the value of the LC_MESSAGES category of the current locale.

Users should not set the NLSPATH variable unless they have a specific reason to override the default system path. Doing so causes undefined behaviour in the standard utilities.