php-doc-en/functions/gettext.xml
Hartmut Holzgraefe 00b4ce3753 function name fix (as reported in bug #15538)
git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@70159 c90b9560-bf6c-de11-be94-00142212c4b1
2002-02-13 11:07:25 +00:00

236 lines
7.5 KiB
XML

<?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision: 1.20 $ -->
<reference id="ref.gettext">
<title>Gettext</title>
<titleabbrev>gettext</titleabbrev>
<partintro>
<simpara>
The gettext functions implement a NLS (Native Language Support)
API which can be used to internationalize your PHP applications.
Please see the gettext documentation from your system for a thorough
explanation of these functions.
</simpara>
</partintro>
<refentry id="function.bindtextdomain">
<refnamediv>
<refname>bindtextdomain</refname>
<refpurpose>Sets the path for a domain</refpurpose>
</refnamediv>
<refsect1>
<title>Description</title>
<methodsynopsis>
<type>string</type><methodname>bindtextdomain</methodname>
<methodparam><type>string</type><parameter>domain</parameter></methodparam>
<methodparam><type>string</type><parameter>directory</parameter></methodparam>
</methodsynopsis>
<para>
The <function>bindtextdomain</function> function sets the path
for a domain.
</para>
</refsect1>
</refentry>
<refentry id='function.bind-textdomain-codeset'>
<refnamediv>
<refname>bind_textdomain_codeset</refname>
<refpurpose>
Specify the character encoding in which the messages from the
DOMAIN message catalog will be re turned
</refpurpose>
</refnamediv>
<refsect1>
<title>Description</title>
<methodsynopsis>
<type>string</type><methodname>bind_textdomain_codeset</methodname>
<methodparam><type>string</type><parameter>domain</parameter></methodparam>
<methodparam><type>string</type><parameter>codeset</parameter></methodparam>
</methodsynopsis>
<para>
&warn.undocumented.func;
</para>
</refsect1>
</refentry>
<refentry id="function.dcgettext">
<refnamediv>
<refname>dcgettext</refname>
<refpurpose>Overrides the domain for a single lookup</refpurpose>
</refnamediv>
<refsect1>
<title>Description</title>
<methodsynopsis>
<type>string</type><methodname>dcgettext</methodname>
<methodparam><type>string</type><parameter>domain</parameter></methodparam>
<methodparam><type>string</type><parameter>message</parameter></methodparam>
<methodparam><type>int</type><parameter>category</parameter></methodparam>
</methodsynopsis>
<para>
This function allows you to override the current domain for a
single message lookup. It also allows you to specify a category.
</para>
</refsect1>
</refentry>
<refentry id='function.dcngettext'>
<refnamediv>
<refname>dcngettext</refname>
<refpurpose>Plural version of dcgettext() Plural version of dcgettext</refpurpose>
</refnamediv>
<refsect1>
<title>Description</title>
<methodsynopsis>
<type>string</type><methodname>dcngettext</methodname>
<methodparam><type>string</type><parameter>domain</parameter></methodparam>
<methodparam><type>string</type><parameter>msgid1</parameter></methodparam>
<methodparam><type>string</type><parameter>msgid2</parameter></methodparam>
<methodparam><type>int</type><parameter>n</parameter></methodparam>
<methodparam><type>int</type><parameter>category</parameter></methodparam>
</methodsynopsis>
<para>
&warn.undocumented.func;
</para>
</refsect1>
</refentry>
<refentry id="function.dgettext">
<refnamediv>
<refname>dgettext</refname>
<refpurpose>Override the current domain</refpurpose>
</refnamediv>
<refsect1>
<title>Description</title>
<methodsynopsis>
<type>string</type><methodname>dgettext</methodname>
<methodparam><type>string</type><parameter>domain</parameter></methodparam>
<methodparam><type>string</type><parameter>message</parameter></methodparam>
</methodsynopsis>
<para>
The <function>dgettext</function> function allows you to override
the current domain for a single message lookup.
</para>
</refsect1>
</refentry>
<refentry id='function.dngettext'>
<refnamediv>
<refname>dngettext</refname>
<refpurpose>Plural version of dcgettext() Plural version of dgettext</refpurpose>
</refnamediv>
<refsect1>
<title>Description</title>
<methodsynopsis>
<type>string</type><methodname>dngettext</methodname>
<methodparam><type>string</type><parameter>domain</parameter></methodparam>
<methodparam><type>string</type><parameter>msgid1</parameter></methodparam>
<methodparam><type>string</type><parameter>msgid2</parameter></methodparam>
<methodparam><type>int</type><parameter>n</parameter></methodparam>
</methodsynopsis>
<para>
&warn.undocumented.func;
</para>
</refsect1>
</refentry>
<refentry id="function.gettext">
<refnamediv>
<refname>gettext</refname>
<refpurpose>Lookup a message in the current domain</refpurpose>
</refnamediv>
<refsect1>
<title>Description</title>
<methodsynopsis>
<type>string</type><methodname>gettext</methodname>
<methodparam><type>string</type><parameter>message</parameter></methodparam>
</methodsynopsis>
<para>
This function returns a translated string if one is found in the
translation table, or the submitted message if not found. You may
use an underscore character as an alias to this function.
</para>
<example>
<title><function>gettext</function>-check</title>
<programlisting>
<![CDATA[
<?php
// Set language to German
putenv ("LANG=de");
// Specify location of translation tables
bindtextdomain ("myPHPApp", "./locale");
// Choose domain
textdomain ("myPHPApp");
// Print a test message
print (gettext ("Welcome to My PHP Application"));
?>
]]>
</programlisting>
</example>
</refsect1>
</refentry>
<refentry id="function.ngettext">
<refnamediv>
<refname>ngettext</refname>
<refpurpose>Plural version of gettext</refpurpose>
</refnamediv>
<refsect1>
<title>Description</title>
<methodsynopsis>
<type>string</type><methodname>ngettext</methodname>
<methodparam><type>string</type><parameter>msgid1</parameter></methodparam>
<methodparam><type>string</type><parameter>msgid2</parameter></methodparam>
<methodparam><type>int</type><parameter>n</parameter></methodparam>
</methodsynopsis>
<para>
&warn.undocumented.func;
</para>
</refsect1>
</refentry>
<refentry id="function.textdomain">
<refnamediv>
<refname>textdomain</refname>
<refpurpose>Sets the default domain</refpurpose>
</refnamediv>
<refsect1>
<title>Description</title>
<methodsynopsis>
<type>string</type><methodname>textdomain</methodname>
<methodparam><type>string</type><parameter>text_domain</parameter></methodparam>
</methodsynopsis>
<para>
This function sets the domain to search within when calls are
made to <function>gettext</function>, usually the named after an
application. The previous default domain is returned.
Call it with &null; as parameter to get the current setting without
changing it.
</para>
</refsect1>
</refentry>
</reference>
<!-- Keep this comment at the end of the file
Local variables:
mode: sgml
sgml-omittag:t
sgml-shorttag:t
sgml-minimize-attributes:nil
sgml-always-quote-attributes:t
sgml-indent-step:1
sgml-indent-data:t
indent-tabs-mode:nil
sgml-parent-document:nil
sgml-default-dtd-file:"../../manual.ced"
sgml-exposed-tags:nil
sgml-local-catalogs:nil
sgml-local-ecat-files:nil
End:
vim600: syn=xml fen fdm=syntax fdl=2 si
vim: et tw=78 syn=sgml
vi: ts=1 sw=1
-->