Branch: Tag:

2000-02-29

2000-02-29 20:33:48 by David Hedbor <david@hedbor.org>

First submit of Gettext module

Rev: src/modules/Gettext/.cvsignore:1.1
Rev: src/modules/Gettext/Makefile.in:1.1
Rev: src/modules/Gettext/acconfig.h:1.1
Rev: src/modules/Gettext/configure.in:1.1
Rev: src/modules/Gettext/gettext.c:1.1

1838:   </docgroup>   </class>   </module> + <module name='Gettext'> + <doc> + <text> + <p> + This module enables access to localization functions from within Pike. + </p> + </text> +  + </doc> + <docgroup homogen-name='bindtextdomain' homogen-type='method'> + <method name='bindtextdomain'> +  <returntype> +  <object>string </object></returntype> +  <arguments><argument name='domainname'><type> +  <or><string/><void/></or></type></argument> + <argument name='string|voiddirname'><type> +  <object resolved='predef::Gettext.bindtextdomain'/></type></argument> +  +  </arguments> + </method><doc> + <text> + <p>The bindtextdomain() function binds the path predicate for a + message domain domainname to the value contained in dirname. If + domainname is a non-empty string and has not been bound + previously, bindtextdomain() binds domainname with dirname.</p> +  + <p>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.</p> +  + <p>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. + </p> + </text> + <group> +  <param name='domainname'/> + <text><p>The domain to query or bind a path to.</p></text></group> + <group> +  <param name='dirname'/> + <text><p>The directory name to bind to the choosen domain.</p></text></group> + <group><seealso/><text> + <p><ref resolved='predef::Gettext.textdomain'>textdomain</ref>, <ref resolved='predef::Gettext.gettext'>gettext</ref>, <ref resolved='predef::Gettext.dgettext'>dgettext</ref>, <ref resolved='predef::Gettext.dcgettext'>dcgettext</ref>, <ref resolved='predef::Gettext.setlocale'>setlocale</ref>, <ref resolved='predef::Gettext.localeconv'>localeconv</ref></p></text></group> +  + </doc> + </docgroup> + <docgroup homogen-name='dcgettext' homogen-type='method'> + <method name='dcgettext'> +  <returntype> +  <object>string </object></returntype> +  <arguments><argument name='domain'><type><string/></type></argument> + <argument name='stringmsg'><type> +  <object resolved='predef::Gettext.dcgettext'/></type></argument> + <argument name='intcategory'><type> +  <object resolved='predef::Gettext.dcgettext'/></type></argument> +  +  </arguments> + </method><doc> + <text> + <p>Return a translated version of msg within the context of the + specified domain and current locale for the specified + category. Calling dcgettext with category + Locale.Gettext.LC_MESSAGES gives the same result as dgettext.</p> +  + <p>If there is not translation available, msg is returned. + </p> + </text> + <group> +  <param name='domain'/> + <text><p>The domain to lookup the message in.</p></text></group> + <group> +  <param name='msg'/> + <text><p>The message to translate.</p></text></group> + <group> +  <param name='category'/> + <text><p>The category which locale should be used.</p></text></group> + <group><seealso/><text> + <p><ref resolved='predef::Gettext.bindtextdomain'>bindtextdomain</ref>, <ref resolved='predef::Gettext.textdomain'>textdomain</ref>, <ref resolved='predef::Gettext.gettext'>gettext</ref>, <ref resolved='predef::Gettext.dgettext'>dgettext</ref>, <ref resolved='predef::Gettext.setlocale'>setlocale</ref>, <ref resolved='predef::Gettext.localeconv'>localeconv</ref></p></text></group> +  + </doc> + </docgroup> + <docgroup homogen-name='dgettext' homogen-type='method'> + <method name='dgettext'> +  <returntype> +  <object>string </object></returntype> +  <arguments><argument name='domain'><type><string/></type></argument> + <argument name='stringmsg'><type> +  <object resolved='predef::Gettext.dgettext'/></type></argument> +  +  </arguments> + </method><doc> + <text> + <p>Return a translated version of msg within the context + of the specified domain and current locale.</p> +  + <p>If there is not translation available, msg is returned. + </p> + </text> + <group> +  <param name='domain'/> + <text><p>The domain to lookup the message in.</p></text></group> + <group> +  <param name='msg'/> + <text><p>The message to translate.</p></text></group> + <group><seealso/><text> + <p><ref resolved='predef::Gettext.bindtextdomain'>bindtextdomain</ref>, <ref resolved='predef::Gettext.textdomain'>textdomain</ref>, <ref resolved='predef::Gettext.gettext'>gettext</ref>, <ref resolved='predef::Gettext.dcgettext'>dcgettext</ref>, <ref resolved='predef::Gettext.setlocale'>setlocale</ref>, <ref resolved='predef::Gettext.localeconv'>localeconv</ref></p></text></group> +  + </doc> + </docgroup> + <docgroup homogen-name='gettext' homogen-type='method'> + <method name='gettext'> +  <returntype> +  <object>string </object></returntype> +  <arguments><argument name='msg'><type><string/></type></argument> +  +  </arguments> + </method><doc> + <text> + <p>Return a translated version of msg within the context + of the current domain and locale.</p> +  + <p>If there is not translation available, msg is returned.</p> + </text> + <group> +  <param name='msg'/> + <text><p>The message to translate.</p></text></group> + <group><seealso/><text> + <p><ref resolved='predef::Gettext.bindtextdomain'>bindtextdomain</ref>, <ref resolved='predef::Gettext.textdomain'>textdomain</ref>, <ref resolved='predef::Gettext.dgettext'>dgettext</ref>, <ref resolved='predef::Gettext.dcgettext'>dcgettext</ref>, <ref resolved='predef::Gettext.setlocale'>setlocale</ref>, <ref resolved='predef::Gettext.localeconv'>localeconv</ref></p></text></group> +  + </doc> + </docgroup> + <docgroup homogen-name='localeconv' homogen-type='method'> + <method name='localeconv'> +  <returntype> +  <object>mapping </object></returntype> +  <arguments> +  </arguments> + </method><doc> + <text> + <p>The localeconv() function returns a mapping with settings for + the current locale. This mapping contains all values + associated with the locale categories LC_NUMERIC and + LC_MONETARY.</p> +  + <p><b>string decimal_point:</b> +  The decimal-point character used to format +  non-monetary quantities.</p> +  + <p><b>string thousands_sep:</b> +  The character used to separate groups of digits to +  the left of the decimal-point character in +  formatted non-monetary quantities.</p> +  + <p><b>string int_curr_symbol:</b> +  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.</p> +  + <p><b>string currency_symbol:</b> +  The local currency symbol applicable to the +  current locale.</p> +  + <p><b>string mon_decimal_point:</b> +  The decimal point used to format monetary quantities.</p> +  + <p><b>string mon_thousands_sep:</b> +  The separator for groups of digits to the left of +  the decimal point in formatted monetary quantities.</p> +  + <p><b>string positive_sign:</b> +  The string used to indicate a non-negative-valued +  formatted monetary quantity.</p> +  + <p><b>string negative_sign:</b> +  The string used to indicate a negative-valued +  formatted monetary quantity.</p> +  + <p><b>int int_frac_digits:</b> +  The number of fractional digits (those to the +  right of the decimal point) to be displayed in an +  internationally formatted monetary quantity.</p> +  + <p><b>int frac_digits:</b> +  The number of fractional digits (those to the +  right of the decimal point) to be displayed in a +  formatted monetary quantity.</p> +  + <p><b>int p_cs_precedes:</b> +  Set to 1 or 0 if the currency_symbol respectively +  precedes or succeeds the value for a non-negative +  formatted monetary quantity.</p> +  + <p><b>int p_sep_by_space:</b> +  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.</p> +  + <p><b>int n_cs_precedes:</b> +  Set to 1 or 0 if the currency_symbol respectively +  precedes or succeeds the value for a negative +  formatted monetary quantity.</p> +  + <p><b>int n_sep_by_space:</b> +  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.</p> +  + <p><b>int p_sign_posn:</b> +  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:</p> +  + <p> 0 - Parentheses surround the quantity and +  currency_symbol.</p> +  + <p> 1 - The sign string precedes the quantity and +  currency_symbol.</p> +  + <p> 2 - The sign string succeeds the quantity +  and currency_symbol.</p> +  + <p> 3 - The sign string immediately precedes the +  currency_symbol.</p> +  + <p> 4 - The sign string immediately succeeds the +  currency_symbol.</p> +  + <p><b>int n_sign_posn:</b> +  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.</p> + </text> +  + </doc> + </docgroup> + <docgroup homogen-name='setlocale' homogen-type='method'> + <method name='setlocale'> +  <returntype> +  <object>int </object></returntype> +  <arguments><argument name='category'><type><int/></type></argument> + <argument name='stringlocale'><type> +  <object resolved='predef::Gettext.setlocale'/></type></argument> +  +  </arguments> + </method><doc> + <text> + <p>The setlocale() function is used to set the program's + current locale. If locale is "C" or "POSIX", the current + locale is set to the portable locale.</p> +  + <p>If locale is "", the locale is set to the default locale which + is selected from the environment variable LANG.</p> +  + <p>The argument category determines which functions are + influenced by the new locale:</p> +  + <p><b>Locale.Gettext.LC_ALL</b> for all of the locale.</p> +  + <p><b>Locale.Gettext.LC_COLLATE</b> for the functions strcoll() and + strxfrm() (used by pike, but not directly accessible).</p> +  + <p><b>Locale.Gettext.LC_CTYPE</b> for the character classification and + conversion routines.</p> +  + <p><b>Locale.Gettext.LC_MONETARY</b> for localeconv().</p> +  + <p><b>Locale.Gettext.LC_NUMERIC</b> for the decimal character.</p> +  + <p><b>Locale.Gettext.LC_TIME</b> for strftime() (currently not accessible + from Pike). + </p> + </text> + <group> +  <param name='category'/> + <text><p>The category in which to set the locale.</p></text></group> + <group> +  <param name='locale'/> + <text><p>The locale to change to</p></text></group> + <group><returns/><text> + <p>1 if the locale setting successed, 0 for failure</p> + </text></group> + <group><seealso/><text> + <p><ref resolved='predef::Gettext.bindtextdomain'>bindtextdomain</ref>, <ref resolved='predef::Gettext.textdomain'>textdomain</ref>, <ref resolved='predef::Gettext.gettext'>gettext</ref>, <ref resolved='predef::Gettext.dgettext'>dgettext</ref>, <ref resolved='predef::Gettext.dcgettext'>dcgettext</ref>, <ref resolved='predef::Gettext.localeconv'>localeconv</ref></p></text></group> +  + </doc> + </docgroup> + <docgroup homogen-name='textdomain' homogen-type='method'> + <method name='textdomain'> +  <returntype> +  <object>string </object></returntype> +  <arguments><argument name='domain|void'><type><string/></type></argument> +  +  </arguments> + </method><method name='textdomain'> +  <returntype> +  <object>string </object></returntype> +  <arguments><argument/> +  +  </arguments> + </method><doc> + <text> + <p>The textdomain() function sets or queries the name of the + current domain of the active LC_MESSAGES locale category. The + domainname argument is a string that can contain only the + characters allowed in legal filenames.</p> +  + <p>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().</p> +  + <p>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.</p> + </text> + <group> +  <param name='domainname'/> + <text><p>The name of the domain to be made the current domain.</p></text></group> + <group><seealso/><text> + <p><ref resolved='predef::Gettext.bindtextdomain'>bindtextdomain</ref>, <ref resolved='predef::Gettext.gettext'>gettext</ref>, <ref resolved='predef::Gettext.dgettext'>dgettext</ref>, <ref resolved='predef::Gettext.dcgettext'>dcgettext</ref>, <ref resolved='predef::Gettext.setlocale'>setlocale</ref>, <ref resolved='predef::Gettext.localeconv'>localeconv</ref></p></text></group> +  + </doc> + </docgroup> + </module>   <module name='Gmp'>   <class name='mpz'>   <doc placeholder='true'>