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 null pointer 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. The return value from bindtextdomain() is a string containing dirname or the directory binding associated with domainname if dirname is void. If no binding is found, the default locale path is returned. If domainname is void or an empty string, bindtextdomain() takes no action and returns a 0.
argument(s) | description |
string domainname | The domain to query or bind a path to. |
string dirname | The directory name to bind to the choosen domain. |
argument(s) | description |
string domain | The domain to lookup the message in. |
string msg | The message to translate. |
int category | The category which locale should be used. |
argument(s) | description |
string domain | The domain to lookup the message in. |
string msg | The message to translate. |
argument(s) | description |
string msg | The message to translate. |
string decimal_point: The decimal-point character used to format non-monetary quantities.
string thousands_sep: The character used to separate groups of digits to the left of the decimal-point character in formatted non-monetary quantities.
string int_curr_symbol: The international currency symbol applicable to the current locale, left-justified within a four-character space-padded field. The character sequences should match with those specified in ISO 4217 Codes for the Representation of Currency and Funds.
string currency_symbol: The local currency symbol applicable to the current locale.
string mon_decimal_point: The decimal point used to format monetary quantities.
string mon_thousands_sep: The separator for groups of digits to the left of the decimal point in formatted monetary quantities.
string positive_sign: The string used to indicate a non-negative-valued formatted monetary quantity.
string negative_sign: The string used to indicate a negative-valued formatted monetary quantity.
int int_frac_digits: The number of fractional digits (those to the right of the decimal point) to be displayed in an internationally formatted monetary quantity.
int frac_digits: The number of fractional digits (those to the right of the decimal point) to be displayed in a formatted monetary quantity.
int p_cs_precedes: Set to 1 or 0 if the currency_symbol respectively precedes or succeeds the value for a non-negative formatted monetary quantity.
int p_sep_by_space: Set to 1 or 0 if the currency_symbol respectively is or is not separated by a space from the value for a non-negative formatted monetary quantity.
int n_cs_precedes: Set to 1 or 0 if the currency_symbol respectively precedes or succeeds the value for a negative formatted monetary quantity.
int n_sep_by_space: Set to 1 or 0 if the currency_symbol respectively is or is not separated by a space from the value for a negative formatted monetary quantity.
int p_sign_posn: Set to a value indicating the positioning of the positive_sign for a non-negative formatted monetary quantity. The value of p_sign_posn is interpreted according to the following:
0 - Parentheses surround the quantity and currency_symbol.
1 - The sign string precedes the quantity and currency_symbol.
2 - The sign string succeeds the quantity and currency_symbol.
3 - The sign string immediately precedes the currency_symbol.
4 - The sign string immediately succeeds the currency_symbol.
int n_sign_posn: Set to a value indicating the positioning of the negative_sign for a negative formatted monetary quantity. The value of n_sign_posn is interpreted according to the rules described under p_sign_posn.
If locale is "", the locale is set to the default locale which is selected from the environment variable LANG.
The argument category determines which functions are influenced by the new locale: Locale.Gettext.LC_ALL for all of the locale.
Locale.Gettext.LC_COLLATE for the functions strcoll() and strxfrm() (used by pike, but not directly accessible).
Locale.Gettext.LC_CTYPE for the character classification and conversion routines.
Locale.Gettext.LC_MONETARY for localeconv(). Locale.Gettext.LC_NUMERIC for the decimal character. Locale.Gettext.LC_TIME for strftime() (currently not accessible from Pike).
argument(s) | description |
int category | The category in which to set the locale. |
string locale | The locale to change to |
The domainname argument is the unique name of a domain on the system. If there are multiple versions of the same domain on one system, namespace collisions can be avoided by using bindtextdomain(). If textdomain() is not called, a default domain is selected. The setting of domain made by the last valid call to textdomain() remains valid across subsequent calls to setlocale, and gettext(). The normal return value from textdomain() is a string containing the current setting of the domain. If domainname is void, textdomain() returns a string containing the current domain. If textdomain() was not previously called and domainname is void, the name of the default domain is returned.
argument(s) | description |
string domainname | The name of the domain to be made the current domain. |