Pike v8.0 release 1738

Method Locale.Gettext.bindtextdomain()


Method bindtextdomain

string bindtextdomain(string|void domainname, string|void dirname)

Description

Binds the path predicate for a message domainname domainname to the directory name specified by dirname.

If domainname is a non-empty string and has not been bound previously, bindtextdomain() binds domainname with dirname.

If domainname is a non-empty string and has been bound previously, bindtextdomain() replaces the old binding with dirname.

The dirname argument can be an absolute or relative pathname being resolved when gettext(), dgettext() or dcgettext() are called.

If domainname is zero or an empty string, bindtextdomain() returns 0.

User defined domain names cannot begin with the string "SYS_". Domain names beginning with this string are reserved for system use.

Returns

The return value from bindtextdomain() is a string containing dirname or the directory binding associated with domainname if dirname is unspecified. If no binding is found, the default locale path is returned. If domainname is unspecified or is an empty string, bindtextdomain() takes no action and returns a 0.

See also

textdomain, gettext, setlocale, localeconv